I2S slave mode

Status
Not open for further replies.

damo1976

Well-known member
Anyone got any documentation or can point me in the correct direction to check out the relevant I2S slave library functions. I need to connect a teensy 4 in slave mode to another device thats running in master mode (of course) . I also want to test this by connecting 2 teensy 4 devices together and pass audio between them both using I2S.

Any leads or help much appreciated. I'm new at I2S.

Cheers
 
As with almost everything in the audio library, detailed documentation is in the design tool right-side panel.

https://www.pjrc.com/teensy/gui/?info=AudioInputI2Sslave

One difficult issue you will face is use of the slave mode input or output causes the entire audio library to run at the speed of the external LRCLK signal. So you generally can't use any of the master mode I/O, because they must run in sync with Teensy's clock. The design tool is aware of these limitation and will show little error icons when you drag 2 or more incompatible inputs/output onto the canvas.
 
Thanks for the reply Paul.

Is it possible to easily change to 48k and block size of 64 to halve the latency? Is it possible to get the teensy to generate an Mclock based on the BCLK ? Any detailed help would be greatly appreciated and save me a great deal of time as the learning curve is already incredibly daunting.. cheers.
 
When Teensy runs in I2S slave mode, the external I2S device is in control of the sample rate.

You can edit the block size in AudioStream.h. Most of the audio library automatically adapts, but some parts require 128 samples.

No, there isn't any way (as far as I know) to generate a MCLK signal from the external device's BCLK. For that, you would need a phase locked loop. All of the PLLs in this chip are designed to run from the 24 MHz crystal. Even if you could somehow route BCLK to them, they're designed to lock to much higher input frequency.
 
Status
Not open for further replies.
Back
Top