OSDN Git Service

pcm: Fix suspend/resume regression with dmix & co
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 May 2016 07:06:47 +0000 (09:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 May 2016 07:06:47 +0000 (09:06 +0200)
commitc14b0a08f0bf58e4f62307c68f8ff0137b4dec19
treeb69da5bd5b1efb200169276ed7f0929ea88983e6
parenta192f52fc63a86e1fbb9a09adb0bc2a6bbc8dab1
pcm: Fix suspend/resume regression with dmix & co

The recent fix commit [8985742d91db: pcm: dmix: Handle slave PCM xrun
and unexpected states properly] caused a regression in dmix and other
plugins regarding suspend/resume.  For example, aplay endlessly prints
"Suspended. Trying resume. Done." message if suspend and resume are
performed in the middle of playback.

The reason is that the commit above changed the shadow PCM state
(dmix->state) to SUSPENDED when the slave PCM is in suspend, while it
doesn't restore the shadow state upon resume.  Thus it appears as if
it's always suspended even after the resume is invoked.

The fix is just to add the proper update of the shadow state in
snd_pcm_direct_resume().

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