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.

Update September 2024: Wireplumber as of v0.5 completely changed their configuration format from lua to json, and won’t automatically migrate your configuration. Before proceeding, check which version of Wireplumber you have installed.

For Wireplumber < 0.5, the configuration format is lua scripts. For this example, 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)

For Wireplumber 0.5 and later, the configuration format is json. For this example, I created the file ~/.config/wireplumber/wireplumber.conf.d/51-disable-hdmi-devices.conf with the following code:

monitor.alsa.rules = [
  {
    matches = [
      {
        device.name = "alsa_card.pci-0000_03_00.1"
      }
    ]
    actions = {
      update-props = {
        device.disabled = true
      }
    }
  }
]

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.

On more than one occasion, I’ve found that the device names have changed after a major update – I’m not sure if this is due to a kernel change or a change in pipewire/wireplumber. But if things suddenly stop working and you’re seeing devices you thought you had disabled, go back to running pactl list short and see if your device name has changed.

For reference, I’m using pipewire and wireplumber on Manjaro Linux, which is a rolling release distro and tends to stay pretty close to the upstream software releases. I ultimately learned how to do 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. Another handy reference for the wireplumber 0.5 config change update is this migration guide. Best of luck with your audio configuration journey!

6 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

  4. Justin Says:

    Thank you so much, worked perfectly!

  5. Ren Says:

    Hey, bit of a newcomer at linux stuff, please do tell me if you update this. I really do appreciate your work here, and the link did send me in further, but for some reason I didn’t get it working.

  6. Scott Says:

    Hey Ren – FYI I finally took some time to update this blog post. It now includes config examples for both versions of wireplumber, as well as a tip to check pactl list short if suddenly a disabled device reappears. I’ve found that my device names have changed after some unknown software upgrade, and I’ve had to re-write the configs to reflect that. Hope this helps!

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