impl-node: add node.rules and device.rules

To be able to modify properties of nodes and devices. This is
interesting in the minimal config to give the nodes better defaults.
This commit is contained in:
Wim Taymans 2024-02-14 12:33:41 +01:00
parent fcea3eee01
commit 2807a1eafd
3 changed files with 92 additions and 12 deletions

View file

@ -191,10 +191,12 @@ context.objects = [
}
# This creates a ALSA udev device that will enumerate all
# ALSA devices. Because it is using ACP and has the audio-profile
# ALSA devices. Because it is using ACP and has the auto-profile
# property set, this will enable a profile and create associated
# nodes, which will be automatically configured to their best
# configuration.
# configuration with the auto-port-config settings.
# Extra node and device params can be given with node.param and
# device.param prefixes.
{ factory = spa-device-factory
args = {
factory.name = api.alsa.enum.udev
@ -411,3 +413,38 @@ context.exec = [
#
#@pulse_comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
]
node.rules = [
{ matches = [
{
# all keys must match the value. ! negates. ~ starts regex.
#alsa.card_name = "ICUSBAUDIO7D"
#api.alsa.pcm.stream = "playback"
}
]
actions = {
update-props = {
#node.name = "alsa_playback.ICUSBAUDIO7D"
}
}
}
]
device.rules = [
{ matches = [
{
#alsa.card_name = "ICUSBAUDIO7D"
}
]
actions = {
update-props = {
#device.name = "alsa_card.ICUSBAUDIO7D"
#api.acp.auto-profile = false
#api.acp.auto-port = false
#device.param.Profile = {
# #idx = 0
# name = off
#}
}
}
}
]