BBAI: SGTL5000 I2S Integration with MCASP and ALSA


I am currently trying to setup audio ouput via an SGTL5000 connected to a Beaglebone AI (AM5729). I have verified the device is detected as such:

debian@beaglebone:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sgtl5000output [sgtl5000_output], device 0: davinci-mcasp.0-sgtl5000 sgtl5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

However, when I go to run an aplay after changing the default alsa device to card 1 the output is as follows.

debian@beaglebone:~$ aplay -D default -c2 --dump-hw-params sample.wav
Playing WAVE ‘sample.wav’ : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1310: Broken configuration for this PCM: no configurations available

When I run this command I can see mcasp ACLKX signal, however there is nothing on the data line (as expected with the above error).

The driver does seem to be initialised correctly:

debian@beaglebone:~$ dmesg | grep sgtl
[ 1.420934] sgtl5000 2-000a: sgtl5000 revision 0x11
[ 1.449815] asoc-simple-card sound: sgtl5000 ↔ 48460000.mcasp mapping ok

Any assistance would be greatly appreciated

Changing the device tree configuration to using codec as frame and bit clock master resolved this issue and I now see data coming out. Ideally I would like it the other way around though. Has anyone got some insight on this.

1 Like