I’ve tinkered a bit with the I2S code from Daisy Patch and come up with three demos, which I find kind-of-useful:
#1 Daisy Seed + External Codec. Or, rather, a DAC in my case. So, output only.
#2 Daisy-daisy chain: two Daisies connected with I2S.
#3 Raspberry Recorder: capture digital output from Daisy (or send digital audio from Raspberry PI to Daisy, or both).
The I2S code is taken from Daisy Patch. It’s modified such that the Daisy can either generate clocks or sync to external clocks. For the audio callback to work, it’s gotta be the same sampling frequency etc as for the on-board codec.
The same demo program is used in all three cases and for both Daisies in the daisy chain. Apart from the I2S stuff, it’s just a simple tone generator and a delay line. Digital In (SAI2 SD B, pin 32) goes to the delay line, it’s mixed with tone-generator output and goes to Digital Out (SAI2 SD A, pin 33).
I used this breakout board from Adafruit (DAC+speaker amp). My initial set-up on Raspberry PI followed these instructions. At this point there was only I2S output from the RPI. Either this or this device tree overlay gets you a capture device as well, so that you can record. One makes the RPI generate clocks, the other one makes RPI sync to clocks. The Daisy Seed should take the opposite role.
Hope you find it fun and useful. I’ll post a demo on youtube.