]> git.alsa-project.org Git - alsa-lib.git/commit
PCM: snd_pcm_xxxx_drain() maybe blocked after suspend and resume
authorShengjiu Wang <shengjiu.wang@freescale.com>
Fri, 12 Jun 2015 08:15:08 +0000 (16:15 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 12 Jun 2015 10:39:24 +0000 (12:39 +0200)
commit9ee6ec80b80268932a372522ca192168e7812ccf
treeae145c2a1d3b53a860df7bf893325ddb5b05320f
parent2fd098b587e8e5137c05ea6248c2aa87294e13c2
PCM: snd_pcm_xxxx_drain() maybe blocked after suspend and resume

After suspend and resume, the alsa driver is stopped. But if alsa-lib run
into snd_pcm_xxxx_drain(), it need to wait avail >= pcm->stop_threshold,
otherwise, it will not exit the loop, so finally it is blocked at poll() of
snd_pcm_wait_nocheck(pcm, -1).
This patch is to add state check after snd_pcm_wait_nocheck(pcm, -1), if
the state is SND_PCM_STATE_SUSPENDED, then return error.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_dmix.c
src/pcm/pcm_dshare.c