cannot disable certain type of 'audo monitoring loopback' node
Hi there, Today have successfully created some rules to match and disable specific devices. However still remaining is a monitor loopback device node. Which is not matching.
here is my config file:
-- works
rule_disable_devices = {
matches = {
-- all works
{
{ "device.subsystem", "equals", "sound" },
{ "device.vendor.name", "equals", "NVIDIA Corporation" },
},
{
{ "device.subsystem", "equals", "sound" },
{ "device.vendor.name", "equals", "EVGA" },
},
{
{ "device.subsystem", "equals", "sound" },
{ "device.vendor.name", "matches", "Sony*" },
},
},
apply_properties = {
["device.disabled"] = true,
},
}
table.insert(alsa_monitor.rules, rule_disable_devices)
-- works
rule_disable_nodes = {
matches = {
-- works
{
{ "device.class", "equals", "sound" },
{ "alsa.driver_name", "equals", "snd_hda_intel" },
{ "media.class", "equals", "Audio/Source" },
},
},
apply_properties = {
["node.disabled"] = true,
},
}
table.insert(alsa_monitor.rules, rule_disable_nodes)
rule_disable_objects = {
matches = {
-- none of these attempts ever works, no good :(
{
-- { "object.path", "matches", "alsa:pcm:0:*:playback:monitor*" },
-- { "object.path", "matches", "alsa:pcm:0:front:playback:monitor*" },
-- { "object.path", "equals", "alsa:pcm:0:front:0:playback:monitor_1" },
-- { "node.id", "equals", "31"},
-- { "port.monitor", "equals", "true" },
},
},
apply_properties = {
-- ["object.enabled"] = false,
-- ["object.disabled"] = true,
-- ["node.enabled"] = false,
-- ["node.disabled"] = true,
["port.monitor"] = false,
},
}
table.insert(alsa_monitor.rules, rule_disable_objects)
What never happens is no property is changed or added to the object { "object.path", "equals", "alsa:pcm:0:front:0:playback:monitor_1" },
and here you can see in the pw-dump
which is this object i am trying to disable. it's properties never changes, and so it never gets disabled.
pw-dump | jq .[] | grep -B45 -A45 -i "alc1150 analog:monitor"
{
"id": 128,
"type": "PipeWire:Interface:Port",
"version": 3,
"permissions": [
"r",
"w",
"x",
"m"
],
"info": {
"direction": "output",
"change-mask": [
"props",
"params"
],
"props": {
"format.dsp": "32 bit float mono audio",
"audio.channel": "FL",
"port.monitor": true,
"port.id": 0,
"object.path": "alsa:pcm:0:front:0:playback:monitor_0",
"port.name": "monitor_FL",
"port.alias": "ALC1150 Analog:monitor_FL",
"port.direction": "out",
"node.id": 103,
"object.id": 128,
"object.serial": 4726
},
"params": {
"EnumFormat": [
{
"mediaType": "audio",
"mediaSubtype": "dsp",
"format": "F32P"
},
{
"mediaType": "audio",
"mediaSubtype": "dsp",
"format": "F32P"
}
],
"Meta": [
{
"type": "Header",
"size": 32
},
{
"type": "Header",
"size": 32
}
],
"IO": [
{
"id": "Buffers",
"size": 8
},
{
"id": "RateMatch",
"size": 48
}
],
"Format": [],
"Buffers": [],
"Latency": [
{
"direction": "Input",
"minQuantum": 1,
"maxQuantum": 1,
--
{
"direction": "Output",
"minQuantum": 0,
"maxQuantum": 0,
"minRate": 0,
"maxRate": 0,
"minNs": 0,
"maxNs": 0
},
{
"direction": "Output",
"minQuantum": 0,
"maxQuantum": 0,
"minRate": 0,
"maxRate": 0,
"minNs": 0,
"maxNs": 0
}
]
}
}
}
{
"id": 48,
"type": "PipeWire:Interface:Port",
"version": 3,
"permissions": [
"r",
"w",
"x",
"m"
],
"info": {
"direction": "output",
"change-mask": [
"props",
"params"
],
"props": {
"format.dsp": "32 bit float mono audio",
"audio.channel": "FR",
"port.monitor": true,
"port.id": 1,
"object.path": "alsa:pcm:0:front:0:playback:monitor_1",
"port.name": "monitor_FR",
"port.alias": "ALC1150 Analog:monitor_FR",
"port.direction": "out",
"node.id": 103,
"object.id": 48,
"object.serial": 4728
},
"params": {
"EnumFormat": [
{
"mediaType": "audio",
"mediaSubtype": "dsp",
"format": "F32P"
},
{
"mediaType": "audio",
"mediaSubtype": "dsp",
"format": "F32P"
}
],
"Meta": [
{
"type": "Header",
"size": 32
},
{
"type": "Header",
"size": 32
}
],
"IO": [
{
"id": "Buffers",
"size": 8
},
{
"id": "RateMatch",
"size": 48
}
],
"Format": [],
"Buffers": [],
"Latency": [
{
"direction": "Input",
"minQuantum": 1,
"maxQuantum": 1,
which appears like this in qpwgraph
:
Hoping to disable the "monitor" node... but not the "playback" nodes (because that other node is actually something useful to me).