mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 22:26:29 +01:00
aplay - show sample arrangement (mmap areas) in verbose more for debugging
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
3b8bdeb3fc
commit
6bd621177d
1 changed files with 16 additions and 0 deletions
|
@ -1073,6 +1073,22 @@ static void set_params(void)
|
|||
if (hwparams.channels != 2 || !interleaved || verbose > 2)
|
||||
vumeter = VUMETER_MONO;
|
||||
}
|
||||
|
||||
/* show mmap buffer arragment */
|
||||
if (mmap_flag && verbose) {
|
||||
const snd_pcm_channel_area_t *areas;
|
||||
snd_pcm_uframes_t offset;
|
||||
int i;
|
||||
err = snd_pcm_mmap_begin(handle, &areas, &offset, &chunk_size);
|
||||
if (err < 0) {
|
||||
error("snd_pcm_mmap_begin problem: %s", snd_strerror(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
for (i = 0; i < hwparams.channels; i++)
|
||||
fprintf(stderr, "mmap_area[%i] = %p,%u,%u (%u)\n", i, areas[i].addr, areas[i].first, areas[i].step, snd_pcm_format_physical_width(hwparams.format));
|
||||
/* not required, but for sure */
|
||||
snd_pcm_mmap_commit(handle, offset, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef timersub
|
||||
|
|
Loading…
Reference in a new issue