alsa-pcm: unlink pcm when driver is changed to a different pcm

We have to unlink pcms when they are linked to a driver from
a different pcm.

When a playback and a capture pcm is linked and we start
the playback pcm and the capture pcm later this can leads
to a 'EPIPE' error on the capture device.

...
spa.alsa: hw:3,0c: snd_pcm_start: Broken pipe
...
This commit is contained in:
Stefan Ursella 2024-09-04 07:29:30 +00:00 committed by Wim Taymans
parent 7036fc76e0
commit 189f2ec95b

View file

@ -3549,6 +3549,10 @@ static int do_state_sync(struct spa_loop *loop, bool async, uint32_t seq,
spa_list_append(&state->driver->rt.followers, &rt->driver_link);
rt->driver = state->driver;
spa_log_debug(state->log, "state:%p -> driver:%p", state, state->driver);
if(state->linked && state->matching) {
try_unlink(state);
}
}
if (state->following) {
remove_sources(state);