How to include Pulseaudio and dnsmasq in the kernel

Colibri iMX8QXP 2GB WB IT V1.0D
Iris carrier board V1.1B
Linux BSP 5.4

We are trying to provide wifi internet access and voice calls to clients in a noisy environment using the iMX8 as a wifi access point and the ethernet connected to a DHCP server coming from a modem. The modem can also provide voice calls, so we want to route the call to a bluetooth headset that uses noise cancelling using Pulseaudio and BlueZ. We have got a demo up and running with a Raspberry Pi 4 but that was easier as both Pulseaudio and dnsmasq are included in the kernel. Is there an image that has these 2 modules or is there steps to include them in the kernel so we can test on the iMX8?


Hi @robple11 , you can add dnsmasq according to this ticket. Pulseaudio is included in our multimedia image.

Hi ben,

I was able to compile the multimedia image and like you said in the other post to include dnsmasq just modify the local.conf, that worked great.
I installed my compiled kernel and dnsmasq is there and working but PulseAudio doesnt seem to be installed properly, all I can see is /etc/pulse/client.conf and a pulseaudio library file, there doesnt seem to be any binaries or daemons to run. On the Raspberry Pi 4 I could run the pulseaudio daemon and configure the sinks and sources from the command line to send/receive audio to/from a bluetooth headset.

Hi @robple11 , the multimedia image doesn’t come with a demo binary for PulseAudio. You may need to compile your PulseAudio application. How do you test on Pi4? For example, what is the command line?

It was all just on the command line:
To connect the bluetooth headset I used
“bluetoothctl connect macaddr”

To list cards I used:
“pacmd list cards”

To set headset profile:
“pacmd set-card-profile 3 headset_head_unit”

To loopback speaker to mic:
“pactl load-module module-loopback sink=bluez_sink.macaddr.headset_head_unit source=bluez_source.macaddr.headset_head_unit”
macaddr= F4_45_56…etc of the bluetooth device

Then I plugged in a usb device providing speaker and mic and was able to cross that with the bluetooth headset using the pactl commands.

Thats as far as I wanted to go until I could reproduce something similar on the iMX8

Hi @robple11 , on multimedia bsp, you can use bluez-alsa instead of pulseaudio to make BT HFP work. The bluez-alsa recipe from Yocto Project needs to be replaced by this one. After the new image is built and installed, add bluealsa policy to /etc/dbus-1/system.d/bluetooth.conf on the device.

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

Modify /lib/systemd/system/bluez-alsa.service and reboot.

+ExecStart=/usr/bin/bluealsa -p hfp-ofono -p a2dp-sink -p a2dp-source


check if the bluetooth device is either hardware or software blocked:

# rfkill list
0: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no

If it is, unblock it.

# rfkill unblock 1
# rfkill list
0: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

Use bluetoothctl to discover and connect the Bluetooth device by its MAC address.

# bluetoothctl
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:E9:3A:D6:4F:30 Discovering: yes
[bluetooth]# devices
[NEW] Device F4:4E:FD:DE:4A:59 XMFHZ02
[bluetooth]# connect F4:4E:FD:DE:4A:59
Attempting to connect to F4:4E:FD:DE:4A:59
[CHG] Device F4:4E:FD:DE:4A:59 Connected: yes
[CHG] Device F4:4E:FD:DE:4A:59 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device F4:4E:FD:DE:4A:59 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device F4:4E:FD:DE:4A:59 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device F4:4E:FD:DE:4A:59 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device F4:4E:FD:DE:4A:59 ServicesResolved: yes
Request confirmation
[agent] Confirm passkey 220288 (yes/no): yes
[CHG] Device F4:4E:FD:DE:4A:59 Paired: yes
Connection successful
[XMFHZ02]# exit

Now you will find the audio device and play the sound file.

# bluealsa-aplay -L
    XMFHZ02, audio-card, playback
    A2DP (SBC): S16_LE 2 channels 48000 Hz
# aplay -D bluealsa:SRV=org.bluealsa,DEV=F4:4E:FD:DE:4A:59,PROFILE=a2dp ~/sound/Gong.

If you would like to loop devices, alsaloop is the tool. This is the example.

Thanks, I will check it out and let you know how I go!