DSD playback on X-Core 200

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
jonny
Junior Member
Posts: 4
Joined: Wed Nov 16, 2016 12:02 am

DSD playback on X-Core 200

Post by jonny »

Hi All,
We are trying to adapt the xk-audio-216 multichannel reference board for our new xcore200 2 channel DAC design. We have used an L1 design for some time and are currently in the process of upgrading.
We are using custom hardware based around the xk-audio-216 reference design which is essentially a stripped down 2 channel usb in i2s out. PCM is working fine on all sample frequencies up to 384kHz but the DSD playback isn't. We have tried all the setup variations using the Thesycon evaluation driver as described here - http://audinst.com/en/faqs/2431?ckattempt=1. With both Native and DOP playback using the foo_dsd_asio output all we are hearing is noise.
After not being able to get it to work I went back to our old L1 design and enabled the DSD playback and with a few tweaks (as described in AN00103) was able to get DSD playback for DSD64, DSD128 and DSD256. This makes me think that it is not a windows/foobar setup but some issue with my aud_xk_216 code.
I'm not actually changing much in the code, only stripping all the i2c codec setup that I do not require from audiohw.xc (although I have tried without making this change too) and creating a custom build in the makefile with the following defines:
-DDSD_CHANS_DAC=2 -DI2S_CHANS_ADC=0 -DI2S_CHANS_DAC=2 -DNUM_USB_CHAN_OUT=2 -DNUM_USB_CHAN_IN=0

When I scope the DSD outputs the bit clock is as expected 2.8MHz for DSD64. But both the DSD0 and DSD1 output seem to have 32 bits of data at a frequency of 11kHz, that is there seems to be 32 bits of data in packets of 256 bits. After the 32 bits of what I can assume is the correct data the DSD line sits either high or low until the 256 clocks are finished before another 32 bits of data. Interestingly enough, after adding a -DMAX_FREQ define to allow higher DSD rates I see the same 32 bit packets but at different frequencies, DSD128 has 32 bits each 128 clocks @5.6MHZ while DSD256 has 32 bits each 64 clocks @ 11.2MHz. With the DSD256 I can actually hear a very faint signal in the noise, I guess because now half of the clocks have data on them.

Not sure if this is relevant or not, but this last finding made me wonder if it was something to do with volume control as I remember reading that volume controls can destroy DSD outputs. I found that the foobar volume control did nothing to the signal, but when I used the volume controls in the Thesycon control panel there was an affect. If I trimmed the master volume while playing back DSD (both natively and DOP using the foo_dsd_asio) the output seemed to revert to PCM (176.4kHz LRCLK, 11.4MHz BCLK and data) but with static on the output. If I broke the left and right balance and just trimmed one channel, the output stayed as a DSD output with the 32 bits of data changing on either the DSD0 or DSD1 line depending on whether I trimmed the left or right channel.

This, along with the faint signal on DSD256 leads me to believe that the data is right but for some reason the samples are not being passed to the I2S delivery thread at the correct rate?
Can anyone help with advice on what I am doing wrong?

Thanks in advance.


User avatar
xsamc
Active Member
Posts: 55
Joined: Fri Mar 04, 2011 3:38 pm

Post by xsamc »

Hi jonny,

Have you tried the same tests on the xCORE-200 MC Audio board running an unmodified config from app_usb_aud_xk_216_mc, do you see the same issues with DSD output on it?

Cheers,
Sam
jonny
Junior Member
Posts: 4
Joined: Wed Nov 16, 2016 12:02 am

Post by jonny »

Hi Sam,
Thanks for your reply. Unfortunately we do not have the xCore-200 MC Audio, we have a number of years of experience using the L1 design so didn't think it was necessary.
Since posting I have actually managed to get my customised design working...
I realised that the L1 design which I had used to get DSD playback was an earlier version of the code. When I opened and compiled the app_usb_aud_sk_216_mc using my modified config in Composer 14.0.4 using version 6.12.6 of the USB audio software both PCM and DSD playback function correctly. I was originally trying to get it going in composer 14.2.3 using software version 6.15.2rc1.
Perhaps someone else with a reference design could confirm DSD playback is working correctly for the latest software so I can try and work out what is causing my design to fall over with the later version of the code.
Thanks,
Jon
kasemann
Member
Posts: 11
Joined: Tue Dec 20, 2016 4:09 pm

Post by kasemann »

Hi

While searching for a solution for a similar (or same) problem I stumbled over this thread. I am also only hearing noise when playing back DSD over our customized version of the xk_216_mc application - after having a look at the version numbers it turns out I also use the newer versions mentioned above. Can anyone confirm that these versions do have trouble with DSD? Is the only workaround switching to an older version?

Regards

Markus
jonny
Junior Member
Posts: 4
Joined: Wed Nov 16, 2016 12:02 am

Post by jonny »

I'm no XMOS expert, but after a bit of a search through the code I think I might have found the issue. Perhaps someone with a bit more experience may be able to comment on what I think I've found;
My custom PCB uses a X-core 200 XE chip (XE216-512-TQ128-C20). This utilises the XS2 architecture, which handles the clocks differently from the XS1. With __XS2__ defined the bit clock is derived from a divided clock block of the master clock. If you look in audio.xc, you'll see that within the doI2Sclocks() function a __XS2A___ ifndef ignores all of the bit clock code. However, within the main audio io loop the dsd bit clock code is unchanged, my guess is that this is interfering with the clock blocked bit clock. I have DSD playing on usb_audio6.15.2 by adding the __XS2A__ ifndef around the switch(divide) within the dsd_mode == DSD_MODE_NATIVE and dsd_mode == DSD_MODE_DOP if statements.
After doing this I have now got DOP64 and DOP128 playing fine, however DOP256 still isn't right. I am hearing a staticy version of the track playing (more clear than it was previously, as described above), the bit clock seems fine but I'm assuming the data is being corrupted, I'm not sure if this is a hardware or software related fault now on my custom PCB? Can anyone help out with what the issue may be, or advise where best to look for the fault? I'm using a 512*44100 Master clock but have also tried it with a 1024*44100 clock and had the same result.
Thanks,
Jon
pasnew
Member
Posts: 15
Joined: Wed Jan 16, 2013 7:28 pm

Post by pasnew »

Hi Jonny,

Thanks to your discovery, my XUF208 can play dsd with the latest software now. It's ridiculous that xmos hasn't fix it nearly one year after the release.

However, I'm facing the same problem as you when playing dsd256, under my oscilloscope data is about 4.2MHz, which seems correct. Are you also using a ES9018? Have you find any solution?

Thanks,
jonny
Junior Member
Posts: 4
Joined: Wed Nov 16, 2016 12:02 am

Post by jonny »

Glad it was able to help you out. DSD256 should be 256*44100 ~11.3MHz though, not 4.2MHz?
I haven't got the DSD256 working on my custom X-core 200 chip, although I have got it working on another custom PCB using an old XS1-L8 chip.
My issue could still be hardware related, I'm not entirely sure. I've been using both the ES9018 and the new ES9038Pro as the DAC.
If I find any further information, I'll update this thread.
Thanks,
Jon
pasnew
Member
Posts: 15
Joined: Wed Jan 16, 2013 7:28 pm

Post by pasnew »

Yeah it's 11.2896MHz for the bclk and about 4.2MHz for the data, which it's logical for something a little less than 11.2896/2.
I'll dig it out when I have time with my logical analyzer ☺️
User avatar
maxssau
Member
Posts: 9
Joined: Mon Mar 18, 2019 8:35 am
Location: Russia, Samara
Contact:

Post by maxssau »

Hello!

I have same problem:
if playback DSD64 (DoP) with 44.1x512 kHz MCLK rate I have noise + sound. If MCLK=48x512 kHz sound is clear. Where is problem? DSD patch in audio.xc not working.
User avatar
maxssau
Member
Posts: 9
Joined: Mon Mar 18, 2019 8:35 am
Location: Russia, Samara
Contact:

Post by maxssau »

Solve problem:

last SDK + this file https://www.xcore.com/viewtopic.php?f=8 ... b82#p34291
Post Reply