mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
alsa: handle the case where the driver is destroyed
When the driver node is destroyed (like when unplugging the cable) it will drop/pause all of the follower ALSA nodes. This is something that happens internally because of how the ALSA nodes work together, on the PipeWire level, the nodes are still running and they will just be moved to another driver. The problem is that nothing will then start the nodes again after moving it to the new driver. Fix this by keeping track of the desired target state of the ALSA node and restoring that state when we detect that we are paused when moved to a new driver. Fixes #4401
This commit is contained in:
parent
3b51dbba1c
commit
1084cc24b6
4 changed files with 8 additions and 2 deletions
|
|
@ -292,11 +292,13 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
|
|||
if (this->n_buffers == 0)
|
||||
return -EIO;
|
||||
|
||||
this->want_started = true;
|
||||
if ((res = spa_alsa_start(this)) < 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_NODE_COMMAND_Pause:
|
||||
case SPA_NODE_COMMAND_Suspend:
|
||||
this->want_started = false;
|
||||
if ((res = spa_alsa_pause(this)) < 0)
|
||||
return res;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue