I2S, Daisy Chain & Raspberry Recorder

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.

2 Likes
2 Likes

I’ve wanted to do something like this for a while - in fact, I have some I2S DAC boards coming from China right now, and I’ve been meaning to try Daisy-to-Daisy over I2S.

Excellent!

1 Like

Cool, good luck with your project @tele_player

When researching this demo, I was a bit discouraged by discussions like this one STICKY: The I2S thread. I2S works -it sounded very complex. In the end it turned out to be straight forward. That’s Raspberry PI and perhaps things have improved since then (?). With the Daisy everything went smoothly. After all: we know that the Daisy Patch works with an extra codec, right?