added support for disabling nodes and devices through conf

This commit is contained in:
mazunki 2022-01-12 12:13:08 +01:00 committed by George Kiagiadakis
parent 75281d8681
commit bbd23fa3e3
2 changed files with 19 additions and 0 deletions

View file

@ -17,6 +17,19 @@ alsa_monitor.properties = {
alsa_monitor.rules = {
-- An array of matches/actions to evaluate.
--
-- If you want to disable some devices or nodes, you can apply properties per device as the following example.
-- The name can be found by running pw-cli ls Device, or pw-cli dump Device
--{
-- matches = {
-- {
-- { "device.name", "matches", "name_of_some_disabled_card" },
-- },
-- },
-- apply_properties = {
-- ["device.disabled"] = true,
-- },
--}
{
-- Rules for matching a device or node. It is an array of
-- properties that all need to match the regexp. If any of the

View file

@ -168,6 +168,9 @@ function createNode(parent, id, type, factory, properties)
-- apply properties from config.rules
rulesApplyProperties(properties)
if properties["node.disabled"] then
return
end
-- create the node
local node = Node("adapter", properties)
@ -254,6 +257,9 @@ function prepareDevice(parent, id, type, factory, properties)
-- apply properties from config.rules
rulesApplyProperties(properties)
if properties["device.disabled"] then
return
end
-- override the device factory to use ACP
if properties["api.alsa.use-acp"] then