From 2ff62641b9cec7a54f216aa87e6740db5e30285e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 30 Oct 2023 11:18:55 +0100 Subject: [PATCH] context: when forcing rate/quantum don't limit latency Usually, the max-latency is calculated by the device when it is configured based on the maximum buffer size and limits the latency change that can be done. When we are forcing a rate/quantum and we are going to reconfigure the device, this limit should not apply because the current buffer settings and latency are going to change because of the reconfigure. See #3613 --- src/pipewire/context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipewire/context.c b/src/pipewire/context.c index e5ac4076a..7afec125d 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -1465,8 +1465,9 @@ again: node_max_quantum = node_max_quantum * current_rate / node_rate_quantum; } - /* calculate desired quantum */ - if (max_latency.denom != 0) { + /* calculate desired quantum. Don't limit to the max_latency when we are + * going to force a quantum or rate and reconfigure the nodes. */ + if (max_latency.denom != 0 && !force_quantum && !force_rate) { uint32_t tmp = (max_latency.num * current_rate / max_latency.denom); if (tmp < node_max_quantum) node_max_quantum = tmp;