wireplumber.conf: improve standard policy definition

First, add the find-media-role-target to the standard policy.
It does not affect anything and it doubles as the replacement
for intended-roles.lua, as it merely prioritizes linking nodes
that have "media.role" set to targets that have "device.intended-roles"
set to the corresponding role.

Second, make the rescan-media-role-links.lua also load as part
of the standard policy. The idea is to embrace this functionality
by default and make it available on desktops. It does not break
anything as well, but it will apply its own rules to links that
are created between nodes that have a
"media.role" <-> "device.indended-roles" match.
This commit is contained in:
George Kiagiadakis 2024-06-21 17:02:46 +03:00
parent 5948539551
commit 0d995c56a8

View file

@ -73,7 +73,6 @@ wireplumber.profiles = {
hardware.bluetooth = required
hardware.video-capture = required
policy.standard = required
#policy.role-priority-system = optional
}
# Profile for video-only use cases (camera & screen sharing)
@ -559,6 +558,10 @@ wireplumber.components = [
name = linking/rescan.lua, type = script/lua
provides = hooks.linking.rescan
}
{
name = linking/find-media-role-target.lua, type = script/lua
provides = hooks.linking.target.find-media-role
}
{
name = linking/find-defined-target.lua, type = script/lua
provides = hooks.linking.target.find-defined
@ -597,7 +600,8 @@ wireplumber.components = [
requires = [ hooks.linking.rescan,
hooks.linking.target.prepare-link,
hooks.linking.target.link ]
wants = [ hooks.linking.target.find-defined,
wants = [ hooks.linking.target.find-media-role,
hooks.linking.target.find-defined,
hooks.linking.target.find-filter,
hooks.linking.target.find-default,
hooks.linking.target.find-best,
@ -607,19 +611,16 @@ wireplumber.components = [
## Linking: Role-based priority system
{
name = linking/rescan-media-role-links.lua, type = script/lua
provides = hooks.linking.role-priority-system.links.rescan
provides = hooks.linking.role-based.rescan
requires = [ api.mixer ]
}
{
name = linking/find-media-role-target.lua, type = script/lua
provides = hooks.linking.role-priority-system.target.find
}
{
type = virtual, provides = policy.linking.role-priority-system
type = virtual, provides = policy.linking.role-based
requires = [ policy.linking.standard,
hooks.linking.role-priority-system.links.rescan,
hooks.linking.role-priority-system.target.find ]
hooks.linking.role-based.rescan ]
}
## Standard policy definition
{
type = virtual, provides = policy.standard
requires = [ policy.client.access
@ -627,14 +628,11 @@ wireplumber.components = [
policy.device.routes
policy.default-nodes
policy.linking.standard
policy.linking.role-based
policy.node
support.standard-event-source ]
}
{
type = virtual, provides = policy.role-priority-system
requires = [ policy.standard,
policy.linking.role-priority-system ]
}
## Load targets
{
type = virtual, provides = hardware.audio