Why XMOS BCLK output is always 32 times Fs * 2 (Channels)

If you have a simple question and just want an answer.
amninder
Member++
Posts: 30
Joined: Mon Dec 15, 2014 9:03 pm

Why XMOS BCLK output is always 32 times Fs * 2 (Channels)

Post by amninder »

Hi ,

I am playing a 48K , 16 bit file from a Windows PC to XMOS MCA kit .I expect the BCLK to be 1.536Mhz (16*48K*2) but I am getting 3.072 Mhz(32*48K*2). No matter, what Bit Depth I set on the Windows PC , I always get BCLK to be a multiple of 32 . I even tried foobar using ASIO interface to rule out any modifications that Windows might be doing to the audio but saw the same results.
SO, it looks like a issue in the XMOS firmware

How can I make the BCLK to exact multiple of the Bit Depth that I set on PC i.e(Bit Depth * Fs * 2)?

Regards
Amninder
babazaroni
Experienced Member
Posts: 94
Joined: Sun Feb 10, 2013 4:47 am

Post by babazaroni »

Your codec probably requires a 32 bit word, but receives only the 16 most significant bits.

Most modern codecs use 32 bits for the data slots, even though it is rare to have full 32bit fidelity.
amninder
Member++
Posts: 30
Joined: Mon Dec 15, 2014 9:03 pm

Post by amninder »

Hi babazaroni,

I am basically looking for a way to set the I2S output of XMOS controller in such a way that it reflects the Bit Depth set on the host and not 32 bit always. Have you done that on XMOS firmware?

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

Post by Ross »

I2S is normally uses always 32bit, some DACs may ignore some bits in various modes, but I2S is 32bits per channel.
babazaroni
Experienced Member
Posts: 94
Joined: Sun Feb 10, 2013 4:47 am

Post by babazaroni »

Amninder, I have not done that. You should first try to find a codec that can have a 16bit data slot. The xmos dev board codecs cannot do 16 bit data slots. They do 32bits, but you can configure them to use the 16 msbs for 16 bit data.

If there is such a codec that can do 16 bit data slots, then yes, it is possible. You would change the buffered port bit size from 32 to 16 when the set format command is received. But these codecs, if they exist, may not be able to do higher bit lengths like 24 or 32.
amninder
Member++
Posts: 30
Joined: Mon Dec 15, 2014 9:03 pm

Post by amninder »

Hi Ross,

I understand the I2S word width is fixed 32 bits and the bit depth can change based on what is set by user.
Does XMOS firmware allows to change the word width = Bit depth instead on being 32 bit always?
User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

No, it is coded to use 32clks in the USB audio code base, you could change it though.

What DAC are you using?
amninder
Member++
Posts: 30
Joined: Mon Dec 15, 2014 9:03 pm

Post by amninder »

I am using WCD9335 audio codec.
Is there a documentation that describes how to set this word width = bit depth in USB audio code base?
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1164
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

I'm afraid not - the code assumes 32b transfers always. It should be possible to re-write but you'd need to study the inner loop.
You'd need to output the 16b words in 2 chunks of 8 or output 2 x 16b words at a time in a 32b word.

Certainly doable..