From 12464ed1bbbd1275be3b6964fdffaf1e594c75fc Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 19 Sep 2025 15:53:59 +0200 Subject: [PATCH] impl-port: copy node.terminal and node.physical properties Make 2 new node properties to make all ports of a node terminal or physical. Skip the monitor ports for this, though, they can never be terminal or physical. This is important for JACK clients that often enumerate physical terminal ports in order to link to them and with this you can make JACK clients link to virtual sinks and sources as well. --- src/pipewire/impl-port.c | 7 +++++++ src/pipewire/keys.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/pipewire/impl-port.c b/src/pipewire/impl-port.c index f0ae5487c..efd9e27f1 100644 --- a/src/pipewire/impl-port.c +++ b/src/pipewire/impl-port.c @@ -1238,6 +1238,13 @@ int pw_impl_port_add(struct pw_impl_port *port, struct pw_impl_node *node) is_monitor = pw_properties_get_bool(port->properties, PW_KEY_PORT_MONITOR, false); + if (!is_monitor) { + if ((str = pw_properties_get(nprops, PW_KEY_NODE_TERMINAL)) != NULL) + pw_properties_set(port->properties, PW_KEY_PORT_TERMINAL, str); + if ((str = pw_properties_get(nprops, PW_KEY_NODE_PHYSICAL)) != NULL) + pw_properties_set(port->properties, PW_KEY_PORT_PHYSICAL, str); + } + port->ignore_latency = pw_properties_get_bool(port->properties, PW_KEY_PORT_IGNORE_LATENCY, false); port->exclusive = pw_properties_get_bool(port->properties, PW_KEY_PORT_EXCLUSIVE, node->exclusive); diff --git a/src/pipewire/keys.h b/src/pipewire/keys.h index 88b549d89..3d119fefb 100644 --- a/src/pipewire/keys.h +++ b/src/pipewire/keys.h @@ -229,6 +229,9 @@ extern "C" { * playback or disable the prefix * completely if an empty string * is provided */ +#define PW_KEY_NODE_PHYSICAL "node.physical" /**< ports from the node are physical */ +#define PW_KEY_NODE_TERMINAL "node.terminal" /**< ports from the node are terminal */ + /** Port keys */ #define PW_KEY_PORT_ID "port.id" /**< port id */ #define PW_KEY_PORT_NAME "port.name" /**< port name */