From b5d0532a77052fe634d8e2eb03b9893723b751ff Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 Aug 2024 17:41:13 +0200 Subject: [PATCH] impl-node: improve compatibility with older clients Clients before version 1 don't update the active_driver_id and so we must do on the server ourselves or else the node will not be scheduled. --- src/pipewire/impl-node.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 5e17a2098..b785fdafa 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -812,7 +812,9 @@ int pw_impl_node_set_io(struct pw_impl_node *this, uint32_t id, void *data, size res = spa_node_set_io(this->node, id, data, size); - if (res >= 0 && !SPA_RESULT_IS_ASYNC(res) && this->rt.position) + if (this->rt.position && + ((res >= 0 && !SPA_RESULT_IS_ASYNC(res)) || + this->rt.target.activation->client_version < 1)) this->rt.target.activation->active_driver_id = this->rt.position->clock.id; pw_log_debug("%p: set io: %s", this, spa_strerror(res)); @@ -2091,8 +2093,12 @@ again: retry_status: pw_node_activation_state_reset(&ta->state[0]); - if (ta->active_driver_id != ta->driver_id) + if (ta->active_driver_id != ta->driver_id) { + pw_log_trace_fp("%p: (%s-%u) %d waiting for driver %d<>%d", t->node, + t->name, t->id, ta->status, + ta->active_driver_id, ta->driver_id); continue; + } /* we don't change the state of inactive nodes and don't use them * for reposition. The pending will be at least 1 and they might