I2S, HIFI Audio Pi Hats


Hi guys (Raxda and users),

Just got my RockPi4 up and running. I want to use it for Hifi DSP applications. I’m using the Ubuntu server image and installed ALSA and ALSA utils.

aplay -l gives me:
**** List of PLAYBACK Hardware Devices ****
card 0: rockchipes8316c [rockchip,es8316-codec], device 0: ff880000.i2s-ES8316 HiFi ES8316 HiFi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMICODEC [HDMI-CODEC], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

The first seems to be the onboard stereo CODEC. But I want to use my own Pi HAT with a much higher quality DAC on it. I’ve probed the I2S pins but they seem to be flatlines. So… the I2S pins on the 40 pin PI header are connected to I2S1? And the ESP CODEC is connected to I2S0?

See page 59 of the RK 3399 CODEC:




I can see in:

…that I2S0 is indeed hardwired to the ESP CODEC by Raxda, and the RK3399 datasheet claims I2S2 is hardwired to HDMI.

Now… how to add support for a HIFI HAT? Just add the device tree config in this big .dts file? Is there a way to easily recompile the RockPi4 kernel? @jack