From 55fc2ac7ef1af305b3e3e3294e63097546dd94ce Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 3 May 2023 19:21:43 +0300 Subject: [PATCH] stream: ignore latency of monitor stream ports Have monitor streams not affect the latency calculation of the ports they are connected to. Connecting monitor streams to ports (e.g. volume level monitoring) should not affect latency values of other streams connected to those ports. This fixes e.g. just running pavucontrol from modifying latencies of all existing ports. --- src/pipewire/keys.h | 5 ++++- src/pipewire/stream.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pipewire/keys.h b/src/pipewire/keys.h index cce660831..8e8539df9 100644 --- a/src/pipewire/keys.h +++ b/src/pipewire/keys.h @@ -275,7 +275,10 @@ extern "C" { #define PW_KEY_STREAM_LATENCY_MAX "stream.latency.max" /**< The maximum latency of the stream */ #define PW_KEY_STREAM_MONITOR "stream.monitor" /**< Indicates that the stream is monitoring * and might select a less accurate but faster - * conversion algorithm. */ + * conversion algorithm. Monitor streams are also + * ignored when calculating the latency of their peer + * ports (since 0.3.71). + */ #define PW_KEY_STREAM_DONT_REMIX "stream.dont-remix" /**< don't remix channels */ #define PW_KEY_STREAM_CAPTURE_SINK "stream.capture.sink" /**< Try to capture the sink output instead of * source output */ diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 98b8550e9..a6cb08615 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -2012,6 +2012,7 @@ pw_stream_connect(struct pw_stream *stream, pw_properties_parse_bool(str)) { pw_properties_set(props, "resample.peaks", "true"); pw_properties_set(props, "channelmix.normalize", "true"); + pw_properties_set(props, PW_KEY_PORT_IGNORE_LATENCY, "true"); } if (impl->media_type == SPA_MEDIA_TYPE_audio) {