Add automatic switching to HSP/HFP from A2DP when a mic is needed

Bug #508522 reported by Alex Ivasyuv
592
This bug affects 120 people
Affects Status Importance Assigned to Milestone
PulseAudio
New
Unknown
chromium-browser (Ubuntu)
Confirmed
Wishlist
Unassigned
Declined for Xenial by Daniel van Vugt
pulseaudio (Ubuntu)
Triaged
Wishlist
Unassigned
Declined for Xenial by Daniel van Vugt

Bug Description

Binary package hint: pulseaudio

I'm testing a Nokia BH-905i headset (see http://www.wissel.net/blog/d6plinks/SHWL-8AZGGF ) on Ubuntu 10.10. The Bluetooth module correctly identifies the headset and the both audio profiles "HSP/ HFP Telephony duplex" and "A2DP High Fidelity Playback". For music playback only A2DP is suitable (HSP/HFP sounds like listening to music played through an old telephone). A2DP does not have an INPUT mode, so use of the headset for VoiP isn't possible.
What would be needed is a separate selection to allow to select A2DP for output and HSP/HFP for input. Smartphones (a lot of them *nix based) phones do that (or they switch on the fly?).

Formal structure:
1) Ubuntu 10.10
2) Pulse-Audio 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu21.1
consisting og pluseaudio, pulseaudio-esound-compat, pulseaudio-module-bluetooth, pulseaudio-module-gconf, pulseaudio-module-x11, pulseaudio-utils
3) Select high quality audio output and still use the Bluetooth microphone
4) Had to choose: either high quality audio or "telephone quality" with microphone

I can change the profile without the Bluetooth connection dropping, but that's ridiculous. E.g. listening to music, a call comes in. Then I would need to switch the profile before answering. Please note that in Windows, Mac OS, iOS, Android, and Windows Mobile it's done automatically.

Check out attached screencast.

ProblemType: Bug
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 2/2
   Subdevice #0: subdevice #0
   Subdevice #1: subdevice #1
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: oivasyuv 2309 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xd8500000 irq 17'
   Mixer name : 'Analog Devices AD1984A'
   Components : 'HDA:11d4194a,103c30e8,00100400'
   Controls : 22
   Simple ctrls : 14
Date: Sat Jan 16 22:31:41 2010
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: pulseaudio 1:0.9.19-0ubuntu4
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-17.54-generic-pae
SourcePackage: pulseaudio
Uname: Linux 2.6.31-17-generic-pae i686

Revision history for this message
Alex Ivasyuv (industral) wrote :
Revision history for this message
Andrey Beljakov (andvalb) wrote :

This not bug.

Revision history for this message
D. Brodzik (amyrose) wrote :

Yeah, this isn't a bug. The microphone on Bluetooth headphones is only for taking a call when you're using them with a phone. A2DP does not support microphones, as far as I'm aware.

Daniel T Chen (crimsun)
Changed in pulseaudio (Ubuntu):
status: New → Invalid
Revision history for this message
Keith Gillis (kjgillis) wrote :

I think this is almost a bug. Just need to be restated. When my phone connects to my headset it lists the profiles it's activating. It shows "Stereo Audio" and "Handsfree". I think it uses HSP and A2DP simultaneously, so the microphone and high quality audio are both available. If I'm right on this then the ability to use HSP and A2DP together would be a useful feature to add to ubuntu.

Changed in pulseaudio (Ubuntu):
status: Invalid → New
Revision history for this message
John Doe (b2109455) wrote :

Any new approaches? I'm also confronted with this problem, and wish to have both profiles simultaneously.

Revision history for this message
Gleb Mazovetskiy (glex-spb) wrote :

This is a very serious issue for all of us who work outside the office
BT headset is a necessity
Not having it in Ubuntu means having to use windows for me :(

description: updated
description: updated
summary: - mic doesn't available in A2DP profile
+ Mic is not available with A2DP Bluetooth profile
Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 508522] Re: mic doesn't available in A2DP profile

For all of you affected, are you able to use your headset mic with the a2dp profile in other operating systems, i.e does the mic work in both profiles when used with other devices/OSs?

Revision history for this message
Gleb Mazovetskiy (glex-spb) wrote : Re: Mic is not available with A2DP Bluetooth profile

Yes, it does (even with a smartphone like iPhone)

Revision history for this message
John Doe (b2109455) wrote :

Same here. It's also written in the manual that the microphone should support this (product type: Arctic Sound P311).

Revision history for this message
John Doe (b2109455) wrote :

Any updates?

Revision history for this message
nick parlante (nick-parlante) wrote :

I'll add a vote that this feature is definitely worth fixing. Little bluetooth speakers, headphones etc. are proliferating for audio outside of just phone calls. The gadgets all seem to include a mic, so you can answer calls when listening to music transparently (great for voip too of course). As mentioned above, other OSs handle this case. I suspect every college student on earth is going to have these speakers in a couple years, as it's such a seamless way to listen to music from the phone/tablet/etc.

Googling around, it looks like A2DP does not support mic input. My guess is other OSs support this by hacking A2DP mode to also support using HSP for simultaneous input, though in the UI the user sees A2DP and HSP as two mutually exclusive choices.

I guess one could just go look at how Android does it.

Revision history for this message
Rykel from Singapore (rykel98) wrote :

I am also bugged by this non-bug. I find it impossible to listen to my music and having to suddenly run back to my Ubuntu desktop to change the profile using a mouse when I need to use the microphone. It would be fabulous if desktop Linux could catch up in this department. Perhaps, as Nick Parlante said, "... just go look at how Android does it"?

Revision history for this message
Pali (pali) wrote :

This is bug.
My bluetooth headset Creative WP-350 support activated both A2DP and HSP profiles. At one time I can use HSP profile (mic input) for mobile phone and A2DP (output) for computer. But I cannot use at one time both A2DP and HSP profiles with pulseaudio.

Revision history for this message
David Henningsson (diwic) wrote :

Don't know how informative this is, but here's a discussion upstream: http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-September/011264.html

Changed in pulseaudio (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Alexander Adam (7ql6) wrote :

This wasn't a bug in my last ubuntu installations but it is a bug in my current installation ( https://bugs.launchpad.net/ubuntu/+source/linux/+bug/902572 ).
In other operating systems and my n900 it does work flawlessly.

I think this could also be a duplicate of this?
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/444017

Revision history for this message
Naba Kumar (naba) wrote :

This bug also affects Nokia BH-604 headset. I have to switch to HSF mode everytime I want to initiate a call.

Revision history for this message
SpudULike (launchpad-spudulike) wrote :

I am also affected by this issue, my Sony MW-600 headset does not appear in the Input section of Sound Settings while in A2DP mode. I know the device supports this and I'm sure it has worked on previous versions of Ubuntu.

With the device connected I ran pactl list cards which yealded :-

Card #1
 Name: bluez_card.30_17_C8_8A_96_F3
 Driver: module-bluetooth-device.c
 Owner Module: 24
 Properties:
  device.description = "MW600"
  device.string = "30:17:C8:8A:96:F3"
  device.api = "bluez"
  device.class = "sound"
  device.bus = "bluetooth"
  device.form_factor = "headset"
  bluez.path = "/org/bluez/838/hci0/dev_30_17_C8_8A_96_F3"
  bluez.class = "0x240404"
  bluez.name = "MW600"
  device.icon_name = "audio-headset-bluetooth"
  device.intended_roles = "phone"
 Profiles:
  a2dp: High Fidelity Playback (A2DP) (sinks: 1, sources: 0, priority. 10)
  hsp: Telephony Duplex (HSP/HFP) (sinks: 1, sources: 1, priority. 20)
  off: Off (sinks: 0, sources: 0, priority. 0)
 Active Profile: a2dp

Is the 'device.intended_roles="phone"' set to the right option, the main use we all seem to want is that of a headset? Should the a2dp 'sources' switch be set to 1 ?

Revision history for this message
SpudULike (launchpad-spudulike) wrote :

Looks like I've got this wrong. After a bit of a chat on #bluez-users on freenode irc I now understand that the microphone in my device, and probably that of the majority of other bluetooth headsets, is not supported in A2DP by design. I must have been using usb headphones for stuff like Skype to get the better audio quality and a working microphone. So now, this seems to be a feature request into a better, more automatic way, for Ubuntu to switch between modes depending on use.

Revision history for this message
Stéphane Poissant (spoissantca) wrote :

Me and my co-worker just bought a bluetooth headset (jabra) for our work. We are both using linux. I am on Ubuntu 12.10.
My BT headset works just fine on both HSP w/ microphone or AD2P for music. However, it is not efficient to answer the phone.
I have to switch the audio profile to HSP in order to have the microĥone working...Not very good when phone rings to go through many clicks prior to answer the phone (switching to HSP)... I, and my co-worker too are very interested in such a feature like my android phone does. (automatic switch). or at least, a shortcut on keyboard or top bar...whatever would make it easier...

One other thing; most of the BT audio adapters have 1-2 control button to start/stop and/or volume control. On android, it controls
the music playing...or switch to answering the phone when it rings...Is it possible to have such feature for the default music program? like rhythmbox or clementine?

If someone has a solution for me, altough it may be a work around, I'd lie to know about it.
I am opened to anything...!

best regards.
keep up with the good work guys.

Revision history for this message
kimus (kimus) wrote :

I hope some one fix this issue. It's a 3 years old one!

Revision history for this message
Alexander Adam (7ql6) wrote :

Yes, obviously this seems to be anyhow tricky.
Some people say that A2DP doesn't support unidirectionaly streams (ie D. Brodzik and SpudULike here in this thread or like nick parlante found out by googling).

Some people say that it is possible but there are no headsets supporting it ( http://osdir.com/ml/linux.bluez.devel/2005-01/msg00187.html ) [1].

Otherwise it is working in other operating systems and also wikipedia says that "is designed to transfer a *uni-directional* 2-channel stereo audio stream" ( http://en.wikipedia.org/wiki/A2DP#Advanced_Audio_Distribution_Profile_.28A2DP.29 ).

I don't have any clue about, what things are working and what aren't. I just see the problem.

What would help:
2011 Alexander Skwar asked wether it is possible at least to switch the profiles automatically, depending on what are you doing (A2DP everytime you are just listening and HSP when starting a call with ekiga/skype).
Colin Guthrie responded that they are working on it ( http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-September/011296.html / http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-September/011300.html ).
But at least on my computer now with Ubuntu 13.04 and ASUS Zenbook UX31A, the standard choosen profile is HSP and therefore terrible sounding.

Anyhow, I also doesn't have the impression that we are making any progress here. :-)

[1] I have to admit that this message is from 2005 and not up-to-date for sure . I just
wanted to show that you will find many "facts" and opinions in the web.

Revision history for this message
Ondřej Janošík (jondra91) wrote :

I think that problem is that you can't use both profiles simultaneously because pulse always switches HFP when I select mic and doesn't stay in A2DP for audio sink.
The ideal solution is when I can use A2DP for audio sink and HFP for audio source which is the way it works in Windows so I have high quality sound and microphone available.

Revision history for this message
mpw (matthiaspeterw) wrote :

I guess the Windows way works somehow like this: The driver shows the mic even during the a2dp profile is active. And if an application wants to record from that bt mic, it switches the profile to HFP automatically. Guess that should be possible for linux aswell, right?

Revision history for this message
Alain Kalker (miki4242) wrote :

There _is_ documented, approved support for using both HFP and A2DP together.
Take it from the horse's mouth (i.e. the Bluetooth SIG): http://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=49216

Headsets capable of both high-quality media playback and microphone input areclassified as having the role "HANDSFREE WITH RENDERING DEVICE CAPABILITIES (HF_RD)". Full implementation guidelines are in the document.

So my guess is that there's nothing holding back implementing this. Yay!
Like profiles for other sound devices, Pulseaudio should offer a profile like "High Fidelity Playback (A2DP Sink) + Analog(?) Microphone Input (HFP Source)" for such devices.

Revision history for this message
Alain Kalker (miki4242) wrote :

From looking at the source, it appears that profile switching was intentionally disabled for some reason (commit 71bd458: bluetooth: Disable profile auto-switch policy for headsets).
I did find a proposal with some discussion on the mailing list, in particular: "[RFC v0 4/5] bluetooth: Use profile availability to auto-switch profiles"
http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-February/016182.html

It also appears that HF_RD role is unimplemented, either because there are other problems with it, lower level support is missing (bluez), or the authors are unaware of it.

Either way, I'll post a question on the Pulseaudio mailing list about it.

Revision history for this message
Tapio Saarinen (q-admin-bitlong-org) wrote :

Did you get around to posting a question/did it get a response? Had a look through the archives but couldn't see anything.

Revision history for this message
Daryl Tucker (daryltucker) wrote :

I want to thank all of you for commenting and providing so much useful information to this "non bug". This affects me in 13.10 using this Turtle Beach headset: http://www.turtlebeach.com/product-detail/xbox-headsets/ear-force-xp510/345

Revision history for this message
Daryl Tucker (daryltucker) wrote :

Has anybody had any luck with this?

Revision history for this message
Raymond (superquad-vortex2) wrote :

if a2dp only support playback, pulseaudio fallback to use on board capture which is steteo ,there will be channel conversion problem when switch back to HFP mono capture

do HFP playback mono or stereo ?

Revision history for this message
atimonin (atimonin) wrote :

For Skype (at least) there should be a workaround using notification scripts and switching
profiles as in https://wiki.archlinux.org/index.php/Bluetooth_headset#Switch_between_HSV_and_A2DP_setting
for ex.:
pacmd set-card-profile 2 a2dp

Revision history for this message
Pali (pali) wrote :

Here is patch for pulseaudio which fixing this problem:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-September/021844.html

Patch automatically switch between a2dp and hsp profiles based on number of recording streams.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Cool, I've read a little the discussion about the v1 of the patch, is this going to be merged upstream?

I also would have preferred the bluetooth device to be automatically selected on connection, BTW :/

Revision history for this message
Pali (pali) wrote :

Do not know if they are going to merge it. You can look in discussion that developers do not want to autoswitch to hsp profile if application does not tell that to pulseaudio (because hsp profile has low quality). So e.g. when you start parec (for recording sound from some input device) PA devs does not want to use bluetooth hsp mode because it has low recording quality and they think that user should manually allow this... As you read discussion you could know that I do not agree with their statements and I want to automatically switch to hsp mode (from a2dp) when any application ask for recording. My v2 patch just fixing code for deciding if recording application should be ignored or not. It does not change anything other...

Revision history for this message
mpw (matthiaspeterw) wrote :

Is there a way to vote for this patch? I'd really like to see this in Pulseaudio as any other OS that I know (iOS/Android/any Windows) supports this.

Revision history for this message
Florian (floeschie) wrote :

+1

Revision history for this message
sfl (g-launchpad-net-sbfleury-fastmail-fm) wrote :

Just tried to get jaybird bluebuds x working with 15.04 and it seems mic isn't supported (although it seems to work fine when paired with a phone - good quality on music playback and mic works on calls). Is this expected to work out of the box in 15.04 or does it require manual switching between HFP/A2DP ?

Revision history for this message
Luis Alvarado (luisalvarado) wrote :

Same applies for Phiaton Chord MS 530. If I do not use A2DP, the mic works. If I set it to A2DP, the mic dies. I had to use the Bluetooth Manager (blueman) because the Bluetooth manager that comes with 16.04 could not handle the bluetooth set correctly.

So basically, up to 16.04, A2DP + Mic is yet not possible (Not sure if it's Linux or the actual Bluetooth architecture).

Revision history for this message
Raphael Carrier (raphael-carrier) wrote :

Its a limitation of the bluetooth protocol.

Windows and macos implement both A2DP and HFP and switch on the fly when microphone usage is requested by an app. HFP uses a low quality GSM codec so the sound quality will degrade when switching to that profile.

It is possible to have multiple bluetooth profiles active on one device but A2DP and HFP are mutually exclusive due to bandwidth limitations.

Revision history for this message
Pali (pali) wrote :

Good news! My (reworked) patches from comment #31 were finally accepted into pulseaudio git. Autoswitch support for media.role=phone applications will be in pulseaudio 10.0. And autoswitch support based on heuristic will be in version after 10.0 (but disabled by default).

media.role=phone patches for pulseaudio 10.0:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=bde2ff8794a9363b1f7f2c683b160268ce371770
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=e32a462cc4201d9c3c7305d0f806d16a09f08875

heuristic patch (after 10.0):
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=b245fb41e17a4c74a2226f9202788aa883a340e9

tags: added: a2dp mic
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I believe this was fixed in PulseAudio 10 (Ubuntu 17.04 and later):
https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/10.0/

We are working on backporting some related features to 16.04. I'm not sure if this is one included in the patchset but I think it might be.

Changed in pulseaudio (Ubuntu):
importance: Wishlist → High
status: Confirmed → Fix Released
Revision history for this message
Thomas Mayer (thomas303) wrote :

Off-topic in terms of this issue:

@b2109455 I have two Arctic P311 (one is ~3 years old and one is ~5 years old). For both, the quality of the microphone is not sufficient to talk with somebody. I can only use A2DP with it, which is perfectly fine for me (most of the time).

Can you practically talk in an understandable manner to someone, using the microphone of the P311? How old is your P311 (there's multiple generations with same name)?

Revision history for this message
Thomas Mayer (thomas303) wrote :

@vanvugt Given that this issue is for pulseaudio and deals with bluetooth, a backport fixing this issue eventually also fixes #1589008. In case it does, #1589008 eventually is a duplicate, or vice-versa.

In respect to #1589008: I'm really frightened that one day I still switch bluetooth profiles for no reason after this is fixed (could be classified as an obsessive-compulsive disorder on my side then).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thomas: I had never come across that bug because it is assigned to the kernel rather than pulseaudio. Please update it as required.

Changed in pulseaudio (Ubuntu):
assignee: nobody → Pali (pali)
Revision history for this message
Pali (pali) wrote :

You have linked pulseaudio patches in comment #39.

Changed in pulseaudio (Ubuntu):
assignee: Pali (pali) → nobody
Revision history for this message
Jeroen (c0p3rn1c) wrote :

I'm on kubuntu 17.04 with pulseaudio 10.0, I'm still having this issue. Is this a kubuntu only issue?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Jeroen, please open a new bug using this command so that we can get more information about your system:
  ubuntu-bug pulseaudio

Revision history for this message
Jeroen (c0p3rn1c) wrote :

I've created a new bug report to provide more information: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1711087

Revision history for this message
Jorge Pereira (jpereiran) wrote :

I'm on kubuntu 17.04 with pulseaudio 10.0, I'm still having this issue.

Revision history for this message
Maartenrvd (v-maarten) wrote :

i'm on ubuntu 18.04 with a headphone "Bose QC35 II" and i am still having this issue. It makes this headphone more or less worthless.

:'(

So please fix this a.s.a.p!.!

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug has been closed for over a year. To help us identify the problems you are facing, please open a new bug by running:

  ubuntu-bug pulseaudio

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Since we are still getting complaints about this issue and my comment #40 was not accompanied with an exact verified fix, this bug is reopened.

Changed in pulseaudio (Ubuntu):
status: Fix Released → Confirmed
tags: added: bionic
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Interesting though, that we are only getting complaints about Ubuntu 18.04 now. Maybe the problem was fixed in a later release?

Revision history for this message
Thomas Andrews (larnu) wrote :

Disappointing that 9 years on this is still an issue. If I have A2DP Sink selected I have no Mic option, and if I use HSP/HFP the audio quality sounds like it's being played down a 14.4K modem; you might as well not have audio as it's just going to cause your ears to bleed.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Duplicate bug 1828393 suggests Bluetooth theoretically allows for two profiles to be enabled simultaneously. That would resolve this, but I don't know if it's true. If it is true then any fix would require modifying PulseAudio and the GUI in gnome-control-center.

Maybe it's not really simultaneous. Maybe it's just smarter automatic switching. There is an upstream bug for that already:

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/81

Revision history for this message
Pali (pali) wrote : Re: [Bug 508522] Re: Mic is not available with A2DP Bluetooth profile

On Monday 10 June 2019 17:30:14 Thomas Andrews wrote:
> Disappointing that 9 years on this is still an issue.

My patches for automatic switching are part of pulseaudio 10. So this
problem is fixed.

> If I have A2DP Sink selected I have no Mic option

This is expected behavior. Your headset in A2DP Sink mode does not
support microphone.

> and if I use HSP/HFP the audio quality sounds like it's being played down a 14.4K modem

And this is expected too. In HSP/HFP mode is used CVSD codec which is
sampled at 8 kHz. Same what is used in telephony system.

> you might as well not have audio as it's just going to cause your ears to bleed.

So what you wrote is expected and correct behavior. Your headset does
not support anything else, it is by bluetooth design.

===

I think you can close this issue with title "ad2p sink profile mic not
available". Really by bluetooth design A2DP sink profile does not
support microphone and it is intended behavior.

The fix which is in pulseaudio 10 is automatic switching between A2DP
and HSP/HFP profiles based on fact if some phone application want to
access microphone or not.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Mic is not available with A2DP Bluetooth profile

I wish it was that simple.

The automatic switching (which is indeed documented in the release of PulseAudio 10 [1]) doesn't seem to work for all users by the sound of it. And people are probably justified in complaining if they find Windows 10 or Android does a better job with the same headset.

I am not one of those users but I see enough complaints to believe the issue is still real. How real, I don't know... we only seem to be getting complaints about Ubuntu 18.04 (PulseAudio 11.1). But that could also be related to the general tendency of people to prefer the latest LTS.

[1] https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/10.0/

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Maybe related to the fact that Ubuntu 18.04 is the only "current" release that doesn't have the latest bluez 5.50 ...? But now I am guessing.

Revision history for this message
Pali (pali) wrote : Re: [Bug 508522] Re: Mic is not available with A2DP Bluetooth profile

On Tuesday 11 June 2019 08:11:07 Daniel van Vugt wrote:
> The automatic switching (which is indeed documented in the release of
> PulseAudio 10 [1]) doesn't seem to work for all users by the sound of
> it. And people are probably justified in complaining if they find
> Windows 10 or Android does a better job with the same headset.

If automatic profile switching does not work then it is different
problem, not problem "mic not available in A2DP Sink".

> I am not one of those users but I see enough complaints to believe the
> issue is still real. How real, I don't know... we only seem to be
> getting complaints about Ubuntu 18.04 (PulseAudio 11.1). But that could
> also be related to the general tendency of people to prefer the latest
> LTS.

You would have to find real issue and provide all needed details when
and how automatic profile switching does not work. And ideally send all
needed information to pulseaudio mailing list... I can look at it, but
without details there is no much which somebody can do.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Mic is not available with A2DP Bluetooth profile

> If automatic profile switching does not work then it is different problem, not problem "mic not available in A2DP Sink".

Yes I think you are right the bug title is incorrect. But it annoys people if we close a bug on a technicality when they are still suffering. Maybe it needs rewording...

> You would have to find real issue and provide all needed details when
and how automatic profile switching does not work. And ideally send all
needed information to pulseaudio mailing list... I can look at it, but
without details there is no much which somebody can do.

Great! Anyone experiencing this bug still, please tell us what Ubuntu version it is in and also contact the PulseAudio developers. Either by mailing list or by a bug report such as in https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/81

Changed in pulseaudio:
status: Unknown → New
Revision history for this message
Markus Reuther (s-markus) wrote :

I am also affected by this issue: I would like to use my Jabra ENVOLVE 65 headset with A2DP for the headphones in combination with the microphone of the headset at the same time. Hope that A2DP (for the headphones) and HSP/HFP (for the microphone) can be used simultaneously via Bluetooth and that someone finds out how and that someone fixes this. While this is not fixed I can not use my headset for voip calls under Ubuntu (18.04) (HSP/HFP quality is too poor for a multiple-hour call).

Revision history for this message
Pali (pali) wrote : Re: [Bug 508522] Re: Mic is not available with A2DP Bluetooth profile

On Thursday 11 July 2019 10:22:53 Markus Reuther wrote:
> I am also affected by this issue: I would like to use my Jabra ENVOLVE
> 65 headset with A2DP for the headphones in combination with the
> microphone of the headset at the same time.

Does your headset supports such feature? Ideally it is presented by
vendor that this feature is supported? If yes, can you please describe
how you are enabling this feature on headset? So we can look how to
process it in pulseaudio.

Revision history for this message
Michael (miwait00) wrote : Re: Mic is not available with A2DP Bluetooth profile

Maybe this issue has a more fitting issue (and helpful? information):
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1838151

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

On second thoughts, the bug description here already sounds accurate. Only the bug title is wrong so I will fix that.

Changed in pulseaudio (Ubuntu):
status: Confirmed → Invalid
status: Invalid → Confirmed
importance: High → Wishlist
status: Confirmed → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Probably the next step is for people to identify which apps are having the problem and tell the upstream developers here: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/81

summary: - Mic is not available with A2DP Bluetooth profile
+ Add automatic switching to HSP/HFP from A2DP when a mic is needed
Changed in chromium-browser (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Revision history for this message
t-m (tsoikkeli) wrote :

Can you please describe how can I enable automatic switching?

Using Bose QC35 and fresh Ubuntu 20.04. I need to manually set the profile when calling with MS Teasm, Google Meet, Zoom etc.

This works in Windows and MacOS perfectly so it is supported by the device.

Revision history for this message
t-m (tsoikkeli) wrote :

Just to clear out what the intended behavior should be:

Automatically switch to HSP/HFP when an application is requesting to record the microphone. When it stops, revert back to A2DP.

This is how this works in other operating systems so this is what we should aim for also in here. A2DP with a microphone is wishful thinking and should not be pursued after.

Revision history for this message
kay (kay-diam) wrote :

I also have issues with "HSP/HFP" profile detection in apps. I have to close an app, then manually switch profile to "HSP/HFP", then start an app. Only then I can use microphone.

Revision history for this message
Pali (pali) wrote :

"Automatically switch to HSP/HFP when an application is requesting to record the microphone. When it stops, revert back to A2DP."

Pulseaudio is already doing this for applications which registers to pulseaudio with "phone" media role, what VOIP applications should do.

You can test it with command line application parec which put on stdout recorded microphone stream:

$ parec --property=media.role=phone

Revision history for this message
sunil singh (delsunil) wrote :

When this will be fixed this is very irritating my same one plus bullet Z works with 18.4.
This is defenitely a bug need to be fixed.

Revision history for this message
sunil singh (delsunil) wrote :

And if this is not a bug how my same headphone work very well on Windows machine

Revision history for this message
bpauliac (bpauliac) wrote :

Hello all,

I experienced the same issue. My bluetooth headset did not switch automaticaly from A2DP to HSP/HFP on a ubuntu 18 with a pulseaudio 11.1

By setting a bluetooth switch policy more aggressiv it fixes this issue.

You can do so by modifying the file /etc/pulse/default.pa
change the line :
load-module module-bluetooth-policy
in
load-module module-bluetooth-policy auto_switch=2

Restart your laptop

Now it switches automatically when an application request microphone (tested with discord)

Regards

Revision history for this message
Jean- (jean-helou) wrote :
Download full text (17.6 KiB)

Ever since I switched to linux I have been encountering various issues with my Bose QC35 II headset.

I used it extensively on my mac book pro before, here is the behaviour I was used to:
- upon connecting the headset the sound streams where automatically redirected to it
- upon starting a visio conference call (meet.google.com on chrome and firefox, skype, jitsi, slack) the built-in microphone would activate automatically and I don't remember lowered sound quality (as in noone ever told me I sounded like a robot even after switching from builtin mike to headset mike).
- upon disconnecting, spotify would pause automatically (which avoids the sudden "music blasting off the laptop speaker" when the headset runs out of battery :)

On ubuntu 20.04, after encountering various issues, I am in a state where it's **almost** working:
- for playback on connecting it works just fine
- for visio conferencing, without custom configuration pulseaudio systematically prefers the laptop microphone over the BT microphone, I can enable it but I have to manually select it in gnome settings, sometimes within the app itself. When switching from built-in laptop microphone to headset microphone, multiple interlocutors reported I suddenly sounded like a robot.
- upon disconnecting, spotify does not pause automatically, I have learned to make sure the laptop speakers are muted before disconnecting or on low battery warnings from the headset. I read through a lot of material on pulseaudio lately and I think this could be configured though a policy (either by loading one that exists or by creating an additional one)

According to
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/508522/comments/39, with the default configuration, autoswitch shoudl trigger when the calling app attempts to record with media.role=phone.
I haven't been able to make this work on ubuntu 20.04, with
- snap slack
- firefox (jitsi or google meet)
- chrome (jitsi or google meet),
- a dockerized zoom (https://github.com/mdouchement/docker-zoom-us/blob/master/scripts/zoom-us-wrapper)

now there is the "more aggressive switching behaviour" : when specifying load-module module-bluetooth-policy auto_switch=2

Using auto_switch=2, almost works \o/

Using chrome :

- Google meet session: autoswitch does lots of back and forth making my headset beep dozens of time (which is quite annoying). Sometimes ends up working sometimes not and I get loads of bluetooth/sound related errors in journald

janv. 18 11:48:16 x1byjean kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
janv. 18 11:48:16 x1byjean kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
janv. 18 11:48:16 x1byjean kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
janv. 18 11:48:16 x1byjean kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
janv. 18 11:48:16 x1byjean kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
janv. 18 11:48:16 x1byjean rtkit-daemon[1817]: Supervising 7 threads of 1 processes of 1 users.
janv. 18 11:48:16 x1byjean kernel: Bluetooth: hci0: SCO packet for unknown connection handle 294
janv. 18 11:48:16 x1byjean kernel: ...

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Daniel, do you think there would be any problem in overriding the default configuration we ship to have auto_switch=2 set by default?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think the right answer is to ask upstream first so we don't have to carry more customizations which we don't understand as well as they do. And someone already did:

  https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/81

So for the moment we are waiting on a reply.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh actually maybe upstream already answered that:

  https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/637

Revision history for this message
Jean- (jean-helou) wrote :

Note that meet + chrome is unusable with auto_switch=2 and bose QC35 II.

I only managed to make it work once when initially investigating the option. I haven't been able to make a single google meet call with chrome ever since I activated that option, I must regularly start firefox specifically for these calls.

Revision history for this message
David LaVerne (laverne) wrote :

I've added a new error report that goes beyond this issue,
but is related to it, #1917358.
https://bugs.launchpad.net/ubuntu-mate/+bug/1917358

There are other interactions with Bluetooth and PulseAudio,
making quite a mess of things.

I tried the suggestion in Comment #74 without any success.
I've tried a lot of combinations of things, discovering a
number of misbehaviors documented there.

My concern is, since this problem has been floating around
for 11 years+ now, it may be that no one is ever going to
fix it. It should at least be made explicit and clear that
headset and earphone such microphones do not work with
Ubuntu; I've wasted a couple of days fighting this, and
now probably need to fall back to a Windows system to use
for Zoom with headset.

Of course, that means Zoom, and phones through the computer
for Customer Relations, and Tech Support, and thousands of
other usages. But at least they should not waste their
time as I have, trying to set it up under Linux/Ubuntu.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.