On Fri, 19 Nov 2010, Irfan Shaikh wrote:
/*************************************************************/ Code below O/p results runs in a while loop till end of PCM data.
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*/
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@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.