From af686653a91ba0d142c70290317166c67bd0f0fe Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 16 Feb 2021 13:23:47 +0100 Subject: [PATCH] jack: add option to merge monitors Make a different name for the monitor port prefix so that they appear as different clients. Add an option to restore the previous behaviour. See #736 --- pipewire-jack/src/pipewire-jack.c | 10 ++++++++++ src/daemon/jack.conf.in | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 60a47b95f..0a59d78e5 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -350,6 +350,7 @@ struct client { unsigned int warn_mlock:1; unsigned int timeowner_pending:1; unsigned int timeowner_conditional:1; + unsigned int merge_monitor:1; jack_position_t jack_position; jack_transport_state_t jack_state; @@ -2201,6 +2202,8 @@ static void registry_event_global(void *data, uint32_t id, if (ot->node.is_bridge && strchr(str, ':') != NULL) snprintf(o->port.name, sizeof(o->port.name), "%s", str); + else if (is_monitor && !c->merge_monitor) + snprintf(o->port.name, sizeof(o->port.name), "%s Monitor:%s", ot->node.name, str); else snprintf(o->port.name, sizeof(o->port.name), "%s:%s", ot->node.name, str); @@ -2438,6 +2441,13 @@ jack_client_t * jack_client_open (const char *client_name, client->allow_mlock = client->context.context->defaults.mem_allow_mlock; client->warn_mlock = client->context.context->defaults.mem_warn_mlock; + if ((str = pw_context_get_conf_section(client->context.context, + "jack.properties")) != NULL) + pw_properties_update_string(client->props, str, strlen(str)); + + if ((str = pw_properties_get(client->props, "jack.merge-monitor")) != NULL) + client->merge_monitor = pw_properties_parse_bool(str); + spa_list_init(&client->context.free_objects); pthread_mutex_init(&client->context.lock, NULL); spa_list_init(&client->context.nodes); diff --git a/src/daemon/jack.conf.in b/src/daemon/jack.conf.in index 7a850f85e..4a2008dc5 100644 --- a/src/daemon/jack.conf.in +++ b/src/daemon/jack.conf.in @@ -52,3 +52,7 @@ context.modules = { # a factory for Metadata objects. libpipewire-module-metadata = null } + +jack.properties = { + #jack.merge-monitor = false +}