diff --git a/src/pipewire/context.c b/src/pipewire/context.c index f4b6f5bd8..2f72e408c 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -1112,7 +1112,7 @@ again: /* assign final quantum and set state for followers and drivers */ spa_list_for_each(n, &context->driver_list, driver_link) { - bool running = false; + bool running = false, lock_quantum = false; uint32_t quantum = 0; if (!n->driving || n->exported) @@ -1121,6 +1121,8 @@ again: /* collect quantum and count active nodes */ spa_list_for_each(s, &n->follower_list, follower_link) { + lock_quantum |= s->lock_quantum; + if (s->quantum_size > 0) { if (quantum == 0 || s->quantum_size < quantum) quantum = s->quantum_size; @@ -1147,7 +1149,7 @@ again: n->rt.position->clock.rate = SPA_FRACTION(1, def_rate); } - if (quantum != n->rt.position->clock.duration) { + if (quantum != n->rt.position->clock.duration && !lock_quantum) { pw_log_info("(%s-%u) new quantum:%"PRIu64"->%u", n->name, n->info.id, n->rt.position->clock.duration, diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 88066ee0d..ba1b0d6cb 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -914,6 +914,8 @@ static void check_properties(struct pw_impl_node *node) } } } + str = pw_properties_get(node->properties, PW_KEY_NODE_LOCK_QUANTUM); + node->lock_quantum = str ? pw_properties_parse_bool(str) : false; pw_log_debug(NAME" %p: driver:%d recalc:%s active:%d", node, node->driver, recalc_reason, node->active); diff --git a/src/pipewire/keys.h b/src/pipewire/keys.h index 80c6fe4d7..a47df5780 100644 --- a/src/pipewire/keys.h +++ b/src/pipewire/keys.h @@ -155,6 +155,9 @@ extern "C" { * a fraction. Ex: 128/48000 */ #define PW_KEY_NODE_MAX_LATENCY "node.max-latency" /**< the maximum supported latency of the * node as a fraction. Ex: 1024/48000 */ +#define PW_KEY_NODE_LOCK_QUANTUM "node.lock-quantum" /**< don't change quantum when this node + * is active */ + #define PW_KEY_NODE_DONT_RECONNECT "node.dont-reconnect" /**< don't reconnect this node */ #define PW_KEY_NODE_ALWAYS_PROCESS "node.always-process" /**< process even when unlinked */ #define PW_KEY_NODE_WANT_DRIVER "node.want-driver" /**< the node wants to be grouped with a driver diff --git a/src/pipewire/private.h b/src/pipewire/private.h index bf8597b7c..6fb195012 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -677,6 +677,7 @@ struct pw_impl_node { unsigned int freewheel:1; /**< if this is the freewheel driver */ unsigned int loopchecked:1; /**< for feedback loop checking */ 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 */ uint32_t port_user_data_size; /**< extra size for port user data */