[alsa-devel] Using MMAP feature
Hello,
I'm going to use the MMAP feature of ALSA. I understood I have to use snd_pcm_mmap_begin and snd_pcm_mmap_commit functions, but I can't understand the meaning of some parameters in the snd_pcm_mmap_begin function: when I call this function in order to have access to the capture stream on a call like this:
err = snd_pcm_mmap_begin(capture, &c_area, &c_offset, &c_frames);
it keeps to return c_frames = 0: is it right ? what does this mean? is the buffer full so that I can read samples or the available contiguous space to be read is 0?
Thank you,
Alberto
alberto Villa wrote:> Hello,
I'm going to use the MMAP feature of ALSA.
Why do you need to do this?
snd_pcm_mmap_begin(capture, &c_area, &c_offset, &c_frames);
it keeps to return c_frames = 0: is it right ? what does this mean?
It means that there are no samples available at the moment. (Or that you forgot to call snd_pcm_avail_update(), or that you didn't set c_frames before the call.)
Regards, Clemens
participants (2)
-
alberto Villa
-
Clemens Ladisch