HFP (Hands-Free Profile) not working on Verdin iMX8MP with Mallow Carrier Board

Hello Toradex community,

I am using a Verdin iMX8MP with the Mallow Carrier Board running BSP 6 Yocto reference Multimedia image.

My goal is to enable Bluetooth HFP (Hands-Free Profile) so I can record audio from a Bluetooth headset and play audio through it.

Currently:

  • I am using PulseAudio.

  • A2DP works successfully for audio output.

  • However, when I switch to Hands-Free Profile, there is no input or output available.

I would like guidance on:

  • How to properly enable HFP on this setup.

  • Any missing packages, configuration, or patches needed for the iMX8MP Multimedia BSP.

Thank you in advance for your help!

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I can help you enable HFP (Hands-Free Profile) for Bluetooth on your Verdin iMX8MP. The issue is that you’re using PulseAudio, but for HFP support on Toradex BSP, you need to use BlueALSA with oFono integration instead(1).

Key Requirements for HFP Support

For HFP to work properly, you need(1):

  • Hands-Free Profile (HFP) handled by oFono to use the module as a headset on a call
  • BlueALSA backend instead of PulseAudio
  • Since BlueALSA does not implement any call features of HFP, oFono support is needed(1)

Solution: Switch from PulseAudio to BlueALSA with oFono

1. Enable oFono in the BlueALSA Recipe

You’ll need to modify the BlueALSA recipe to include oFono support. In your Yocto build, update the bluealsa_git.bb recipe(2):

-PACKAGECONFIG ??= "aplay cli hcitop ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG ??= "aplay cli hcitop ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ofono"

(2)

2. Rebuild Your Image

After modifying the recipe, rebuild your image to include oFono support in BlueALSA(1).

3. Configure BlueALSA Service

Restart the BlueALSA service and grant access to it(1):

# systemctl restart bluealsa.service

(1)

Then edit the D-Bus policy file(1):

+    <policy user="bluealsa">
+        <allow send_destination="org.bluez"/>
+    </policy>

(1)

4. Verify BlueALSA Service Status

Check that the BlueALSA service is running with the correct profiles(1):

# systemctl status bluealsa.service

(1)

You should see something like this indicating both A2DP and HFP profiles are active(1):

● bluealsa.service - BlueALSA service
     Loaded: loaded (/lib/systemd/system/bluealsa.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-05-16 13:40:04 UTC; 52min ago
       Docs: man:bluealsa(8)
   Main PID: 758 (bluealsa)
      Tasks: 4 (limit: 1670)
     Memory: 956.0K
     CGroup: /system.slice/bluealsa.service
             └─ 758 /usr/bin/bluealsa -p a2dp-source -p a2dp-sink

(1)

5. Check Available Bluetooth Audio Devices

After connecting your Bluetooth headset, verify the available profiles(1):

# bluealsa-aplay -L

(1)

You should see both A2DP and SCO (HFP) profiles listed(1):

bluealsa:SRV=org.bluealsa,DEV=08:CC:27:00:C4:01,PROFILE=a2dp
    motorola one hyper, trusted phone, capture
    A2DP (SBC): S16_LE 2 channels 44100 Hz
bluealsa:SRV=org.bluealsa,DEV=08:CC:27:00:C4:01,PROFILE=sco
    motorola one hyper, trusted phone, playback
   SCO (CVSD): S16_LE 1 channel 8000 Hz
bluealsa:SRV=org.bluealsa,DEV=08:CC:27:00:C4:01,PROFILE=sco
    motorola one hyper, trusted phone, capture
    SCO (CVSD): S16_LE 1 channel 8000 Hz

(1)

Hardware Considerations for Verdin iMX8MP

Your Verdin iMX8MP module includes the AW-CM276NF Wi-Fi/Bluetooth module with dedicated I2S interface for Bluetooth audio(3). The hardware supports the necessary interfaces for HFP functionality.

Why BlueALSA Instead of PulseAudio

BlueALSA is specifically designed to combine the ALSA API with the BlueZ Linux Bluetooth protocol stack, allowing the use of audio devices connected via Bluetooth without needing PipeWire or PulseAudio(1). For HFP support, the oFono integration is essential since BlueALSA alone doesn’t implement call features(1).

This approach should resolve your HFP input/output issues and provide proper hands-free functionality on your Verdin iMX8MP setup.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hello,

Thanks for your guidance! I am following the Toradex Bluetooth Audio guide and switched from PulseAudio to BlueALSA with oFono.

Here is my current setup and logs:

[bluetooth]# connect 84:AC:60:25:CD:3A
Connection successful

[QCY T13 ANC2]# info 84:AC:60:25:CD:3A
Connected: yes
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
...
root@verdin-imx8mp-15605128:~# bluealsa-aplay -L
bluealsa:SRV=org.bluealsa,DEV=84:AC:60:25:CD:3A,PROFILE=a2dp
    QCY T13 ANC2, trusted audio-headset, playback
    A2DP (SBC): S16_LE 2 channels 48000 Hz

root@verdin-imx8mp-15605128:~# systemctl status bluealsa
● bluealsa.service - BlueALSA service
     Active: active (running)
     Main PID: 687
     Exec: /usr/bin/bluealsa -p a2dp-source -p a2dp-sink -p hfp-ofono

root@verdin-imx8mp-15605128:~# systemctl status ofono    
● ofono.service - Telephony service
     Active: active (running)

Issue:

  • BlueALSA and oFono are running with HFP support (-p hfp-ofono).

  • My headset shows the Handsfree UUID.

  • bluealsa-aplay -L only lists A2DP, no SCO/HFP devices.

It seems that HFP/SCO is still not available even though the services are active.

Could you advise on why the SCO/HFP profile is not showing and how to properly enable input/output for hands-free audio on this BSP?

Thank you!

Troubleshooting HFP/SCO Profile Availability

Based on your logs, BlueALSA is running with the correct HFP-oFono configuration, but the SCO profile isn’t appearing. Here are the key steps to resolve this:

1. Verify BlueALSA Service Configuration

Your BlueALSA service shows it’s running with -p hfp-ofono, but let’s verify the complete systemd configuration. The documentation shows that the BlueALSA arguments should be configured properly(1):

SYSTEMD_BLUEALSA_ARGS ?= "-p a2dp-source -p a2dp-sink -p hfp-ofono"

(1)

2. Check D-Bus Policy Configuration

Ensure you’ve added the D-Bus policy configuration for BlueALSA access(2). Edit /etc/dbus-1/system.d/bluetooth.conf:

...
+    <policy user="bluealsa">
+        <allow send_destination="org.bluez"/>
+    </policy>
 </busconfig>

(2)

After making this change, restart the bluealsa service again(2):

# systemctl restart bluealsa.service

(2)

3. Verify Bluetooth Device Capabilities

Check if your headset properly supports both “Phone calls” and “Media audio” capabilities. The documentation shows that both functionalities must be enabled for HFP to work(2). When you connect your Bluetooth device, you should see both capabilities enabled.

4. Check for SCO Profile After Audio Activity

Sometimes the SCO profile only appears after there’s actual audio activity or a call simulation. Try checking the available devices again after:

# bluealsa-aplay -l

(2)

This command might show different output than bluealsa-aplay -L, displaying both playback and capture devices(2):

**** List of PLAYBACK Bluetooth Devices ****
hci0: 08:CC:27:00:C4:01 [motorola one hyper], trusted phone
  SCO (CVSD): S16_LE 1 channel 8000 Hz
**** List of CAPTURE Bluetooth Devices ****
hci0: 08:CC:27:00:C4:01 [motorola one hyper], trusted phone
  A2DP (SBC): S16_LE 2 channels 44100 Hz
  SCO (CVSD): S16_LE 1 channel 8000 Hz

(2)

5. Verify oFono Integration

Check if oFono is properly detecting your Bluetooth device:

# systemctl status ofono

Make sure oFono can communicate with BlueZ and your headset for HFP functionality.

6. Restart Both Services in Correct Order

Try restarting the services in the proper sequence:

# systemctl stop bluealsa.service
# systemctl stop ofono.service
# systemctl start ofono.service
# systemctl start bluealsa.service

The issue you’re experiencing is common when the HFP profile negotiation hasn’t completed properly between oFono, BlueALSA, and your headset. The SCO profile should appear once the hands-free profile is fully established.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.