]> git.alsa-project.org Git - alsa-lib.git/commit
abort snd_pcm_dmix_drain when state is SND_PCM_STATE_XRU
authorTakashi Iwai <tiwai@suse.de>
Mon, 21 Nov 2005 10:47:42 +0000 (10:47 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 21 Nov 2005 10:47:42 +0000 (10:47 +0000)
commit8495f42feb7549550e7446912875b646dbf48249
treef6ac26972efb27d225ea650c310d9090d8c274cc
parent5057f8bbeac73d437f261713cfc9914836ea87a7
abort snd_pcm_dmix_drain when state is SND_PCM_STATE_XRU
From: Sascha Sommer <saschasommer@freenet.de>

this is a fix for bug 0001559.
Unlike my first guesses the real problem is not in the kernel driver but in
alsa-lib. Whenever the current dmix status is xrun and snd_pcm_dmix_drain
gets called the process will hang forever in the poll function. The reason is
that poll gets called even though the timer already stopped.
As described in the bugtracking system this bug was not noticable with alsa
versions that used the old IOCTLS because the SNDRV_TIMER_IOCTL_STOP ioctl
never reached the timer kernel module.

Attached patch fixes this problem for alsa-lib 1.0.10 by simply calling
snd_pcm_dmix_drop when snd_pcm_dmix_drain gets called in the state
SND_PCM_STATE_XRUN.
src/pcm/pcm_dmix.c