You are not logged in.

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

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

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: 23,430

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: 146

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: 23,430

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: 146

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: 23,430

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: 146

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: 23,430

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: 146

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

#10 2022-10-28 16:24:12

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

Re: Disable monitor source in wireplumber/pipewire

Surprising, but my firefox issue appears to have been fixed this morning. I updated right before I shut down my pc last night with the following transaction, and it was definitely still broken yesterday:

[2022-10-28T01:31:42-0700] [ALPM] transaction started
[2022-10-28T01:31:42-0700] [ALPM] upgraded alsa-ucm-conf (1.2.7.2-1 -> 1.2.8-1)
[2022-10-28T01:31:42-0700] [ALPM] upgraded alsa-lib (1.2.7.2-1 -> 1.2.8-1)
[2022-10-28T01:31:42-0700] [ALPM] upgraded libffi (3.4.3-1 -> 3.4.4-1)
[2022-10-28T01:31:42-0700] [ALPM] upgraded glib2 (2.74.0-2 -> 2.74.1-1)
[2022-10-28T01:31:42-0700] [ALPM] upgraded chromium (107.0.5304.68-1 -> 107.0.5304.87-1)
[2022-10-28T01:31:43-0700] [ALPM] upgraded firefox (106.0.1-1 -> 106.0.2-1)
[2022-10-28T01:31:43-0700] [ALPM] upgraded linux (6.0.2.arch1-1 -> 6.0.5.arch1-1)
[2022-10-28T01:31:44-0700] [ALPM] upgraded linux-headers (6.0.2.arch1-1 -> 6.0.5.arch1-1)
[2022-10-28T01:31:44-0700] [ALPM] transaction completed
[2022-10-28T01:31:45-0700] [ALPM] running '30-systemd-update.hook'...
[2022-10-28T01:31:45-0700] [ALPM] running '60-depmod.hook'...
[2022-10-28T01:31:45-0700] [ALPM] running '90-mkinitcpio-install.hook'...

So I guess it was fixed either by the alsa conf changes or the firefox update? Though I can't find any related changes. I'll close this in a few days if it stays fixed.

EDIT: For clarity, what's fixed is that the non-monitor input source is now selected by default. The monitor source is still listed as an option, not sure if that is intended or not.

EDIT2: Darn I spoke too soon, but the behavior is exactly the same as before  right now. My headphones may have been switched to HFP by another application first, I think that might cause the different behavior in firefox.

Last edited by Brocellous (2022-10-28 19:11:29)

Offline

#11 2023-05-26 09:45:02

4ronie4
Member
Registered: 2015-09-24
Posts: 20

Re: Disable monitor source in wireplumber/pipewire

Is there any report to Firefox? If not, we should report this. It's very annoying.

Offline

#12 2023-05-26 13:30:24

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,430

Re: Disable monitor source in wireplumber/pipewire

Offline

Board footer

Powered by FluxBB