How to Disable Audio Devices in Pipewire / Wireplumber

Posted by Scott on Aug 1st, 2022

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.

3 Responses

  1. Pawel Says:

    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 🙁

  2. Bonzini Says:

    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.

  3. thenonameguy Says:

    Thanks, really appreciate. More Pipewire guides FTW

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Blog Badges



[FSF Associate Member]

Archives