Skip to content

Instantly share code, notes, and snippets.

@gtirloni
Last active September 21, 2025 12:54
Show Gist options
  • Save gtirloni/4384f4de6f4d3fda8446b04057ca5f9d to your computer and use it in GitHub Desktop.
Save gtirloni/4384f4de6f4d3fda8446b04057ca5f9d to your computer and use it in GitHub Desktop.
How to disable audio devices with Pipewire

Find your devices

$ pactl list short

Create the Wireplumber rule to disable the device

$ mkdir -p $HOME/.config/wireplumber/main.lua.d
$ vi $HOME/.config/wireplumber/main.lua.d/51-disable-devices.lua
$ systemctl --user restart wireplumber

Tested on Fedora 38 with Wireplumber 0.4.14 and Pipewire 0.3.70

rule = {
matches = {
{
{ "device.name", "equals", "alsa_card.usb-046d_HD_Pro_Webcam_C920_44FFD86F-02" },
},
{
{ "device.name", "equals", "alsa_card.pci-0000_01_00.1" },
},
},
apply_properties = {
["device.disabled"] = true,
},
}
table.insert(alsa_monitor.rules,rule)
@lunatic-gh
Copy link

lunatic-gh commented May 25, 2024

For Wireplumber 0.5+, use the following instead:

<yourEditor> $HOME/.config/wireplumber/wireplumber.conf.d/51-disable-devices.conf

monitor.alsa.rules = [
  {
    matches = [
      {
        device.name = "~alsa_card.pci-*"
      },
      {
        device.name = "alsa_card.usb-Sony_Interactive_Entertainment_DualSense_Wireless_Controller-00"
      }
    ]
    actions = {
      update-props = {
      	device.disabled = true
      }
    }
  }
]

@foriequal0
Copy link

foriequal0 commented Nov 9, 2024

You can use wpctl status, wpctl inspect <id> instead of pactl if you don't have it.

@monetschemist
Copy link

Thanks a lot for this. For anyone besides me who finds it, pay close attention to the device name found with pactl. In my case (as in the example given above), it's going to start with the string alsa_card. Don't get fooled by the lines that start with something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment