]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: dmix: Fix doubly resume of slave PCM
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 May 2016 11:06:25 +0000 (13:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 May 2016 11:06:25 +0000 (13:06 +0200)
commit5610b356b5f110f7f8e586f56e5b74e0f0c2db38
treefb88e2141f77a9dddc249eb4e6a8a252711fb612
parentc14b0a08f0bf58e4f62307c68f8ff0137b4dec19
pcm: dmix: Fix doubly resume of slave PCM

The dmix plugin and co may trigger the resume for each instance in
snd_pcm_direct_resume().  It means that the slave PCM gets resumed or
re-prepared/started by each opened dmix stream, and this may end up
with the doubly triggers even though the slave PCM has been already
resumed by another dmix stream.

For avoiding this conflicts, check the slave PCM state and resume only
when it's still in the suspended state.  Meanwhile we keep the shadow
state updated no matter whether the slave was triggered or not.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.c