Bug 491511 - Add GUI option to disable automatic Bluetooth profile selection (HSP/HFP and A2DP) for PipeWire/WirePlumber
Summary: Add GUI option to disable automatic Bluetooth profile selection (HSP/HFP and ...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Bluetooth in general (show other bugs)
Version: 6.2.4
Platform: Other Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 492359 493448 498129 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-08-10 07:34 UTC by Moritz
Modified: 2025-01-04 02:33 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz 2024-08-10 07:34:21 UTC
This is a feature request.

Weekly I stumble upon help requests where people are having the same problem: 
PipeWire/WirePlumber is automatically switching to the HSP/HFP bluetooth profile for their headset when the microphone activates for whatever reason. Most of the time this in unwanted behavior (as it absolutely destroys audio quality) - see e.g.: https://old.reddit.com/r/linux_gaming/comments/1e2bfzr/games_switching_bt_headset_codec_kdepipewire/ 

I propose adding a GUI option in the KDE System Settings (under either Sound or Bluetooth) that allows users to disable this automatic profile switching.

For reference, the current workaround involves modifying the following configuration file: https://wiki.archlinux.org/title/PipeWire#Automatic_profile_selection

> # /etc/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf (or ~/.config/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf)
> wireplumber.settings = {
>     bluetooth.autoswitch-to-headset-profile = false
> }
Comment 1 Nate Graham 2024-08-12 18:47:03 UTC
Is this not an issue in PipeWire or Wireplumber that should be fixed there? Have you tried requesting upstream that they change this setting?
Comment 2 Moritz 2024-08-12 20:13:12 UTC
> Is this not an issue in PipeWire or WirePlumber that should be fixed there?

I don't think so. The behavior is necessary for many scenarios, like making the microphone (on headsets) work during voice calls. However, I think that there are many users who want the ability to disable this "feature" - at least temporarily.

HSP/HFP  ->  basic voice communication between a headset and a mobile phone or computer (mono audio but supports microphone)
A2DP -> high-quality stereo audio streaming but doesn’t support microphone input, making it unsuitable for calls.

Adding an option within KDE's System Settings would provide a user-friendly way for people to manage this behavior without needing to modify system files. This would also make it easy to temporarily disable the automatic profile switching.

___

This (different) merge request https://invent.kde.org/plasma/plasma-pa/-/merge_requests/271 gave me the idea to make this feature request since it's also a GUI option which creates a wireplumber config file in the background.
Comment 3 Nate Graham 2024-08-19 22:58:02 UTC
Ok, makes sense.
Comment 4 Nate Graham 2024-08-30 16:30:04 UTC
*** Bug 492359 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2024-08-30 16:30:11 UTC
*** Bug 491813 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2024-09-23 17:27:53 UTC
*** Bug 493448 has been marked as a duplicate of this bug. ***
Comment 7 Chandradeep Dey 2024-09-23 18:08:17 UTC
I checked in `/usr/share/wireplumber/wireplumber.conf`. The option is true by default in Fedora. Was there a recent change in Plasma that overrides the default to false?
Comment 8 Moritz 2024-09-24 05:35:22 UTC
(In reply to Chandradeep Dey from comment #7)
> Was there a recent change in Plasma that overrides the default to false?
I don't think that there was such a change.
___

That's more or less the proposal of this "bug" report: adding an (easy to use) GUI option to override the default setting.
Comment 9 Harald Sitter 2024-10-03 23:37:30 UTC
I am debating if the target audience of the GUI would even know what a potential setting for this means.
Comment 10 Moritz 2024-10-29 07:34:51 UTC
(In reply to Harald Sitter from comment #9)
> I am debating if the target audience of the GUI would even know what a
> potential setting for this means.

Sorry for the late reply.

However, a GUI option would still be valuable. When users with this issue seek help on forums or Reddit, it would be much simpler to say:
"Check this checkbox in System Settings" rather than "Create this cryptic configuration file in a hidden directory". 
If the target audience doesn’t understand the setting, they are even less likely to know how to create a configuration file on their own.

Additionally, you could add a ⓘ icon next to the setting with a brief explanation, like:

    HSP/HFP: Two-way audio, for calls (microphone supported).
    A2DP: One-way audio, for music/media (no microphone support).

This is similar to the ⓘ icon used in Accessibility > Modifier Keys > Sticky Keys, for example.
Comment 11 Moritz 2024-11-25 17:39:03 UTC
For anyone encountering this issue in the future:

The ArchWiki now suggests disabling profile auto-switching using the following command:
> wpctl settings --save bluetooth.autoswitch-to-headset-profile false
https://wiki.archlinux.org/title/PipeWire#Automatic_profile_selection

This is less work than manually creating a folder/configuration file and easier to suggest to people facing this issue - although still not as nice as a GUI option.
Comment 12 Niklāvs Koļesņikovs 2024-12-21 21:07:37 UTC
This might be a good impetus to consider a KDE GUI that works similar to wpctl and pw-metadata and is able to operate on both WirePlumber and PipeWire settings. I'll note that this was considered way back but ultimately no one at PW or its external contributors were sufficiently interested (turns out the kinds of people who get low level audio have more in common with kernel than GUI development), so it's likely down to a desktop environment or a 3rd party to write such a GUI.
Comment 13 Nate Graham 2025-01-02 20:45:39 UTC
*** Bug 498129 has been marked as a duplicate of this bug. ***
Comment 14 girishankar7 2025-01-04 02:33:05 UTC
I recently asked for a similar GUI option for disabling HSP/HFP altogether and it has been merged with this issue.

I hope I figure out what's missing if it just happens to me an issue on my end. 
I'm on Fedora 41 KDE and disabling Automatic profile selection doesn't help for me. Applications that invoke mic, like Audacity or Vesktop, continue to switch the Headset profile from A2DP to HSP/HFP. Hence, I followed the Arch Wiki to disable HSP/HFP altogether and was requesting a GUI option be added for that. 
Reference: https://wiki.archlinux.org/title/Bluetooth_headset#Disable_PipeWire_HSP/HFP_profile

Now, I don't have any other mic source and I don't see any dummy mic listed for the mic port that's present in my PC.
I assume that for whoever it worked, they have a dummy mic. That's why disabling just the Automatic Profile Selection seems to work for them. Would love to know if that's the case.

Also, I did notice that disabling HSP/HFP of my BT headset also prevented it from auto-connecting the next time I power it on. So, there's that.
So, it's probably the right call by Nate to just fix the autoswitch, I guess.