This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM33x + McASP bus with 16 audio codecs (TLV320AIC3101 )



Hi guys,

I need a system able to interface 16 mono audio line in + line out , available as 16 separate audio interfaces (sounds cards) in embedded Linux.

Im reading about the McASP bus, but it's hard to find real good information for me, how you connect 16 codecs together.

* Do they share the same bus? I would think so, since it's the purpose of a bus.

* How do you address them individually? Chip select? No info found yet.

* Are there any finished drivers for interfacing multiple Codecs in TDM mode over this McASP-bus in Linux as sound cards?

I dont wanna invest months or years into this solution, but to get it up as quick as possible.

What is the fastest and easiest way you would suggest me to get going in this matter?

Advice or pointers how to go at this? I need to design this asap :-)

/Johan

  • Hi Johan,

    I don't think what you want is possible to achieve with the AM335X. This processor has 2 McASP interfaces, each with 4 serial data Tx/Rx channels.

  • Adressing the audio channels is done via TDM.

    You will need a I2C interface to the codecs. This means 8 I2C interfaces (8 Stereo codecs == 16 channels)

    Setting up McASP for TDM is straightforward. Read the manual.

    Setting up alsa for 16 audio interfaces is unknown to me.

    regards

    Wolfgang

  • I'm doing the same thing, and the AM335x can handle it.  In fact, it can in theory do 32 channels, full duplex, (i.e. 16 stereo codecs)

    Connecting the codecs is relatively simple, though since you're using the AIC3101, you cannot use the internal PLL and expect all the channels to be synchronized.  The reason is a bit subtle.  The way to sync all the codecs perfectly is that you need to start all the clocks at once.  The 3101 does not have the GPIO1 and GPIO2 pins that allow you to loop back the pll output to BCLK input The AIC3106 and AIC33 and others can loop the clock back from the PLL via GPIO1.

     

    So, with the 3101, the method is:

    use external *GATED* clock generator to generate MCLK.  MCLK == 256 x FS.  (i.e. 12.288MHz for 48kHz sampling).  

    Codec 0 is in master mode, all other codecs is slave mode.  Codec 0 drives BCLK & FS to all codecs & AM335x.  

    You program all the codecs with the MCLK turned off.   Then, once everything is programmed, you enable the clock, and they all start at the same time.  

    The trick is getting the linux drivers right, which is what I'm working on, hoping to find an answer here...

    Each codec can be programmed to be one of 4 i2c address, but you need 8 codecs.  Therefore you need 2 i2c busses.  Since the I2C busses don't need to be fast, and don't get touched much, you can simply use GPIO pins as I2C and use the linux gpio i2c driver.

    The drivers for multi-codecs on one tdm bus is the tricky part that I'm still looking for answers on.

    -Caleb