Skip to content

Commit

Permalink
ALSA: pcm: Set missing stop_operating flag at undoing trigger start
Browse files Browse the repository at this point in the history
[ Upstream commit 5c8cc93 ]

When a PCM trigger-start fails at snd_pcm_do_start(), PCM core tries
to undo the action at snd_pcm_undo_start() by issuing the trigger STOP
manually.  At that point, we forgot to set the stop_operating flag,
hence the sync-stop won't be issued at the next prepare or other
calls.

This patch adds the missing stop_operating flag at
snd_pcm_undo_start().

Fixes: 1e850be ("ALSA: pcm: Add the support for sync-stop operation")
Link: https://lore.kernel.org/r/b4e71631-4a94-613-27b2-fb595792630@carlh.net
Link: https://lore.kernel.org/r/20221205132124.11585-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tiwai authored and gregkh committed Dec 31, 2022
1 parent a443c55 commit 2df1e2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/core/pcm_native.c
Expand Up @@ -1419,8 +1419,10 @@ static int snd_pcm_do_start(struct snd_pcm_substream *substream,
static void snd_pcm_undo_start(struct snd_pcm_substream *substream,
snd_pcm_state_t state)
{
if (substream->runtime->trigger_master == substream)
if (substream->runtime->trigger_master == substream) {
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
substream->runtime->stop_operating = true;
}
}

static void snd_pcm_post_start(struct snd_pcm_substream *substream,
Expand Down

0 comments on commit 2df1e2a

Please sign in to comment.