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.

AM1808 : S/PDIF Audio Transmission via McASP

Other Parts Discussed in Thread: AM1808, OMAP-L138

Currently, we are successfully sending audio data via the McASP to a TLV320AIC3x codec using I2S. We would like to to bypass this codec and transmit data to an external peripheral using  S/PDIF instead. 

It's not entirely clear whether this is even possible with the AM1808 : The Tech Ref Manual implies that it is possible, but   The Datasheet  mentions only DIT and not S/PDIF specifically. 

1 ) Could someone please confirm that the hardware does indeed support S/PDIF via McASP ?

2)  What software changes are required for this ? The first, and most obvious change would be to change  the op_mode to DAVINCI_MCASP_DIT_MODE in board-da850-evm.c., which would configure the McASP for S/PDIF apparently (davinci-macsp.c). Is this sufficient ? 

3)  Looks like we would also need to configure a new stub codec for ASLA to replace the old codec. While there is some support for this (spdif-transceiver.c) , it does seem to require more than a few modifications (to davinci-evm.c at least) . Has this ever been successfully implemented, and if so, could you point me to, or provide the code changes to do this ?

Thanks,

Craig

  • Hi.

    1. Yes, we support DIT mode.  DIT implies S/PDIF...a DIT is a S/PDIF transmitter.

    2. I can't tell you much about software.  But you definitely have to configure McASP for DIT mode.  Keep in mind that if you enable this, all Tx serializers will be in DIT mode.

    3. Again, sorry...I'm more of a hardware guy.

    What EVM are you using?

    Bobby T.

  • 1. Thanks, that's what I suspected all along .  In fact, after a bit of tweaking,  I  have managed to get some almost correct digital audio out of the McASP. Fortunately there was some software support for setting it up for DIT... doing it from scratch seemed daunting.

    "What EVM are you using?"

    It appears to be a DA850/OMAP-L138 as far as I can tell.  (I am not much of a hardware guy, so I'm taking this from the kernel source files that we use)

    You wouldn't happen to know how to change the McASP clock source would you ? The transmission rate is not quite correct and it seems that  the internal clock cannot be divided down nicely to something useful (128*48000 for example). So it seems I need to 'rewire'  another external clock onto the AHCLKX (or AHCHCLK) pin and use that as the clock source. How one goes about this is a bit of a mystery at the moment.

  • Hi, my answer to the rest of your post may depend on which board you specifically have.  What board name is silkscreened onto the board itself?  There are actually two different ones, though the DA850 board is not available to the general public.

    I couldn't tell you how to write the code, but you're correct--the part is probably running off of a 24.0 MHz crystal, which, as you saw, won't divide down to any of the usual audio sample rates.  You want to wire a 24.576 MHz clock to AHCLKX if you want 48 kHz, and 22.~ MHz for 44.1 kHz.  You may have such a source on the board (I'm on business travel and don't have one to look at)...I think there's an AIC3x codec on there.  There is very likely a 24.576 MHz oscillator somewhere near that, and you could grab that output and wire it to AHCLKX.  There's a McASP config register called ACLKXCTL, I believe, with a bitfield called ACLKXM...it's there that you would flip a bit to "external" if you want to use this outside clock source.

    Hope this points you in the right direction.

    Bobby T.

  • Unfortunately our board is custom designed and appears (from the kernel point of view) to be only loosely based on a DA850. But, it does have a (now unused) AIC3x codec so maybe there's a clock nearby with the correct frequency. I'll have to pore over the schematics and find out. But thanks for confirming my suspicions about the McASP clock rate.