Using XCore-200 MC Audio to convert ADAT to I2S

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
aytli
Newbie
Posts: 1
Joined: Wed Aug 29, 2018 11:14 pm

Using XCore-200 MC Audio to convert ADAT to I2S

Postby aytli » Wed Aug 29, 2018 11:37 pm

I want to set up my XCore-200 MC Audio to decode an ADAT input stream into an I2S output that I can listen to through one of the audio jacks. I've been trying to modify "app_usb_aud_xk_216_mc" to do this, and I'm having a bit of trouble.

My understanding so far is that the adatReceiver48000 thread is used to receive the incoming ADAT data on the c_adat_rx channel. The audio design guide talks about a way to decode the data on the channel by reading a control byte followed by 8 channels of audio data.

The audio() thread is the one that drives the I2S outputs. Is there a way to simply route the decoded ADAT samples into one of the audio outputs?

I'm very new to XCore and I don't really know what I'm doing, so I apologize for any rookie mistakes.
User avatar
infiniteimprobability
XCore Legend
Posts: 1120
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Tue Sep 04, 2018 7:20 am

Hi and welcome to the forum!

ARe you only doing ADAT->I2S? The standard reference design contains all of the stuff you need, but a lot more, because it always assumes a USB host connection.

What you need is adatReceiver48000 (turns the port input into samples over a channel), clockgen (extracts the clock from the stream and toggles an IO to provide a low frequency reference for the PLL to generate the local MCLK recovered from the input stream), audio (takes the PCM samples and generates the i2s).

There will be a bit of hackery involved in removing the channel connections to USB, but a good place to start would be to remove main.xc from sc_usb_audio and writing a new, fresh main in your app directory, but it's all perfectly feasible and doable. I don't think there is any shortcut however - you'll need to understand the reference code
User avatar
infiniteimprobability
XCore Legend
Posts: 1120
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Tue Sep 04, 2018 7:29 am

The alternative is you could just take the adat thread and add it to your own app using lib_i2s. You could borrow bits from an unpublished appnote which you can find here viewtopic.php?f=37&t=6597&p=32670&hilit=spdif+i2s+appnote#p32670

Who is online

Users browsing this forum: No registered users and 0 guests