From f78be58568d5796f52e41e86ddab3766f568220e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 29 Mar 2021 14:19:34 +0200 Subject: [PATCH] stream: Add node.autoconnect stream.properties If the node.autoconnect property is set in the stream.properties, ignore the AUTOCONNECT flag value. This makes it possible to force AUTOCONNECT either way. See #964 --- src/daemon/client-rt.conf.in | 1 + src/daemon/client.conf.in | 1 + src/daemon/pipewire-pulse.conf.in | 1 + src/pipewire/stream.c | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/daemon/client-rt.conf.in b/src/daemon/client-rt.conf.in index bcc2c63e2..7bb1470f5 100644 --- a/src/daemon/client-rt.conf.in +++ b/src/daemon/client-rt.conf.in @@ -70,6 +70,7 @@ filter.properties = { stream.properties = { #node.latency = 1024/48000 + #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false #channelmix.mix-lfe = true diff --git a/src/daemon/client.conf.in b/src/daemon/client.conf.in index caf56c771..f0ec51bba 100644 --- a/src/daemon/client.conf.in +++ b/src/daemon/client.conf.in @@ -59,6 +59,7 @@ filter.properties = { stream.properties = { #node.latency = 1024/48000 + #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false #channelmix.mix-lfe = false diff --git a/src/daemon/pipewire-pulse.conf.in b/src/daemon/pipewire-pulse.conf.in index 7e8dbcbc0..132d03d53 100644 --- a/src/daemon/pipewire-pulse.conf.in +++ b/src/daemon/pipewire-pulse.conf.in @@ -46,6 +46,7 @@ context.modules = [ stream.properties = { #node.latency = 1024/48000 + #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false #channelmix.mix-lfe = false diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index baa0acdb5..08e60621d 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1554,7 +1554,8 @@ pw_stream_connect(struct pw_stream *stream, pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id); else if ((str = getenv("PIPEWIRE_NODE")) != NULL) pw_properties_set(stream->properties, PW_KEY_NODE_TARGET, str); - if (flags & PW_STREAM_FLAG_AUTOCONNECT) { + if ((flags & PW_STREAM_FLAG_AUTOCONNECT) && + pw_properties_get(stream->properties, PW_KEY_NODE_AUTOCONNECT) == NULL) { str = getenv("PIPEWIRE_AUTOCONNECT"); pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, str ? str : "true"); }