From: Ove Kaaven Subject: Re: Hoping someone can help me (Assertion `frames <= snd_pcm_mmap_avail(pcm)' failed.) Date: Thu, 11 Mar 2004 12:11:08 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <1079003467.18054.387.camel@renegade> References: <1078939970.13994.28.camel@Nc> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <1078939970.13994.28.camel@Nc> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Niels Christian =?ISO-8859-1?Q?=D8rgaard?= Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org 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