node: add master priority

Change node.priority to priority.session to indicate that this
is the priority that the session manager uses to select the node.

Add another priority.master that the core uses to select a master
driver. Keep the driver nodes sorted by master priority.

Let jack always prefer to connect to the master driver nodes.
This commit is contained in:
Wim Taymans 2019-10-22 12:25:25 +02:00
parent fa25900682
commit eb1d675cb0
6 changed files with 33 additions and 9 deletions

View file

@ -144,8 +144,9 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
priority -= atol(dev) * 16;
priority -= atol(subdev);
if (pw_properties_get(node->props, PW_KEY_NODE_PRIORITY) == NULL) {
pw_properties_setf(node->props, PW_KEY_NODE_PRIORITY, "%d", priority);
if (pw_properties_get(node->props, PW_KEY_PRIORITY_MASTER) == NULL) {
pw_properties_setf(node->props, PW_KEY_PRIORITY_MASTER, "%d", priority);
pw_properties_setf(node->props, PW_KEY_PRIORITY_SESSION, "%d", priority);
}
if (pw_properties_get(node->props, SPA_KEY_NODE_NAME) == NULL) {