From: Takashi Iwai Date: Thu, 18 Dec 2014 09:02:41 +0000 (+0100) Subject: ALSA: pcm: Don't leave PREPARED state after draining X-Git-Tag: firefly_0821_release~176^2~2202^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70372a7566b5e552dbe48abdac08c275081d8558;p=firefly-linux-kernel-4.4.55.git ALSA: pcm: Don't leave PREPARED state after draining When a PCM draining is performed to an empty stream that has been already in PREPARED state, the current code just ignores and leaves as it is, although the drain is supposed to set all such streams to SETUP state. This patch covers that overlooked case. Cc: Signed-off-by: Takashi Iwai --- diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index b03a638b420c..279e24f61305 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1552,6 +1552,8 @@ static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, int state) if (! snd_pcm_playback_empty(substream)) { snd_pcm_do_start(substream, SNDRV_PCM_STATE_DRAINING); snd_pcm_post_start(substream, SNDRV_PCM_STATE_DRAINING); + } else { + runtime->status->state = SNDRV_PCM_STATE_SETUP; } break; case SNDRV_PCM_STATE_RUNNING: