From 52b23384e06b3c95613431b02c208e73664a1efe Mon Sep 17 00:00:00 2001 From: Martin Geier Date: Mon, 23 Mar 2026 10:40:18 +0100 Subject: [PATCH] impl-node: correctly synchronize suspend state with remote node Previously, if a remote node was set to running and immediately reverted to suspended state, the remote node stayed in running state. This occurred because suspend_node sent suspend command only when the locally cached state was "idle" or "running." Modified to send suspend to a node whenever its pending state is not "suspended," ensuring the command is sent during state transitions. Fixes #5026 Signed-off-by: Martin Geier --- src/pipewire/impl-node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 6f5066e82..63e433893 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -528,13 +528,15 @@ static void node_update_state(struct pw_impl_node *node, enum pw_node_state stat static int suspend_node(struct pw_impl_node *this) { + struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this); int res = 0; struct pw_impl_port *p; pw_log_debug("%p: suspend node state:%s", this, pw_node_state_as_string(this->info.state)); - if (this->info.state > 0 && this->info.state <= PW_NODE_STATE_SUSPENDED) + if (this->info.state > 0 && this->info.state < PW_NODE_STATE_SUSPENDED || + this->info.state == PW_NODE_STATE_SUSPENDED && impl->pending_state == PW_NODE_STATE_SUSPENDED) return 0; spa_list_for_each(p, &this->input_ports, link) {