Bug 107019 - Cannot make bluetooth headset automatically switch profiles
Summary: Cannot make bluetooth headset automatically switch profiles
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-24 21:41 UTC by Nikolay
Modified: 2018-07-30 09:39 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Nikolay 2018-06-24 21:41:03 UTC
I have the following bluetooth headset: Bose AE2 SoundLink which supports HSP and A2DP profiles. I can switch between those profiles manually and things seem to be working as expected.

Unfortunately automatic switch between profiles doesn't seem to work. I have 'module-bluetooth-policy' module loaded but the problem as I understand it is that  PulseAudio doesn't define audio source when headset is in A2DP mode.

The usecase is:
* Listen to music
* Attempt to make a Google Hangouts call -- at this point I cannot configure Hangouts to uses headset mic because it is not present in list of audio sources. I have to manually switch to HSP profile in PA before I can make a call.

Other OSes seem to be handling this config change automatically.

I have Ubuntu 18.04 with PA 1:11.1.

Please let me know if any more information is required.
Thanks!
Comment 1 Tanu Kaskinen 2018-06-27 10:53:43 UTC
Google Hangouts probably doesn't set the media.role property to "phone" for its stream (actually the browser would have to do that, and I don't think any browsers set the media.role property). In its default configuration module-bluetooth-policy will automatically switch profiles only when media.role is set to "phone". You can pass "auto_switch=2" to module-bluetooth-policy in /etc/pulse/default.pa to make the profile switching more aggressive. Does that help?
Comment 2 Nikolay 2018-06-27 13:42:00 UTC
I've tried that and I could not make it work.

The problem, as I see it, is that hangouts allow one to select output and input before the call is started - there are just dropdowns in the settings dialog that match sink/source in PA. Obviously BT mic is not there - so I cannot even start the call - and my understanding is that before call is started browser doesn't open sound devices meaning 'media.role' is not being passed.

That being said it feel odd to make browser to pass 'media.role' - browser can have all sorts of apps like video players and games and god knows what - so browser would need to somehow set that role for each individual tab - I do not think media API for web sites even provides that capability.
Comment 3 Tanu Kaskinen 2018-06-28 14:41:38 UTC
Does hangouts force you to select the input device? If you set "auto_switch=2" and the browser leaves the input device unspecified, then that should work.

Otherwise the options are that either the browser learns to tell hangouts about the bluetooth headset even when the current profile is a2dp, or pulseaudio starts to show "potential" sinks and sources along with "active" sinks and sources. Neither seems likely to get implemented any time soon... Showing "potential" devices is something that feels like it's probably a good idea, but implementing it is a rather big project.
Comment 4 Nikolay 2018-06-28 18:06:10 UTC
Hi Tanu,

Hangouts doesn't 'force' me in a sense that I can make a call without going to settings dialogue - but in that case hangouts chooses 'default' mic which is just some different mic on the laptop, like 'embedded' one - so there is no way to leave device 'unspecified'.

From usability perspective it seems like 'bluetooth profiles' is way to technical for 'common folk'. It seems like ideally PA should handle that transparently: i.e. for bluetooth headsets it should just expose general 'mic' and general 'headphones' - and manage profile switching auto-magically.
Comment 5 GitLab Migration User 2018-07-30 09:39:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/81.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.