Bug 410574 - Bluetooth headset should use A2DP mode instead of HSP/HFP
Summary: Bluetooth headset should use A2DP mode instead of HSP/HFP
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma-pa
Classification: Plasma
Component: kcm (show other bugs)
Version: 5.16.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-04 13:59 UTC by Guo Yunhe
Modified: 2024-01-21 11:45 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guo Yunhe 2019-08-04 13:59:46 UTC
SUMMARY


STEPS TO REPRODUCE
1. Connect a Bluetooth headset.
2. Open Audio Device KCM, check the active configuration for the device.
3. Play some audio.

OBSERVED RESULT
Headset is connected in HSP/HFP mode. The sound quality is very bad.

EXPECTED RESULT
Headset should be connected in A2DP mode. Then sound quality becomes really good.

Maybe HSP/HFP shouldn't even be an option when A2DP is available.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20190730
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.60.0
Qt Version: 5.13.0
Kernel Version: 5.2.3-1-default
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 31.2 GiB


ADDITIONAL INFORMATION
Comment 1 stakanov.s 2019-08-04 19:29:02 UTC
I can confirm this as a longstanding bug in opensuse Leap (since 42.3) and I can confirm the same behavior in TW. 
It happens always when the connected headset has dual use, that is, when HSP/HFP mode is available in "phone mode" on the headset. 
Whenever the headset has a microphone that is, HSP/HFP will be forcefully selected and even a explicit choice of the desired profile in the "Plasma Settings multimedia" is not honored. 
Confirmed with SE-SL 761 BT (Senheiser), but also JBL GO external BT speaker (which again has a microphone).
Comment 2 Kai Uwe Broulik 2019-08-05 06:37:07 UTC
Isn't this PulseAudio's job to do?
Comment 3 stakanov.s 2019-08-05 06:51:52 UTC
This is a very good question. 
When BT is pairing, shouldn't it give pulseaudio the necessary info about what profiles are supported? 
I think this is all about being able to force the right profile. 
If it would be a pulseaudio thing, why is pulseaudio offering the A2DP mode and the HSP one and why, when A2DP is set, the headset does not honor it?
For my understanding, the request for change of profile does not arrive at hardware level. 
But I have no sufficient knowledge about the interaction between pulseaudio and BT. 
FYI: it may be of interest to know, that I have the very same problem on a phone (the Ulefone Armor mini) which is AFAIK linux based as firmware. Same same, it sees the headset, both profiles are indicated valid but only the HSP/HFP mode is selected. This makes me think that this is a BT related problem, more than pulseaudio. 
(I am aware that we shall not "guess" in bugreports, but I think the info might help to narrow down were to search. If not, well just disregard and take my apologies).
Comment 4 Kai Uwe Broulik 2019-08-05 06:54:48 UTC
When I paired my headset, it was using HFP but I could change it to A2DP in plasma-pa settings. No idea why it wouldn't allow A2DP for you.

(I was actually considering making a patch to show an indicator "you are using HFP instead of A2DP, sound quality may be reduced [Change]" but I think someone wanted to have a "proper solution" and then it just never went anywhere.)
Comment 5 stakanov.s 2019-08-05 07:03:45 UTC
In opensuse it allows to change but without effect or the BT stack afterwards hangs. 
I do not know what distribution do you use. Maybe the but should be opened with the distribution if you are not using opensuse and it works. Could you just let me know which distribution you use when it "works"? 
In reality plasma should recall the last setting for that hardware, and not switch back all the time to HSP, shouldn't it?
Comment 6 Nate Graham 2019-09-03 16:32:37 UTC
This is a PulseAudio bug, rather than a plasma-pa bug. See https://bugs.freedesktop.org/show_bug.cgi?id=103058 and https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules?id=85daab2725c8964d5e3d07089c4056435022d12e.

PulseAudio itself should take care of using the correct profile by default. We allow you to switch this in our software, but the real bug is that PA itself isn't setting the right default. Please report it at https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues

In fact it might actually be https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/669
Comment 7 Guo Yunhe 2019-09-03 18:28:29 UTC
I referred this bug in freedesktop.org and I think it is the same bug as https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/669
Comment 8 stakanov.s 2019-09-04 09:36:03 UTC
(In reply to Guo Yunhe from comment #7)
> I referred this bug in freedesktop.org and I think it is the same bug as
> https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/669

Thank you that you did take this on you and for investing the time. 
Highly appreciated. 
I guess by you name: 谢谢您!
Thank you.