use priority.session to select the default sink/source

priority.session is meant to be used to set routing priorities.

priority.driver is meant to be used by the scheduler to select what
nodes is best for driving the graph. This usually depends on the
hardware quality and the use case (Pro Audio devices are likely
to be used as driving the graph).

See #1028
This commit is contained in:
Wim Taymans 2021-04-08 17:48:13 +02:00
parent 136511fbc8
commit 877309bfbe
3 changed files with 3 additions and 3 deletions

View file

@ -922,7 +922,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
else
g->node.device_id = SPA_ID_INVALID;
if ((str = spa_dict_lookup(info->props, PW_KEY_PRIORITY_DRIVER)))
if ((str = spa_dict_lookup(info->props, PW_KEY_PRIORITY_SESSION)))
g->node.priority = atoi(str);
if ((str = spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS))) {
if (strcmp(str, "Audio/Sink") == 0)

View file

@ -2219,7 +2219,7 @@ static void registry_event_global(void *data, uint32_t id,
snprintf(o->node.name, sizeof(o->node.name), "%s", tmp);
}
if ((str = spa_dict_lookup(props, PW_KEY_PRIORITY_DRIVER)) != NULL)
if ((str = spa_dict_lookup(props, PW_KEY_PRIORITY_SESSION)) != NULL)
o->node.priority = pw_properties_parse_int(str);
pw_log_debug(NAME" %p: add node %d", c, id);

View file

@ -119,7 +119,7 @@ static void select_best(struct selector *s, struct pw_manager_object *o)
int32_t prio = 0;
if (o->props &&
(str = pw_properties_get(o->props, PW_KEY_PRIORITY_DRIVER)) != NULL) {
(str = pw_properties_get(o->props, PW_KEY_PRIORITY_SESSION)) != NULL) {
prio = pw_properties_parse_int(str);
if (s->best == NULL || prio > s->score) {
s->best = o;