Headphones microphone is not working
Solution 1
By design, the Bluetooth A2DP profile is unidirectional. We can not use a microphone unless our headset and adapter were capable to be paired simultaneously on both HSP, and A2DP protocol, or the application switches from A2DP to HSP on demand.
See also this enlightning discussion on bug #508522.
Solution 2
As it was already pointed out that A2DP is unidirectional, you have to switch to HSP profile every time you need to use the microphone. But doing so manually is not ideal, and unless application sets media.role=phone
for the stream (most non-voip apps don't), pulseaudio won't switch it automatically by default.
But starting from Pulseaudio v. 11.0, it's possible to automatically switch the profile whenever microphone access is requested by the application, but it's disabled by default.
- Find
load-module module-bluetooth-policy
line in/etc/pulse/default.pa
- Change it to
load-module module-bluetooth-policy auto_switch=2
Now pulseaudio will switch the device profile to HSP whenever microphone access is requested and change it back to A2DP after stream is closed.
You need to reload pulseaudio module after this for the changes to take effect:
pulseaudio -k
pulseaudio -D
Solution 3
I've just installed a solution for Bluetooth not selecting the mic on my Bose QC35 II on Ubuntu 16.04 LTS.
Since the internal mic on my Samsung laptop is too close to the fan audio sounds like inside an airplane for all participants in a videocall.
The solution is Blueman that adds functionality for Bluetooth.
Install it: sudo apt-get install blueman
I had to restart network-manager (sudo service network-manager restart
) after WiFi stopped working (could be unrelated, but hey better have it just in case).
I can now switch to Headeset Head Unit (HSP/HFP) and choose the headset mic in Sound settings
Still a bit of a hassle when it does not switch automatically (like Android does) but it's still better than being in a Jumbojet storage!
Solution 4
Along with the steps mentioned above by @Glub, that is,
- Find
load-module module-bluetooth-policy
line in/etc/pulse/default.pa
- Change it to
load-module module-bluetooth-policy auto_switch=2
I had to reset the Pulseaudio configs and restart the Pulseaudio module by
mv ~/.config/pulse/ ~/.config/pulse.old
systemctl --user restart pulseaudio
Solution 5
This - https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#index5h2 helped for me. Don't forget to install ofono and ofono-phonesim and start service.
The necessity to provide a modem to oFono makes the headset setup rather cumbersome. If you do not have a GSM/UMTS modem connected to your system (like in most desktop environments), you need a modem emulator. Unfortunately oFono does not allow to use a mobile (hfp modem, see below) as a modem to support headsets.
The best emulator choice is "phonesim" because there is a version that is maintained together with ofono. Most distributions contain a package ofono-phonesim or similar while the git version can be found at git://git.kernel.org/pub/scm/network/ofono/phonesim.git.
To set up phonesim, first create or edit the file phonesim.conf in /etc/ofono. It should contain the following lines:
[phonesim] Driver=phonesim Address=127.0.0.1 Port=12345
Restart oFono and check with list-modems if the phonesim modem was found. Start phonesim with
ofono-phonesim -p 12345 /usr/share/phonesim/default.xml&
The paths to phonesim.conf and default.xml might be different if you compiled ofono and/or phonesim from source. Now you can enable the modem either by using the enable-modem script or by issuing the following command:
dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"
list-modems should show that the modem is powered and online. If you want to play with the modem emulator, you can add the -gui option to the phonesim command. Then a GUI will pop up as soon as you enable the modem.
Once the modem is set up properly, you can connect your headset and the "Headset Head Unit (HSP/HFP)" profile should be available in pulseaudio.
Related videos on Youtube
Aleksi Kinnunen
Updated on September 18, 2022Comments
-
Aleksi Kinnunen over 1 year
I'm trying to use my headphones with my Ubuntu 13.10. My headphones are Nokia BH-905i, which can be connected via Bluetooth or green+pink wires.
If I use bluetooth, voice quality is terrible or microphone doesn't work. If I try to choose "Headset" option from In and Out tabs in Sound Settings, they're disabling each together.
In Out tab, I'm using "High sound quality A2DP", because it betters voice quality.
How could I get my microphone working? Sound out works fine.
-
Takkat over 6 yearsThe question was on getting the microphone to work in A2DP mode, which AFAIK still is not possible. Using a mic in HFP mode is rather trivial and should work OOB without any additional applications needed. If you needed blueman in addition to get it working there may be an issue with your audio setup in the fist place.
-
Valross.nu over 6 yearsWell Takkat, it's a known problem with using BT mic in headphones on Ubuntu so it's not an audio setup for the mic problem... And sorry I accidentially downvoted your answer yesterday, could not reverse it. =(
-
Takkat over 6 yearsen.wikipedia.org/wiki/… - it is inherent to the Bluetooth profile definition. Nothing we or any other OS could do to overcome this - but you are quite correct in that issues with HFP-mode sadly still exist.
-
Valross.nu over 6 yearsI disagree here because most OS do make the switch between the two protocols without user interaction. As pointed out Android or Windows or ios switches automatically, where Ubuntu does not... So there is a solution in place for automation between the two...
-
kommradHomer about 4 yearson Ubuntu 18.04 , i get the error "Failed to change profile to headset_head_unit" when i try to switch to HFP
-
xmar almost 4 yearsWhen trying to set HSP/HPF, I get the following error:
Failed to change profile to headset_head_unit
shown in the footer of the Blueman. Any hint here? -
Rohit Karadkar almost 4 yearsThank you. My sony SBH24 mic only works on HSP mode. This helps in auto-switching.
-
Arxeiss over 3 yearsHow you were able to install phonesim? I'm trying to do it with
apt-get
on my Ubuntu 20.04 but I'm not successful... -
IvanTheFirst over 3 yearsI installed this on Mint 19 based on Ubuntu 18.04 LTS.
-
Serhii Polishchuk over 3 yearsMy Marshall MID works now! Thank you!
-
Fabio Filho over 3 yearsThis didn't work for my JBL LIVE650BTNC, do you know the reason?
-
Ufos over 3 yearsseems to have locked my headphones into a HSP/HFP mode. But at least it now uses the mic consistently.
-
Sephethus over 3 yearsDidn't work for airpods pro. Ugh.
-
user1366476 over 3 yearsThis is really frustrating, why does linux not support a2dp w/ microphones like android?
-
Yogi Katba over 3 yearsGetting
E: [pulseaudio] main.c: Daemon startup failed.
error when triedpulseaudio -D
-
Mayur Dangar almost 3 years@YogiKatba I have also got the same error, now not able to hear anything.
-
Deep Dalsania over 2 yearsI also got the same error. Anything from your side @Glub
-
backslashN over 2 yearsTry
systemctl --user restart pulseaudio
if Daemon startup fails. -
Nilesh over 2 yearsWhen we connect the same device to the mobile phone, we can listen to high-quality audio(probably A2DP) even while using a mic. Then how come its limitation of A2DP and not ubuntu?
-
Peter over 2 years
systemctl --user restart pulseaudio
fails withFailed to restart pulseaudio.service: Unit pulseaudio.service is masked.