From 43b6054631266cbd7bc5f43ca91237454f1b80a8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 May 2023 11:44:55 +0200 Subject: [PATCH] module-jack: add jack.client-name option --- src/modules/module-jack-tunnel.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/modules/module-jack-tunnel.c b/src/modules/module-jack-tunnel.c index 8c645f20b..c8fff748e 100644 --- a/src/modules/module-jack-tunnel.c +++ b/src/modules/module-jack-tunnel.c @@ -43,6 +43,7 @@ * ## Module Options * * - `jack.server`: the name of the JACK server to tunnel to. + * - `jack.client-name`: the name of the JACK client. * - `tunnel.mode`: the tunnel mode, sink|source|duplex, default duplex * - `source.props`: Extra properties for the source filter. * - `sink.props`: Extra properties for the sink filter. @@ -67,10 +68,11 @@ * context.modules = [ * { name = libpipewire-module-jack-tunnel * args = { - * #jack.server = null - * #tunnel.mode = duplex - * #audio.channels = 2 - * #audio.position = [ FL FR ] + * #jack.server = null + * #jack.client-name = PipeWire + * #tunnel.mode = duplex + * #audio.channels = 2 + * #audio.position = [ FL FR ] * source.props = { * # extra sink properties * } @@ -88,15 +90,16 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME); #define PW_LOG_TOPIC_DEFAULT mod_topic -#define DEFAULT_CHANNELS 2 -#define DEFAULT_POSITION "[ FL FR ]" +#define DEFAULT_CLIENT_NAME "PipeWire" +#define DEFAULT_CHANNELS 2 +#define DEFAULT_POSITION "[ FL FR ]" #define MODULE_USAGE "( remote.name= ] " \ - "( node.name= ] " \ - "( node.description= ] " \ + "( jack.server= ) " \ + "( jack.client-name= ] " \ + "( tunnel.mode= ] " \ "( audio.channels= ] " \ "( audio.position= ] " \ - "( jack.server= ) " \ "( source.props= ) " \ "( sink.props= ) " @@ -745,16 +748,19 @@ static void jack_latency(jack_latency_callback_mode_t mode, void *arg) static int create_jack_client(struct impl *impl) { - const char *server_name; + const char *server_name, *client_name; jack_options_t options = JackNullOption; jack_status_t status; server_name = pw_properties_get(impl->props, "jack.server"); - if (server_name != NULL) options |= JackServerName; - impl->client = jack_client_open("pipewire", options, &status, server_name); + client_name = pw_properties_get(impl->props, "jack.client-name"); + if (client_name == NULL) + client_name = DEFAULT_CLIENT_NAME; + + impl->client = jack_client_open(client_name, options, &status, server_name); if (impl->client == NULL) { pw_log_error ("jack_client_open() failed 0x%2.0x\n", status); return -EIO;