You are not logged in.

#1 2022-09-02 00:51:09

Brocellous
Member
Registered: 2017-11-27
Posts: 85

Disable monitor source in wireplumber/pipewire

When I open a call in google meet in firefox, the default input device is "Monitor of Bose QuietComfort 35". I want to use the "Bose QuietComfort 35" input itself, and I can switch this in the application settings menu, but I have to do this for each new call. I want to switch the default device, or disable the monitor device which I do not want to use.

I'm not actually sure where this device comes from – I don't have any relevant configuration that I know of. I am using wireplumber+pipewire+pipewire-pulse for my audio:

$ systemctl --user status --lines=0 'pipewire*.service' wireplumber.service 
● wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset: enabled)
     Active: active (running) since Thu 2022-09-01 17:26:13 MST; 12min ago
   Main PID: 923 (wireplumber)
      Tasks: 4 (limit: 76792)
     Memory: 14.3M
        CPU: 1.293s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber.service
             └─923 /usr/bin/wireplumber

● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; disabled; preset: enabled)
     Active: active (running) since Thu 2022-09-01 17:26:13 MST; 12min ago
TriggeredBy: ● pipewire.socket
   Main PID: 922 (pipewire)
      Tasks: 2 (limit: 76792)
     Memory: 6.2M
        CPU: 386ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─922 /usr/bin/pipewire

● pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; disabled; preset: enabled)
     Active: active (running) since Thu 2022-09-01 17:26:13 MST; 12min ago
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 924 (pipewire-pulse)
      Tasks: 2 (limit: 76792)
     Memory: 8.0M
        CPU: 1.114s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
             └─924 /usr/bin/pipewire-pulse

I was able to disable my webcam microphone and the built-in microphone like so:

$ cat ~/.config/wireplumber/main.lua.d/51-alsa-disable.lua
rule = {
  matches = {
    {{"device.name", "equals", "alsa_card.pci-0000_00_1f.3"}},
    {{"device.name", "equals", "alsa_card.usb-046d_C922_Pro_Stream_Webcam_CCC73FAF-02"}},
  },
  apply_properties = {
    ["device.disabled"] = true,
  }
}
table.insert(alsa_monitor.rules,rule)

But I don't know how I can disable the monitor source. wpctl status does not show it along with other source(s)s:

$ wpctl status
PipeWire 'pipewire-0' [0.3.56, rpigott@rdtw, cookie:3236258173]
 └─ Clients:
        31. i3status                            [0.3.56, rpigott@rdtw, pid:914]
        33. pipewire-pulse                      [0.3.56, rpigott@rdtw, pid:924]
        36. wpctl                               [0.3.56, rpigott@rdtw, pid:8921]
        41. WirePlumber [export]                [0.3.56, rpigott@rdtw, pid:7063]
        59. Firefox                             [0.3.56, rpigott@rdtw, pid:7401]
        61. WirePlumber                         [0.3.56, rpigott@rdtw, pid:7063]

Audio
 ├─ Devices:
 │      55. Bose QuietComfort 35                [bluez5]
 │  
 ├─ Sinks:
 │  *   35. Bose QuietComfort 35                [vol: 0.53]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   34. Bose QuietComfort 35                [vol: 0.95]
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:
        32. Firefox                                                     
             62. output_MONO     > Bose QuietComfort 35:playback_MONO	[active]
        37. Firefox                                                     
             50. input_MONO      < Bose QuietComfort 35:monitor_MONO	[active]
             52. monitor_MONO   
[.. video ...]
Settings
 └─ Default Configured Node Names:
         1. Audio/Source  alsa_input.usb-Generic_Blue_Microphones_LT_2104161807469D021058_111000-00.analog-stereo

The default input is my usb microphone, which is unplugged atm. Also, pavucontrol does list the monitor source in the inputs tab, if I change the dropdown from "All but monitors" to "All inputs".

1. What creates the monitor source?
2. How can I disable or configure it?
3. How can I change the default input device with wireplumber?

EDIT:

I think it is probably created per the script in  "/usr/share/wireplumber/scripts/monitors/bluez.lua". I'm not sure how to override this.

EDIT2:

I recaptured wpctl status output, this time with a meeting open in firefox. wpctl now shows the active streams even if the monitor source doesn't show under monitors.

Last edited by Brocellous (2022-09-02 04:52:57)

Offline

#2 2022-09-02 08:14:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,073

Re: Disable monitor source in wireplumber/pipewire

I'd wish firefox just fixed their implementation. Firefox tries to be smart and fails to select the correct default device, while it could just not try to do that and everything would work as expected as you'd have your correct defaults configured in wireplumber/pavucontrol directly.

As for changing the default input device in the hopes that firefox honors that, the simplest is to just do so with pavucontrol/pactl or wpctl set-default

Last edited by V1del (2022-09-02 08:42:12)

Offline

#3 2022-09-03 16:28:00

Brocellous
Member
Registered: 2017-11-27
Posts: 85

Re: Disable monitor source in wireplumber/pipewire

Sadly firefox does not honor the default device as set by pavucontrol. I am able to change it in pavucontrol but it changes back to the setting chosen by firefox immediately. I'm still not sure how to disable the monitor device but hopefully that would work.

Offline

#4 2022-09-05 15:09:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,073

Re: Disable monitor source in wireplumber/pipewire

You should be able to set bluez_monitor.enabled = false in your /usr/share/wireplumber/bluetooth.lua.d/50-bluez-config.lua (or the relevant copy to /etc/)

Offline

#5 2022-09-05 16:10:15

Brocellous
Member
Registered: 2017-11-27
Posts: 85

Re: Disable monitor source in wireplumber/pipewire

I tried creating a new configuration:

$ cat ~/.config/wireplumber/bluetooth.lua.d/80-bluez-monitor-disable.lua
bluez_monitor.enabled = false

But sadly this disables too much. I can no longer connect my bluetooth headphones.

Offline

#6 2022-09-05 16:49:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,073

Re: Disable monitor source in wireplumber/pipewire

A right this clips bluetooth entirely.

FWIW I found https://gitlab.freedesktop.org/pipewire … te_1513983 instead of doing it that way, does

rule = {
  matches = {
     --- Replace with your BT device denotion as relevant
    {{"device.name", "equals", "bluez*"}}, 
  },
  apply_properties = {
    ["item.features.monitor"] = false,
  }
}
table.insert(bluez_monitor.rules,rule)

work ?

Offline

#7 2022-09-05 17:21:12

Brocellous
Member
Registered: 2017-11-27
Posts: 85

Re: Disable monitor source in wireplumber/pipewire

That definitely looks promising, a very good find...

I had some trouble applying this, I think the verb should be "matches" instead of "equals" at least. In the end I tried copying the instructions of the bottom poster in that thread and made a local copy of the create-item.lua script at ~/.config/wireplumber/scripts/create-item.lua and changed the "item.features.monitor" line to false. Prior to the change pavucontrol showed the monitor device under "All inputs" in the inputs tab with a volume bar that showed the volume of playback (the monitor is apparently tracking the output). After this change the monitor is still listed but with the playback volume bar removed, even if there is an active output stream.

Unfortunately, firefox _still_ chooses this defunct monitor device as the default microphone.

EDIT: I did restart wireplumber, pipewire, pipewire-pulse, and firefox to be sure.

Last edited by Brocellous (2022-09-05 17:22:53)

Offline

#8 2022-09-05 17:26:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,073

Re: Disable monitor source in wireplumber/pipewire

If you do it like the guy in the report, copying that entire file and setting it there, does that help?

Last edited by V1del (2022-09-05 17:26:57)

Offline

#9 2022-09-05 19:50:08

Brocellous
Member
Registered: 2017-11-27
Posts: 85

Re: Disable monitor source in wireplumber/pipewire

Right that's what I'm saying I did:

$ diff {/usr/share,~/.config}/wireplumber/scripts/create-item.lua
19c19
<     ["item.features.monitor"] = true,
---
>     ["item.features.monitor"] = false,

Offline

Board footer

Powered by FluxBB