Apalis i.MX6 i2s communication with bluetooth

We are trying to integrate a bluetooth module over i2s & hci uart with apalis imx6q. We are able to get linux to pair and connect to a bluetooth enabled speaker. We are also able to transfer data using bluetooth over hci uart to a smart phone.

However we are unable to play audio over i2s. The i2s lines do not show any activity while the audio is being played. There are no errors displayed. The linux commands we used are

root@apalis-imx6:~# hciattach /dev/ttymxc1 texas
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_6.7.16.bts
Loaded BTS script version 1
texas: changing baud rate to 115200, flow control to 1
[ 1582.117152] Bluetooth: HCI UART driver ver 2.2
[ 1582.121638] Bluetooth: HCILL protocol initialized
[ 1582.443282] Bluetooth: RFCOMM TTY layer initialized
[ 1582.448298] Bluetooth: RFCOMM socket layer initialized
[ 1582.453543] Bluetooth: RFCOMM ver 1.11
Device setup complete

root@apalis-imx6:~# bluetoothctl -a
[NEW] Controller B0:B4:48:6C:8F:43 apalis-imx6 [default]
Agent registered
[bluetooth]# default-agent on
Default agent request successful
[bluetooth]# scan on
Discovery started
[CHG] Controller B0:B4:48:6C:8F:43 Discovering: yes
[NEW] Device 0C:A6:94:81:8B:01 JBL Flip 2
[bluetooth]# pair 0C:A6:94:81:8B:01
Attempting to pair with 0C:A6:94:81:8B:01
[CHG] Device 0C:A6:94:81:8B:01 Connected: yes
[CHG] Device 0C:A6:94:81:8B:01 UUIDs:
[CHG] Device 0C:A6:94:81:8B:01 Paired: yes
Pairing successful
[CHG] Device 0C:A6:94:81:8B:01 Connected: no
[CHG] Device 0C:A6:94:81:8B:01 RSSI: -55
[bluetooth]# connect 0C:A6:94:81:8B:01
Attempting to connect to 0C:A6:94:81:8B:01
[CHG] Device 0C:A6:94:81:8B:01 Connected: yes

root@apalis-imx6:~# pacmd play-file /home/root/Dusty1-break1.wav 2

There is no error at this point and there is no sound coming from the speaker. We have been able to play audio on the same speaker using a bluetooth module connected via USB lines. However our module is connected using I2S & hci lines.

Please find the hardware connections attached between imx6 and the bluetooth module via level translators.

On the software side of things, is the audio playback working without using PulseAudio? Does audio playback work by itself with ALSA aplay after specifying the concerned audio sink in question? We have no experience using Pulseaudio on an Embedded system. You might find this NXP community post helpful.

Well, for the digital audio aka DAP1 pins side of things you will have to define resp. use case in the device tree as well. By default we only define the on-module SGTL5000 audio codec.