[alsa-devel] snd_pcm_mmap_commit

Jaroslav Kysela perex at perex.cz
Fri Nov 19 08:11:03 CET 2010


On Fri, 19 Nov 2010, Irfan Shaikh wrote:

> /*************************************************************/
> Code below O/p results runs in a while loop till end of PCM data.
> 1) First time O/p is
>          Farames available : 1024                                                /*Return VALUE of snd_pcm_avail_update*/
>          >>>>>>>>>>>>>>>>>>>>>>>>>Begin result : 0      /*Return VALUE of snd_pcm_mmap_begin*/
>          Address outbuffer : 0xcff88
>          >>>>>>>>>>>>>>>>>>>>>>Comit result : 1024       /*SUCESSFUL - Return VALUE of  snd_pcm_mmap_commi*/
>
> 2) Second time onwards ALWAYS O/p is
>          Farames available : 0                                                      /*Return VALUE of snd_pcm_avail_update*/
>          >>>>>>>>>>>>>>>>>>>>>>>>>Begin result : 0      /*Return VALUE of snd_pcm_mmap_begin*/
>          Address outbuffer : 0xcff88
>          >>>>>>>>>>>>>>>>>>>>>>Comit result : 0             /*FAILURE - Return VALUE of  snd_pcm_mmap_commit*/

You have to use poll()/select() or snd_pcm_wait() to wait for a room in 
the playback buffer. The direct mmap I/O is always non-blocked.

 						Jaroslav

-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.



More information about the Alsa-devel mailing list