From 7543ad0766f42e8b9ea8b0896747417a712d04a2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 14 Sep 2021 11:00:08 +0200 Subject: [PATCH] impl-node: add node.transport.sync property When the node support transport sync. That is, when it will clear the pending_sync flag from its activation area when it completed a new seek. Before this patch, the pending sync was always automatically cleared, which broke some applications that are time masters such as bitwig. Fixes #1589 --- pipewire-jack/src/pipewire-jack.c | 1 + src/pipewire/impl-node.c | 9 ++++++--- src/pipewire/private.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index dc0d3ab9f..abad40031 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -3078,6 +3078,7 @@ jack_client_t * jack_client_open (const char *client_name, pw_properties_set(client->props, PW_KEY_MEDIA_ROLE, "DSP"); if (pw_properties_get(client->props, PW_KEY_NODE_ALWAYS_PROCESS) == NULL) pw_properties_set(client->props, PW_KEY_NODE_ALWAYS_PROCESS, "true"); + pw_properties_set(client->props, "node.transport.sync", "true"); client->node = pw_core_create_object(client->core, "client-node", diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 5e20e873b..1dc2509bf 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -843,6 +843,9 @@ static void check_properties(struct pw_impl_node *node) str = pw_properties_get(node->properties, PW_KEY_NODE_CACHE_PARAMS); impl->cache_params = str ? pw_properties_parse_bool(str) : true; + str = pw_properties_get(node->properties, "node.transport.sync"); + node->transport_sync = str ? pw_properties_parse_bool(str) : false; + str = pw_properties_get(node->properties, PW_KEY_NODE_DRIVER); driver = str ? pw_properties_parse_bool(str) : false; @@ -1028,9 +1031,9 @@ static inline int process_node(void *data) pw_log_trace_fp(NAME" %p: process %"PRIu64, this, a->awake_time); - /* not implemented yet, just clear the flags */ - a->pending_sync = false; - a->pending_new_pos = false; + /* when transport sync is not supported, just clear the flag */ + if (!this->transport_sync) + a->pending_sync = false; spa_list_for_each(p, &this->rt.input_mix, rt.node_link) spa_node_process(p->mix); diff --git a/src/pipewire/private.h b/src/pipewire/private.h index 638cb3e97..011090abb 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -682,6 +682,7 @@ struct pw_impl_node { unsigned int always_process:1; /**< this node wants to always be processing, even when idle */ unsigned int lock_quantum:1; /**< don't change graph quantum */ unsigned int lock_rate:1; /**< don't change graph rate */ + unsigned int transport_sync:1; /**< supports transport sync */ uint32_t port_user_data_size; /**< extra size for port user data */