mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-16 08:21:22 -04:00
scheduler: make nodes move to IDLE when inactive
When a node is inactive but linked to a driver, the only reason it is not being scheduled is because it is inactive. We already set up the links and negotiate the format and buffers to prepare going to RUNNING. This patch now also make the node go to IDLE, which makes the adapter negotiate a forma and buffers with the internal node. This makes things more symetrical, when linking a node, it becomes IDLE, when activating it becomes RUNNABLE, when inactive it goes back to IDLE. The switch to RUNNING will also be faster when things are already set up in the IDLE state. The main advantage is that it allows us to implement the startup of corked streams in pulseaudio better. Before this patch we had to set the stream to active to make it go through the Format and buffer negotiation and then quickly set it back to inactive, hopefully without skipping a cycle. After this patch, the corked stream goes all the way to IDLE, where it then waits to become active. See #4991
This commit is contained in:
parent
474253719f
commit
823dcd8843
5 changed files with 17 additions and 9 deletions
|
|
@ -1086,6 +1086,8 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
|
|||
spa_log_debug(this->log, "%p: suspending", this);
|
||||
break;
|
||||
case SPA_NODE_COMMAND_Pause:
|
||||
if ((res = negotiate_format(this)) < 0)
|
||||
return res;
|
||||
spa_log_debug(this->log, "%p: pausing", this);
|
||||
break;
|
||||
case SPA_NODE_COMMAND_Flush:
|
||||
|
|
|
|||
|
|
@ -2644,6 +2644,8 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
|
|||
reset_node(this);
|
||||
SPA_FALLTHROUGH;
|
||||
case SPA_NODE_COMMAND_Pause:
|
||||
if ((res = setup_convert(this)) < 0)
|
||||
return res;
|
||||
this->started = false;
|
||||
break;
|
||||
case SPA_NODE_COMMAND_Flush:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue