S/PDIF to multi-I2S output

If you have a simple question and just want an answer.
devan
Junior Member
Posts: 5
Joined: Wed Jun 18, 2014 3:09 pm

S/PDIF to multi-I2S output

Post by devan »

hi,

how or when, XMOS-XU216 will be support S/PDIF(5.1/7.1) convert to Multi-I2S output?

now, S/PDIF soft-ip working for stereo well only, but it not decoder more then 2-channel S/PDIF data. our project need or requirement: S/PDIF convert to Multi-I2S outputs within XU216 platform.

Thank you.
henk
Verified
Respected Member
Posts: 347
Joined: Wed Jan 27, 2016 5:21 pm

Post by henk »

Hi devan,

Can you explain in more detail how S/PDIF 7.1 works. Does it have one A frame and 7 B frames?

If so, the S/PDIF receiver should support it already. You will just need to write a function that grabs the data (one 'X/Z' frames and seven 'Y' frames) shuffle the sample values into pairs of buffers (I2S are two channels each, so you need four buffers that have two channels each), and then output them over a quad-I2S module.

Cheers,
Henk
User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Devan, you must be referring to a compressed stream over S/PDIF, AC3/DTS etc?
devan
Junior Member
Posts: 5
Joined: Wed Jun 18, 2014 3:09 pm

Post by devan »

Hi Henk,

well, example, S/PDIF TX data from the Set-top BOX or TV BOX. Audio data was DTS5.1 or DTS7.1, use the XU216 Multi-channel platform's SPDIF IN to achieve or decoder 5.1-ch to DAC.

as the result to this, how to garbs the S/PDIF data to ch0-7? and then send to I2S DAC.

I was running AN00231 demo code, but it support stereo output with DAC only! I hope it support max to 8-ch output with DAC.

Thank you
devan
Junior Member
Posts: 5
Joined: Wed Jun 18, 2014 3:09 pm

Post by devan »

Hi Ross,

Allright! the data was AC3/DTS over S/PDIF with standard device of the Set-top BOX output.

I have read the spdif.pdf of getting from lib_spdif/doc.
spdif_receive_sample(c,sample,index), index of parameter is current frame(i.e 0 for left-ch, 1 for right ch).

If the data was AC3/DTS data format, does index of parameter from 0 to 5?

0 for LS, 1 for RS, 2 for CEN, 3 for RS, 4 for RR, 5 for SW

I hope to use XU216 to decoder AC3/DTS(5.1ch/7.1ch) for DAC ouput.

Can achieve this function with spdif_lib on XU216-MC Platform?

Thank you
User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Yes it can be done, people have had it running previously. You need to take the output from lib_spdif and run it though a decoder - something like a fixed point version of liba52/libdts/libcda would be a good start.
devan
Junior Member
Posts: 5
Joined: Wed Jun 18, 2014 3:09 pm

Post by devan »

Hi Ross,

can you explain how to use lib_spdif grabs LL/LS/CEN/RL/RR/SW ? or show some demo routines or docs?
if(index == 0) lift channel
else if(index == 1) right channel
else if(index == 2) center channel
right?

if all of the above is true. but, grabs stream data was compressed, i need a libdts/liba52 to decoder stream data, and get source data?

Thank you
User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

It doesn't work like that. You get a full encoded bit stream over S/PDIF. You run this full data though a decoder and out pops the channel PCM data.
devan
Junior Member
Posts: 5
Joined: Wed Jun 18, 2014 3:09 pm

Post by devan »

Hi Ross,

I understand that by S/PDIF to get full encoded bit stream, what is the method of flow?

Thank you