Re: lock-up with ALSA
Arve Knudsen <aknuds-1 <at> broadpark.no>
2007-09-04 20:49:06 GMT
Hi Mike
On Sat, 01 Sep 2007 13:12:54 +0200, Mike Gorse <mgorse <at> mgorse.dhs.org>
wrote:
> I am experiencing a lock-up when using PortAudio with ALSA. There is a
> xrun, and PaAlsaStream_HandleXrun gets called. It then calls
> AlsaRestart, which calls AlsaStop with abort == 0, and AlsaStop calls
> snd_pcm_drain, which jams and never returns. This happens with espeak
> and seemingly only when it generates multiple consecutive utterances,
> although I can't guess as to why its generating multiple utterances in
> particular would lead to this behavior. I run into this on my laptop,
> which is running Ubuntu Gutsy with alsa 1.0.14 and uses the snd-intel8x0
> driver. I do not have the trouble on my desktop, which has an on-board
> Via sound chip.
>
> I can get around this by setting abort to 1 in AlsaStop if a xrun has
> occurred; this causes some choppiness rather than a lock-up. I don't
> know if this is a patch that should go into portaudio, though, or if
> there is a better way to solve things. (Are there circumstances when
> snd_pcm_drain would be expected to jam?)
>
> Thanks for any advice, and let me know if there is anything else I can
> do to track this down.
I've found in the past that snd_pcm_drain may lock up when used on the
"dmix" device, so AlsaStop should call snd_pcm_drop instead if this device
is detected. I'll ask on the ALSA-lib mailing list what the deal really is
with snd_pcm_drain, and how it should be used to avoid lockups.
(Continue reading)