From 89e9da8cc0e78c29a46906f2f27f035d5a5cc2a4 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Thu, 12 Oct 2023 21:38:11 +0900 Subject: [PATCH] alsa: Do not attempt to prepare linked PCMs All linked PCMs prepare together. If we prepare the secondaries, that action clobbers the write pointer of every PCM every time, which then causes playback to fail to start due to lack of data. Signed-off-by: Hector Martin --- spa/plugins/alsa/alsa-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index ddf79f05a..fbd67cf86 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1995,7 +1995,7 @@ static int do_prepare(struct state *state) CHECK(set_swparams(state), "swparams"); - if ((err = snd_pcm_prepare(state->hndl)) < 0 && err != -EBUSY) { + if ((!state->linked) && (err = snd_pcm_prepare(state->hndl)) < 0 && err != -EBUSY) { spa_log_error(state->log, "%s: snd_pcm_prepare error: %s", state->name, snd_strerror(err)); return err;