Hiding nodes in Pipewire/Wireplumber

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
User avatar
Largos
Established Member
Posts: 659
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 74 times
Been thanked: 194 times

Hiding nodes in Pipewire/Wireplumber

Post by Largos »

Due to an unused feature with my Saffire Pro 40, I end up with large unused nodes displaying in the inputs and outputs that are useless to me. This is how I have hidden them using Wireplumber

I sourced the info from here https://wiki.archlinux.org/title/WirePlumber

Using the command

Code: Select all

wpctl status

I got this output

Code: Select all

Audio
 ├─ Devices:
 │      63. Renoir Radeon High Definition Audio Controller [alsa]
 │      71. Family 17h/19h HD Audio Controller  [alsa]
 │      91. Saffire Pro 40                      [alsa]
 │     120. Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [alsa]
 │  
├─ Sinks: │ * 60. Saffire Pro 40 Pro [vol: 0.45] │ 75. Family 17h/19h HD Audio Controller Analog Stereo [vol: 0.41] │ 129. Saffire Pro 40 Pro 1 [vol: 1.00] │
├─ Sources: │ * 53. Saffire Pro 40 Pro [vol: 1.00] │ 89. Saffire Pro 40 Pro 1 [vol: 1.00] │ 112. Family 17h/19h HD Audio Controller Analog Stereo [vol: 1.00] │
├─ Filters: │
└─ Streams:

As you can see there are sinks (outputs) and sources (inputs). In each one there is "Saffire Pro 40 Pro 1" which are the ones I want to remove. There are corresponding numbers, which you need to note for the next command. I started with the sink, that is 129 so I used

Code: Select all

wpctl inspect 129

and got the following output:

Code: Select all

id 129, type PipeWire:Interface:Node
    alsa.card = "4"
    alsa.card_name = "Pro40-005ab6"
    alsa.class = "generic"
    alsa.device = "1"
    alsa.driver_name = "snd_dice"
    alsa.id = "DICE"
    alsa.long_card_name = "Focusrite SAFFIRE_PRO_40 (serial 23222) at fw1.0, S400"
    alsa.name = "Pro40-005ab6"
    alsa.resolution_bits = "24"
    alsa.subclass = "generic-mix"
    alsa.subdevice = "0"
    alsa.subdevice_name = "subdevice #0"
    api.alsa.card.longname = "Focusrite SAFFIRE_PRO_40 (serial 23222) at fw1.0, S400"
    api.alsa.card.name = "Pro40-005ab6"
    api.alsa.path = "hw:4,1"
    api.alsa.pcm.card = "4"
    api.alsa.pcm.stream = "playback"
    audio.adapt.follower = ""
    audio.channels = "8"
    audio.position = "AUX0,AUX1,AUX2,AUX3,AUX4,AUX5,AUX6,AUX7"
    card.profile.device = "1"
  * client.id = "92"
    clock.name = "api.alsa.4"
    clock.quantum-limit = "8192"
    device.api = "alsa"
    device.class = "sound"
  * device.id = "91"
    device.profile.description = "Pro 1"
    device.profile.name = "pro-output-1"
    device.profile.pro = "true"
    device.routes = "0"
  * factory.id = "18"
    factory.mode = "merge"
    factory.name = "api.alsa.pcm.sink"
    library.name = "audioconvert/libspa-audioconvert"
  * media.class = "Audio/Sink"
  * node.description = "Saffire Pro 40 Pro 1"
    node.driver = "true"
  * node.name = "alsa_output.firewire-0x00130e0401405ab6.pro-output-1"
  * node.nick = "Pro40-005ab6"
    node.pause-on-idle = "false"
  * object.path = "alsa:pcm:4:hw:4,1:playback"
  * object.serial = "1473"
  * priority.driver = "1228"
  * priority.session = "1228"

This lists a bunch of properties and one that I used to identify the device

Code: Select all

node.name = "alsa_output.firewire-0x00130e0401405ab6.pro-output-1"

I then did the following for the input and got

Code: Select all

node.name = "alsa_input.firewire-0x00130e0401405ab6.pro-input-1"

Once this is done, I went to the folder (which I needed to create) at

Code: Select all

~/.config/wireplumber/wireplumber.conf.d

and created a file called:

Code: Select all

51-alsa-disable.conf

where I put the text

Code: Select all

monitor.alsa.rules = [
  {
    matches = [
      {
        node.name = "alsa_input.firewire-0x00130e0401405ab6.pro-input-1"
      }
      {
        node.name = "alsa_output.firewire-0x00130e0401405ab6.pro-output-1"
      }
    ]
    actions = {
      update-props = {
         node.disabled = true
      }
    }
  }
]

After saving, restarting wireplumber to enact the change with the systemd command

Code: Select all

systemctl --user restart wireplumber.service

As you can see, I used the properties I found earlier and used them a condition to change another property, in this case disabling the node. This now hides the nodes and programs like qpwgraph looks a bit less cluttered.

runiq
Established Member
Posts: 53
Joined: Fri Jun 09, 2023 9:55 am
Has thanked: 72 times
Been thanked: 18 times
Contact:

Re: Hiding nodes in Pipewire/Wireplumber

Post by runiq »

Thanks for this, very useful. :) Here's a quicker way to identify the device name: Use 'wpctl status', find your device's ID (the number in front of it), use 'wpctl status -n'.

An example. Let's say I'm interested in the name of my bluetooth headset, a Jabra Evolve 65.

Code: Select all

$ wpctl status
PipeWire 'pipewire-0' [1.0.5, user@host, cookie:xxx]
 └─ Clients:
        31. uresourced                          [1.0.5, user@host, pid:1872]
        32. pipewire                            [1.0.5, user@host, pid:1878]
        33. WirePlumber                         [1.0.5, user@host, pid:1876]
        [snip]

Audio
 ├─ Devices:
 │      52. Internal Audio                      [alsa]
 │      60. Webcam C270                         [alsa]
 │      63. Jabra Link 370                      [alsa]
 │      82. Jabra Evolve 65                     [alsa]
 │  
 ├─ Sinks:
 │  *   57. Jabra Link 370 Analog Stereo        [vol: 0.36]
 │      64. Internal Audio Analog Stereo        [vol: 1.00]
 │     111. Jabra Evolve 65 Analog Stereo       [vol: 0.40]
 │  
 ├─ Sources:
 │      61. Webcam C270 Mono                    [vol: 0.78 MUTED]
 │  *   91. Jabra Link 370 Mono                 [vol: 1.00]
 │     106. Jabra Evolve 65 Mono                [vol: 1.00]
 │  
 ├─ Filters:
 │  
 └─ Streams:
        90. Firefox                                                     
             92. output_FL       > Jabra Link 370:playback_FL   [active]
             94. output_FR       > Jabra Link 370:playback_FR   [active]

[snip]

Okay, looks like the ID of my device is 82, its output is 111, and its mic is 106. Let's get those names:

Code: Select all

$ wpctl status -n
Audio
 ├─ Devices:
 │      [snip]
 │      82. alsa_card.usb-0b0e_Jabra_Evolve_65_3050752AABA1026100-00 [alsa]
 │  
 ├─ Sinks:
 │      [snip]
 │     111. alsa_output.usb-0b0e_Jabra_Evolve_65_3050752AABA1026100-00.analog-stereo [vol: 0.40]
 │  
 ├─ Sources:
 │      [snip]
 │     106. alsa_input.usb-0b0e_Jabra_Evolve_65_3050752AABA1026100-00.mono-fallback [vol: 1.00]

There you are. These are the properties 'device.name' (for ID 82) and 'node.name' (for IDs 111 & 106). You can also show device.nick/node.nick via 'wpctl status -k'.

Post Reply