Score:0

bluetooth: call audio loop when paired with phone

ru flag

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.

Score:0
ru flag

Found a way to disable loopback manually during a call. From the PulseAudio wiki:

When PulseAudio is acting as a headset... module-bluetooth-policy will also load module-loopback instances to loop the audio from bluetooth to the local speakers and microphone.

So just unloading the module during a call gets rid of the loop effect:

pactl unload-module module-loopback

This needs to be done every time. It's possible to prevent it from loading in the first place by passing the hfgw argument to module-bluetooth-policy in /etc/pulse/default.pa:

load-module module-bluetooth-policy hfgw=false

Unfortunately this also disables playback of media audio. Is there a way to only do it for calls?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.