[alsa-devel] snd_pcm_drop causing lockup with DMix

Jaroslav Kysela perex at perex.cz
Sun Feb 28 17:22:27 CET 2010

On Sun, 28 Feb 2010, John Lindgren wrote:

> Hi,
> A couple of weeks ago I reported a rather serious bug #4914 that can
> cause a multi-threaded using ALSA to lock up so that it can only be
> ended with SIGKILL.
> I maintain the ALSA output part of Audacious, and I need to be able to
> play audio in one thread of the program and then signal that thread to
> stop from another.  The way to do this in ALSA, if I understand
> correctly, is to interrupt the thread that is sending audio with a call
> to snd_pcm_drop.  But using DMix makes the first thread hang up in a
> snd_pcm_wait call with a timeout of -1.
> Is anyone working on this bug?  Is there any more help I can provide?

Could you try this patch?

diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index d9e596e..8c7ca06 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -1274,6 +1274,7 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix)
  	snd_timer_params_set_ticks(params, 1);
  	if (dmix->tread) {
  		filter = (1<<SND_TIMER_EVENT_TICK) |
  			 dmix->timer_event_suspend |
  		snd_timer_params_set_filter(params, filter);


Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

More information about the Alsa-devel mailing list