mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-15 20:32:38 +00:00
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:
parent
136511fbc8
commit
877309bfbe
|
@ -922,7 +922,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
|
||||||
else
|
else
|
||||||
g->node.device_id = SPA_ID_INVALID;
|
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);
|
g->node.priority = atoi(str);
|
||||||
if ((str = spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS))) {
|
if ((str = spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS))) {
|
||||||
if (strcmp(str, "Audio/Sink") == 0)
|
if (strcmp(str, "Audio/Sink") == 0)
|
||||||
|
|
|
@ -2219,7 +2219,7 @@ static void registry_event_global(void *data, uint32_t id,
|
||||||
snprintf(o->node.name, sizeof(o->node.name), "%s", tmp);
|
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);
|
o->node.priority = pw_properties_parse_int(str);
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: add node %d", c, id);
|
pw_log_debug(NAME" %p: add node %d", c, id);
|
||||||
|
|
|
@ -119,7 +119,7 @@ static void select_best(struct selector *s, struct pw_manager_object *o)
|
||||||
int32_t prio = 0;
|
int32_t prio = 0;
|
||||||
|
|
||||||
if (o->props &&
|
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);
|
prio = pw_properties_parse_int(str);
|
||||||
if (s->best == NULL || prio > s->score) {
|
if (s->best == NULL || prio > s->score) {
|
||||||
s->best = o;
|
s->best = o;
|
||||||
|
|
Loading…
Reference in a new issue