ADAU1466 with Raspberry Pi I2S

I have ADAU1466 board with external ADC/DAC converters based on PCM1802/PCM5102. Raspberry Pi used for control adau via i2c. But - I found some solutions for work with audio on raspberry pi via i2s (for example with codecs or ADC/DAC). 

But - Can I connect adau board  with some project  via available i2s buses to Raspberry Pi via I2S as "External Effect Loop"? In adau project I just need to add a in/out for corresponded buses, but... How to connect rasbperry pi for this SDATA input/output? Raspberry pi is a Master for I2C communication with adau, I need to enable rasperry slave for I2S? What about clocking? how it need to be configurated, if I want get sound from adau and then send it back? 

  • Hello Efremoff,

    Are you trying to get audio back and forth between the pi and the DSP using I2S? You must use I2S. You cannot do it using I2C communications bus. 

    Then for I2S it is a matter of how either you want to setup the clocking or sometimes the hardware demands a certain setup. The DSP can be setup as a clock slave or master and can be setup for standard I2S or several different TDM modes of operation. I do not know what the Raspberry Pi configuration limitations are. I think it can only do I2S. 

    How flexible is the clocking on the Rapsberry Pi? Does it have to be a master? Where is the master clock coming from? There are many of these system clocking questions. Then finally, what sample rate will you be using?

    Dave T

  • I use a Raspberry Pi Zero 2 W as control interface for ADAU1466 with PCM1802/PCM5201 converters. Adau connected to RPi via i2c and generally this setup works correct. 

    But - I think about realize some additional audio functions using Raspberry with i2s audio. Sdata-In0 and Sdata-In1 used for two stereo PCM1802,  in2 and in3 is free. Sdata-out0 and Sdata-out1 used for two stereo PCM5102. Out2 and Out3 is free. Connected Adc and Dac get mclk from adau clock out.

    For ex. I can write a different reverb or delay effect on Raspberry, but I need to send sound from adau to RPi and then, after Raspberry  processing - return ot back to adau. 

    And this Raspberry still need to control adau registers via i2c. 

    From your perspective - is it generally possible? Or I need to use another RPi for additional audio processing?

    Project sample rate - 48kHz, RPi can be provide a MasterClock? I really don't know. For now I don't understand how I can drive specified connected adc's nd dac's using adau mclk and the same time - send and receive i2s audio from RPi which has a different clock...

  • Hi, remember this is two different protocols / buses

    I2C: Can send/receive data, in digital audio, use it to control DSP parameters, for example.

    I2S: can send / receive digital audio data, use it to transmit or receive digital audio

    You can use both (I2C and I2S) at the same time in RPi, no need for a second RPi

    To create a loop where RPi will receive audio from the DSP, do something with that audio and then send it back to the DSP, you can connect:
       DSP Sdata-outX to RPi I2S input
       RPi I2S output to DSP Sdata-inX

    About use it as Master/Slave, i used this feature many years ago, if i remember correct, its needs I2S kernel module changes, maybe nowdays someone have introduced this feature.

    Please note:
    DSP need some extra steps to do that.

    I think you better use some dedicated efetcs IC like FV-1 to suit your needs, however FV-1 IC:

       a) does not have I2S and will need additional ADC/DAC.
       b) needs digital potentiometers for user interface
       c) is not small

    Will be great if Analog Devices includes modules efects like FV-1 for their Adau DSPs.

    Another tip is choose robust DSP from Analog Devices SHARC family, i think they can do everything you want on a single IC.

  • FV-1 is not a solution for many reasons. I hope ADAU can provide much more better sound quality and ADAU has much more usable effects control. I understand how to connect adau to raspberry - adau has 4 SDATA inputs and 4 SDATA outputs, My question more about configuration this inputs/outpus on adau for correct work with external ADC/DAC converters and Raspberry Pi at the same time. 

    Shark is a Great Solution, but for now - is over budget in my device. Maybe in feature. :) 

  • Hello Efremoff,

    I have looked at the FV-1 and SigmaStudio and the SigmaDSP is much more powerful and flexible but I do see some good things about the FV-1. 

    Thanks for the extra info. With 48kHz sampling rate it will make the interfacing easier. It is also good that you have two extra ports. So pick one set, let's say Serial Input 3 and Serial output 3. Set those up for I2S signals. That is pretty much the default so that is easy. Here is a screenshot of one serial input port and one serial output port both set to I2S. Note, that to get this in one screenshot I used in2 and out 0. Obviously you need to use the in and out ports #3.

    Next you have to work out which is the master and which is the slave. Does the Raspberry Pi have to be a master or slave? Does it matter? Is one way easier than the other? I am guessing that it is easier to be a slave and work off of an interrupt which signals the program that a new sample has arrived. So in that case the setting for the serial port on the ADAU1466 will be as a master on both the in and the out. These clocks are the same so you may only need to connect one of the LRCLK and one of the BCLK pins to the Raspberry Pi and just not use the other one. They still would both need to be set as a master. 

    Then program the Pi to take in the sample, process it and send it to the output. 

    In the ADAU1466 you take in and send the audio in the usual way.  

    Setup your program like this:

    Serial input port 3 comes in on input channels 40-48 and serial output port 3 goes out on channels 40-48

    Since you will be using I2S, which is a stereo signal you will only be using two channels. 

    So take 40 and 41 to get signals into the DSP.  

    The volume control is optional but the meters really are not. You really want to be able to see if you are getting a signal back from the Raspberry Pi and what the level is. It is a troubleshooting tool.

    Then on the output side do this:

    Again, all you really need to do is send to the outputs 40 & 41 but it is really advisable to setup this switch, the meters and the oscillator as trouble shooting tools and also as verification of proper data transmission. You can switch over to the oscillator and send out a known 0dBFS signal. Then have the Rapsberry Pi just loop it back to the DSP and see if you are reading correct levels on the input meters I talked about earlier. You can also mute one channel and see if the correct channel is muted to verify the channels. You can use the meters to see what the levels are that you are sending out. This is the power of SigmaStudio to "look into" what it happening inside the DSP and split the problem into small chunks that you can verify the performance much more easily. 

    One other way to test this is to simply jumper the serial output port 3 over to serial input port 3 and test this program with only the DSP. Verify this part of the setup then connect in the Raspberry Pi with known good signals and work on that part. Takes a lot of the guesswork out of the equation. 

    Dave T