Skip to content

media-session: add bluez-autoswitch module

P V requested to merge pvir/pipewire:bt-autoswitch into master

Add module that switches bluez device profile to HFP/HSP if an input stream (non-monitor, autoconnect) appears, and the current default output device is bluez one that does not have input route.

When all input streams are gone, switch all changed profiles back.

Similarly as pulseaudio, the default behavior is to switch only for media.role=Communication (or phone in PA) streams, but that's configurable with config setting.


Moving the stream to the new source is done by the standard policy-node behavior.

The behavior is not exactly the same as what Pulseaudio does, but that maybe does not matter so much.

XXX: However, e.g. Firefox seems to always set "node.target" so its streams don't move. Not sure if something should be done about this. This seems to be an issue for Firefox to solve, since changing microphone input doesn't seem to work at least in Jitsi.

XXX: This maybe should also check whether there is a default.configured.audio.source set, and not switch profiles if it is. This might makes life easier (= no need to edit config file) for people who want to use BT device for output but a different mic for input. This however conflicts with XFCE messing with the default devices. -> Probably better not to do this.

Fixes #640 (closed)

Edited by P V

Merge request reports