How to Disable Audio Devices in Pipewire / Wireplumber
I’ve recently made the switch to using Pipewire on my Linux desktops. One thing I noticed in my list of audio devices was an entry for my HDMI monitor, which I never planned to use. I also do some music production on my Linux machines, and disabling this audio device would help my patchbay configurations look a bit cleaner.
Pipewire’s documentation is pretty basic, and when searching for this solution online, I went down several incorrect paths. We could really use more recipe-style examples on the web, so here’s mine. This is done using the Wireplumber session manager.
First, identify the audio device to disable using pactl list short
. In the output from this, I could see an entry for the audio sink (alsa_output.pci-0000_27_00.1.hdmi-stereo-extra2.monitor
) and for the audio device (alsa_card.pci-0000_27_00.1
). It’s the alsa_card
device that you want to disable, not the sink.
Wireplumber uses lua scripts to apply these kinds of custom configurations. So in my case, I created the file ~/.config/wireplumber/main.lua.d/51-disable-hdmi-devices.lua
with the following code:
rule = {
matches = {
{
{ "device.name", "equals", "alsa_card.pci-0000_27_00.1" },
},
},
apply_properties = {
["device.disabled"] = true,
},
}
table.insert(alsa_monitor.rules,rule)
Then, restart the wireplumber service with systemctl --user restart wireplumber
and this audio device should now be gone – you won’t see it in your sound settings or in your patchbay diagrams.
For reference, the above is working for pipewire v0.3.56 and wireplumber v0.4.11 on Manjaro Linux. I ultimately learned this via the Arch Wiki page for Wireplumber, though at first I got confused about the need to specify an audio device instead of a sink. That caused me to think this was the wrong solution, and I spun my wheels for more than a week trying other things (e.g, turning the device profile off in pavucontrol) which didn’t work.
December 29th, 2022 at 2:33 am
Thank you for the post, I am not able to disable two of my monitors outputs (connected to DisplayPort via USB-C dongle, daisy chained). I see no difference between RUNNING and IDLE state whatever sound is playing from internal speakers or one of the two monitors is active. I guess I need to deal with additional devices in sound output selection 🙁
February 3rd, 2023 at 2:47 pm
Thanks for posting this great info. Ever since PulseAudio appeared on my Ubuntu desktop I’ve been telling it to ignore my dedicated music DACs (long story but mostly I don’t want it mixing and resampling and stuff). When I saw that Pipewire appeared, I thought to myself “uh oh”… today I decided to look for some ideas on how to do this now, and LOOK there is your most excellent recipe which worked perfectly.
Thanks again.
February 20th, 2023 at 1:07 am
Thanks, really appreciate. More Pipewire guides FTW