Enabling a Bluetooth device does not switch default sink/source, causing problems with audio recording in Firefox
Google Meet records audio successfully in Chromium but not in upstream Firefox (tried Firefox 78, 81, 82, 83 and 84). Firefox asks for microphone permissions and Google Meet thinks it is using the Bluetooth mic, but pavucontrol reports that there are no applications recording audio. This happens in master but also in 0.3.18, so it's not a recent regression. Firefox+PulseAudio works fine.
pactl set-default-source DEVICE_ID and
pactl set-default-sink DEVICE_ID (obtained from
pactl list sources and
pactl list sinks) and restarting Firefox fixes the recording problem for all microphones, not just the default one. I know it seems weird that both would be required, but I tried separately deleting
~/.config/pipewire-media-session/default-nodes then restarting
pipewire-media-session, and both deletions make the microphone stop working. Perhaps I did something wrong in my testing? With PulseAudio, removing
~/.config/pulse does not pose a problem.
If I completely remove
~/.config/pipewire-media-session and start PipeWire, pactl reports:
$ pactl info ... Default Sink: alsa_output.pci-0000:00:1b.0.analog-stereo Default Source: alsa_input.pci-0000:00:1b.0.analog-stereo
If I then switch the Analog Stereo source/sink off (thus temporarily having no active audio devices) and connect a Bluetooth headset with HSP/HFP, pactl reports:
$ pactl info ... Default Sink: @DEFAULT_SINK@ Default Source: @DEFAULT_SOURCE@
This does not happen with PulseAudio (the default source/sink after switching devices is the headset).
The outputs of
pactl list under PulseAudio and PipeWire (commit
ccf2254b6b31635b1d12fa908a2ba3b06bf3e962) are below.
Also, here's the output of
PIPEWIRE_DEBUG=5 pipewire-pulse: pipewire-pulse.log.gz