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 <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-10-12 21:38:11 +09:00
parent 75fcbf1e6c
commit 89e9da8cc0

View file

@ -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;