Poll FD initialization failed - alsaloop - bluealsa

I am sending an audio stream (youtube, spotify, facebook, etc) from a bluetooth device to the imx8m and playing it on the speakers that are connected to the audio jack. The problem is that after a while (2 or 3 minutes, sometimes less) the audio stream is cut due to an error with the PCM loopback.
To manage the audio stream I use the following command:

alsaloop -C bluealsa:DEV=<BT-addr_device>,PROFILE=a2dp -P plughw:0,0 -r 48000 -c 2 -f s32_le --buffer=500 --sync=simple -t 300000 -T 4

and the error that appears after a while is:

Poll FD initialization failed.

The testbench schematic is as follows

I am using the minimum reference image BSP 6.3.0 on the Verdin iMX8MM.

Regards,
Julián

Hi @jbruno !

Thanks for your question!

When we tested the commands shown in the article How to Setup Bluetooth Audio Profiles (Linux) | Toradex Developer Center you are referencing, we indeed didn’t keep the system playing that long.

Have you tried using the exact same parameters as we have in our documentation?

Have you tried to fiddle with the buffer, sync and thread parameters? I would try to go this way.

Also, you have the -T 4 there. Can you elaborate on why it is there? Is this the only alsaloop thread you are executing?

And could you please share the output of tdx-info (reference: Getting Device Information with Tdx-Info | Toradex Developer Center)?

Best regards,

Hi @henrique.tx ,
I tried the same parameters as in your documentation and it gave me the same error. I started to vary the parameters: buffer, sync, tlatenc and thread, and the results improved but after a while the audio stream stopped indicating “Poll FD initialization failed”.

Occasionally I have noticed that the phone experiences disconnections from the bluetooth interface with the imx8mm but this is not so common but it is a concern.

All these tests are performed in a controlled environment, with a distance of less than 1 meter, with two approved antennas connected to the BT module of the Verdin and an iPhone.

I don’t have another alsaloop active, I was just testing different values for the thread parameter.

My tdx-info output:

Software summary
#------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.77-6.3.0-devel+git.ddc6ca4d76ea #1 SMP PREEMPT Thu Jun 29 10:14:22 UTC 2023
Kernel command line: root=PARTUUID=8a41bcca-02 ro rootwait console=tty1 console=ttymxc0,115200 consoleblank=0 earlycon
Distro name: NAME=“TDX Wayland with XWayland”
Distro version: VERSION_ID=6.3.0-devel-20230801092402-build.0
Hostname: verdin-imx8mm-06902571
#------------------------------------------------------------
Hardware info
#------------------------------------------------------------
HW model: Toradex Verdin iMX8M Mini WB on Dahlia Board
Toradex version: 0055 V1.1B
Serial number: 06902571
Processor arch: aarch64
#------------------------------------------------------------

Best regards,
Julián

Hi @jbruno !

I just tested the use case smartphone Android 13 --(Bluetooth)--> Verdin iMX8M Mini --(audio cable)--> phone and I could listen uninterruptedly and without problems to a 9min+ soundtrack from Youtube Music without issue (specifically this one :slight_smile: ).

This is the tdx-info output of my setup:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.77-6.4.0-devel+git.ddc6ca4d76ea #1 SMP PREEMPT Thu Jun 29 10:14:22 UTC 2023
Kernel command line:      root=PARTUUID=168d4aa8-02 ro rootwait console=tty1 console=ttymxc0,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.4.0-devel-20230829164534-build.0
Hostname:                 verdin-imx8mm-06827728
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Mini WB on Dahlia Board
Toradex version:          0055 V1.1A
Serial number:            06827728
Processor arch:           aarch64
------------------------------------------------------------

Here is my alsaloop command line:

root@verdin-imx8mp-06849036:~# cat alsaloop.sh
BTADDR=<smartphone-bluetooth-address>

alsaloop -C bluealsa:DEV=${BTADDR},PROFILE=a2dp -P plughw:0,0 -r 48000 -c 2 -f s32_le --sync=simple -t 200000 -T 1

The test was done using a Dahlia Carrier Board V1.1C and a phone connected to Dahlia’s X14 port.

So I could not reproduce the issue.

Therefore I would like to ask you: Could you please double-check if you went through all the necessary customization steps from How to Setup Bluetooth Audio Profiles (Linux) | Toradex Developer Center?

Also:

What do you mean by loop back here?

Best regards,

PS: I kept listening to several songs while writing this answer with no issues using the setup described here.