context: run nodes in the same node.group

When one of the nodes from a group is running, all the other nodes in the
group should run as well.

The link group is only for the session manager to avoid linking the same
link group to avoid loops.

We can then remove the node.link-group from the driver nodes so that the
session manager can link a loopback between them when asked.

See #5210
This commit is contained in:
Wim Taymans 2026-05-27 16:31:50 +02:00
parent e41ba35139
commit 6ee90dc5d4
4 changed files with 5 additions and 13 deletions

View file

@ -463,13 +463,11 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
if ((n_capture == 1 && n_playback == 1) || is_firewire) {
PA_IDXSET_FOREACH(m, ap->output_mappings, idx) {
pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);
pa_proplist_setf(m->output_proplist, "api.alsa.auto-link", "true");
pa_proplist_setf(m->output_proplist, "api.alsa.disable-tsched", "true");
}
PA_IDXSET_FOREACH(m, ap->input_mappings, idx) {
pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index);
pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
pa_proplist_setf(m->input_proplist, "api.alsa.disable-tsched", "true");
}

View file

@ -1547,8 +1547,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
pw_properties_set(props, PW_KEY_NODE_GROUP, "ffado-group");
if (pw_properties_get(props, PW_KEY_NODE_LINK_GROUP) == NULL)
pw_properties_set(props, PW_KEY_NODE_LINK_GROUP, "ffado-group");
if (pw_properties_get(props, PW_KEY_NODE_PAUSE_ON_IDLE) == NULL)
pw_properties_set(props, PW_KEY_NODE_PAUSE_ON_IDLE, "false");

View file

@ -1389,8 +1389,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");
if (pw_properties_get(props, PW_KEY_NODE_NETWORK) == NULL)
pw_properties_set(props, PW_KEY_NODE_NETWORK, "true");
if (pw_properties_get(props, PW_KEY_NODE_LINK_GROUP) == NULL)
pw_properties_set(props, PW_KEY_NODE_LINK_GROUP, "jack-group");
if (pw_properties_get(props, PW_KEY_NODE_ALWAYS_PROCESS) == NULL)
pw_properties_set(props, PW_KEY_NODE_ALWAYS_PROCESS, "true");
if (pw_properties_get(props, PW_KEY_NODE_LOCK_QUANTUM) == NULL)

View file

@ -1148,17 +1148,15 @@ static inline int run_nodes(struct pw_context *context, struct pw_impl_node *nod
}
}
}
/* now go through all the nodes that have the same link group and
* that are not yet visited. Note how nodes with the same group
* don't get included here. They were added to the same driver but
* need to otherwise stay idle unless some non-passive link activates
* them. */
if (node->link_groups != NULL) {
/* now go through all the nodes that share groups and link_groups
* that are not yet visited */
if (node->groups != NULL || node->link_groups != NULL) {
spa_list_for_each(t, nodes, sort_link) {
if (t->exported || !t->active ||
SPA_FLAG_IS_SET(t->checked, 1u<<direction))
continue;
if (pw_strv_find_common(t->link_groups, node->link_groups) < 0)
if (pw_strv_find_common(t->groups, node->groups) < 0 &&
pw_strv_find_common(t->link_groups, node->link_groups) < 0)
continue;
pw_log_debug(" group %p: '%s'", t, t->name);