Bluetooth HFP echo on receiver side

When making a bluetooth hands free phone call, the person on the receiving end of the call hears an echo (or loopback) of their own voice with an aprox 1 second delay. The feedback IS NOT caused by a speaker feeding back into a microphone.

I was using this Toradex article as a guide How to Setup Bluetooth Audio Profiles (Linux) | Toradex Developer Center

Environment info:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.129-6.4.0-devel+git.67c3153d20ff #1 SMP PREEMPT Wed Sep 27 12:30:36 UTC 2023
Kernel command line:      root=PARTUUID=72b5ae8b-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.4.0-devel-20231220205908-build.0
Hostname:                 verdin-imx8mp-15006329
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1A
Serial number:            15006329
Processor arch:           aarch64
------------------------------------------------------------

Bluez v5.65
BlueALSA v16.1

Hey @david.bouthillier,

For general checking: Can you switched out the speaker/microphone to validate the issue most likely relating to software? Also can you share how you know it’s not related to speaker->microphone feedback?

Can you describe your hardware setup, and what software steps you are taking to produce this event?

-Eric

I have a Verdin board with an IMX8MP. I’m using headphones for the audio (completely sealed), and the device has an integrated microphone. I used bluetoothctl to connect my iPhone. I initiate a phone call on my iPhone to another phone. I then ran the following BlueALSA scritp (from the tutorial).

alsaloop -g /dev/stdin <<EOF
-C bluealsa:SRV=org.bluealsa,DEV=A0:56:F3:97:94:4C,PROFILE=sco -P plughw:0 -r 8000 -c 2 -f s16_le -n -t 40000 -T 1
-C plughw:0 -P bluealsa:SRV=org.bluealsa,DEV=A0:56:F3:97:94:4C,PROFILE=sco -r 8000 -c 2 -f s16_le -n -t 40000 -T 2
EOF

On my end (bluetooth connect through embedded device), I can hear the person on the other phone perfectly, and they can hear me perfectly.

However, on the receiver end, they hear their voice repeated back to them with an aprox 1 second delay. On my end, I never hear any feedback, echo, or loopback.

This is the issue I cannot seem to figure out.

Hey @david.bouthillier,

Just wanted to check in and report that I will try and recreate your experience.

-Eric

1 Like

Hey @david.bouthillier,

Looking through your old post, you stated that you updated bluealsa to v4.1.1. Can you confirm you did this? I ran into some gdbus-codegen issues when attempting.

-Eric

Yes, we upgraded to v4.1.1-90-gc18e812

I’m not on the build team, so I’m not exactly sure how it was done. We upgraded because there was a bug in the old version that caused a crash for us.

Hey @david.bouthillier,

Unfortunately I couldn’t recreate the error. I will escalate the topic on our end, that most likely won’t provide any immediate solution. I would recommend reaching out to the bluez-alsa community on their
git-hub link and maybe they can provide specific guidance.

-Eric

Ok, keep us updated. This is critical for us to resolve.

I have already reached out to the Blue ALSA folks, the PulseAudio team, and the Bluez community. I did not have any success resolving the issue.

Hey @david.bouthillier,

I’ve managed to update to v4.1.1, requirement was to include glib-2.0-native to the .bb files depends.

Are you able to provide a step by step process of settings/actions taken so I can mimic the results and share with my team? (as best you can)

-Eric

Yes, I’ll try my best.

  • Start with the base multimedia reference image. Disable the QT demo app.
  • Follow this How-To guide for Bluetooth HFP. How to Setup Bluetooth Audio Profiles (Linux) | Toradex Developer Center
  • Add the oFono profile to bluealsa by adding -p hfp-ofono in the ExecStart command in /lib/systemd/system/bluealsa.service
  • Connect a microphone and headset to the board (I’m using a headset that has 3.5mm mic and audio connector and using the green and pink ports on the Verdin dev board)
  • Connect to a phone using bluetoothctl
  • Initiate a call on the phone
  • Run the alsaloop_call.sh script created in the how-to guide right after you start the call.

At this point, you should be able to have a phone conversation through the headset. The person on the other end will hear their voice repeated back to them.

Please feel free to ask any questions regarding settings on my board if you run into issues.

Hey @david.bouthillier,

Can you share your alsaloop_call.sh? And when you run your shell command, can you share the terminal output throughout a call?

-Eric

This is my script. There really isn’t anything output from the script.

alsaloop -g /dev/stdin <<EOF
-C bluealsa:SRV=org.bluealsa,DEV=A0:56:F3:97:94:4C,PROFILE=sco -P plughw:0 -r 8000 -c 2 -f s16_le -n -t 40000 -T 1
-C plughw:0 -P bluealsa:SRV=org.bluealsa,DEV=A0:56:F3:97:94:4C,PROFILE=sco -r 8000 -c 2 -f s16_le -n -t 40000 -T 2
EOF

Hey @david.bouthillier,

Thanks for the added information. I am waiting on our internal team and our escalation process. I will report back as soon as I have more info.

-Eric