ons, 10.03.2004 kl. 18.32 skrev Niels Christian Ørgaard: > Hey .... > > This is the nth day I'm stuck reading the ALSA-documentation over and > over again, and I'm at a loss figuring out whats wrong. > > Basically, I have a running thread capturing data from an ALSA-device, > and within useconds I get: "samptest: pcm.c:5889: snd_pcm_mmap_commit: > Assertion `frames <= snd_pcm_mmap_avail(pcm)' failed." (samptest is > the name of my executable) > > The reason for me being so confused is that this occures at the call > "snd_pcm_readi(snd_pcm_t *, void *, snd_pcm_uframes_t )", which for > starters ain't mmap :) I use "snd_pcm_delay(snd_pcm_t *, > snd_pcm_sframes_t *)" to verify that there is sufficient data in the > queue, before calling readi(),
Did you remember to call snd_pcm_avail_update() right before calling readi()? The docs imply that snd_pcm_delay does not update the value returned by the "snd_pcm_mmap_avail" in the assertion, but snd_pcm_avail_update() does (by using the latest value from stuff like snd_pcm_delay or IRQ handlers, so call it after snd_pcm_delay). ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel