Renaming ports via LUA script when device is connected
Hello!
I have a sound card with nearly 20 inputs and I want to have a way to set a custom name for each port in PipeWire.
Today I am using the pro-audio
profile so my ports look like capture_AUXn
.
Ideally I could just have some sort of "port name map" that would apply to a specific device, or a way to match rules against ports.
Here is my current approach:
rule = {
matches = {
{
{ "port.alias", "equals", "Scarlett 18i20 USB:capture_AUX0" },
},
},
apply_properties = {
["port.name"] = "Front 1.1",
},
}
table.insert(alsa_monitor.rules,rule)
It doesn't work, most likely because alsa_monitor
doesn't "see" PipeWire ports.
Is what I am attempting to do possible today?
Alternatively, would it be possible to have a custom profile that would be similar to pro-audio
with a custom rule (LUA function maybe) that generates the port names?