I have a phone connected to my Ubuntu 21.10 PC via bluetooth, sharing phone calls and media audio. I basically want to use the PC as a headset with access to two-way audio during calls.
Media from the phone is played on the laptop speakers as expected. Blueman shows that the High Fidelity Capture (A2DP Source) audio profile is selected.
During a call the profile switches to Headset Audio Gateway (HSP). I do get two-way audio:
- Sounds played on the PC are heard on the call.
- Speakers on the call can be recorded on the PC. HOWEVER: this input gets echoed back to the callers.
It seems like call input is treated just like media input: it's played back on whatever output channel is set up. How can I prevent this?
I did try Linux HFP from this answer, but the project is very old and getting it to compile and run on a modern system isn't easy.
Found a way to disable loopback manually during a call. From the PulseAudio wiki:
So just unloading the module during a call gets rid of the loop effect:
This needs to be done every time. It's possible to prevent it from loading in the first place by passing the
hfgw
argument tomodule-bluetooth-policy
in/etc/pulse/default.pa
:Unfortunately this also disables playback of media audio. Is there a way to only do it for calls?