DSD Over PCM and SPDIF TX

Discussions about USB Audio on XMOS devices
amc184
Junior Member
Posts: 4
Joined: Sun Jan 08, 2017 5:03 am

DSD Over PCM and SPDIF TX

Post by amc184 »

I'm developing a custom design using an XUF208 as a USB to SPDIF bridge. It is based on the app_usb_aud_xk_216_mc project from 6.15.2 RC 1, and includes the SPDIF TX feature.

Right now when the device receives a DSD over PCM (DoP) stream this is correctly detected, and a DSD stream is output (even though I'm not really using the I2S / DSD output, I'm still able to monitor this). However, when a DoP stream is detected the SPDIF output is disabled, and no data is output.

There are some devices that will accept DoP data through a SPDIF input, and I would think this might be something the DSD over PCM standard had in mind when they used a 24 bit sub-frame. My preferred behavior is that the DoP stream is sent out over the SPDIF transmitter, at least for DSD64 (as I'm not sure it's able to support higher sample rates, which would be equivalent to PCM over 192kHz).

Is anyone able to point out what I might be able to do to change this, so that DSD over PCM is sent unmodified to the SPDIF transmitter?


User avatar
fabriceo
XCore Addict
Posts: 186
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hi
you should try to de-activate DOP detection. then the raw PCM value will go straight to the spdiftx.
if you do not want to go deep in the audio.xc source code then just edit the value DSD_EN_THRESH in file dsd_support.h. Change 32 to say 1000000 for example.
(I havent tested myself but this makes sense to suggest :)
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

This is surprising, there is actually a logged "known issue" for the exact opposite issue:

"(#14762) When in DSD mode with S/PDIF output enabled, DSD samples are transmitted over S/PDIF if the DSD and S/PDIF channels are shared, this may or may not be desired"

https://github.com/xmos/sw_usb_audio/bl ... README.rst

You'll want SPDIF_TX_INDEX set to 0, one imagines: later code bases will try and sort this out for you automatically: https://github.com/xmos/sw_usb_audio/bl ... conf.h#L83
amc184
Junior Member
Posts: 4
Joined: Sun Jan 08, 2017 5:03 am

Post by amc184 »

Appreciate the replies.

fabriceo - When I disable DSD support by setting DSD_CHANS_DAC to 0, OUTPUT_FORMAT_COUNT to 1 and NATIVE_DSD to 0, (not sure if all three changes are needed) I do get DoP on the SPDIF output. I also get unconverted DoP on the I2S output, but that's not really a concern in this case.

If I do use this method, I'd still like to get an indication of whether the stream being sent over SPDIF is PCM or DoP. I've had a look in 6.15.2 RC1's audio.xc to see if there's any elements I could turn on to allow dsdMode to be set without changing how audio is routed. I modified the following lines to include (DSD_CHANS_DAC == 0): 252, 459, 473, 777 and 1133. I didn't get any change in dsdMode when sending a DoP stream.

Ultimately, I'd prefer that a DoP stream was converted to DSD and send as DoP at the SPDIF output.

Ross - I do have SPDIF_TX_INDEX set to 0. I am getting PCM output over PCM, it's only when that PCM is being detected as DSD that I lose SPDIF output. I think I saw a thread about #14762, though I couldn't find it right now. It didn't seem to explain why they got that (and why I don't).