diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 3cff783c1..9cc7a651c 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -2204,7 +2204,12 @@ jack_client_t * jack_client_open (const char *client_name, client->node_id = SPA_ID_INVALID; strncpy(client->name, client_name, JACK_CLIENT_NAME_SIZE); client->context.loop = pw_thread_loop_new(client_name, NULL); - client->context.context = pw_context_new(pw_thread_loop_get_loop(client->context.loop), NULL, 0); + client->context.context = pw_context_new( + pw_thread_loop_get_loop(client->context.loop), + pw_properties_new( + PW_KEY_CONTEXT_PROFILE_MODULES, "default,rtkit", + NULL), + 0); client->allow_mlock = client->context.context->defaults.mem_allow_mlock; spa_list_init(&client->context.free_objects); spa_list_init(&client->context.nodes); diff --git a/src/pipewire/context.c b/src/pipewire/context.c index 77547d16c..e585543d0 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -74,15 +74,26 @@ struct factory_entry { static int load_module_profile(struct pw_context *this, const char *profile) { + const char *str, *state = NULL; + size_t len; + pw_log_debug(NAME" %p: module profile %s", this, profile); - if (strcmp(profile, "default") == 0) { - pw_context_load_module(this, "libpipewire-module-rtkit", NULL, NULL); - pw_context_load_module(this, "libpipewire-module-protocol-native", NULL, NULL); - pw_context_load_module(this, "libpipewire-module-client-node", NULL, NULL); - pw_context_load_module(this, "libpipewire-module-client-device", NULL, NULL); - pw_context_load_module(this, "libpipewire-module-adapter", NULL, NULL); - pw_context_load_module(this, "libpipewire-module-metadata", NULL, NULL); - pw_context_load_module(this, "libpipewire-module-session-manager", NULL, NULL); + + while ((str = pw_split_walk(profile, ", ", &len, &state)) != NULL) { + if (strncmp(str, "default", len) == 0) { + pw_log_debug(NAME" %p: loading default profile", this); + pw_context_load_module(this, "libpipewire-module-protocol-native", NULL, NULL); + pw_context_load_module(this, "libpipewire-module-client-node", NULL, NULL); + pw_context_load_module(this, "libpipewire-module-client-device", NULL, NULL); + pw_context_load_module(this, "libpipewire-module-adapter", NULL, NULL); + pw_context_load_module(this, "libpipewire-module-metadata", NULL, NULL); + pw_context_load_module(this, "libpipewire-module-session-manager", NULL, NULL); + } else if (strncmp(str, "rtkit", len) == 0) { + pw_log_debug(NAME" %p: loading rtkit profile", this); + pw_context_load_module(this, "libpipewire-module-rtkit", NULL, NULL); + } else { + pw_log_warn(NAME" %p: unknown profile %.*s", this, (int) len, str); + } } return 0; }