[alsa-devel] snd_pcm_drain and lock-ups

Mike Gorse mgorse at mgorse.dhs.org
Thu Sep 13 00:52:23 CEST 2007

Hi all,

I've followed Arve Knudsen over here.  I am getting a lock-up when calling 
snd_pcm_drain().  This happens when 
using espeak, which is using portaudio.  Portaudio calls snd_pcm_drain 
while trying to recover from a XRUN.  snd_pcm_drain is calling 
snd_pcm_rate_drain in my case. snd_pcm_rate_drain then calls snd_pcm_wait. 
snd_pcm_wait first checks if snd_pcm_mmap_avail(pcm) >= pcm->avail_min. 
snd_pcm_map_avail is returning a number less than 300, often between 135 
and 140 but not always, where pcm->avail_min == 1024.  So it does not 
check for the XRUN state since it is conditional on snd_pcm_mmap_avail 
returning >= 1024.  This is on my laptop, which is running Linux 2.6.22 
and alsa-lib 1.0.15-rc1 and uses the snd-intel8x0 driver.

Does this give people enough information to tell what might be going on? 
I have a small test program that causes the lock-up on my laptop where the 
rate plugin gets used (it sometimes locks up immediately, sometimes after 
a few seconds), but it needs espeak and portaudio to be installed.


-- Mike Gorse / AIM:linvortex / http://mgorse.freeshell.org --

More information about the Alsa-devel mailing list