XK-EVK-XU316: Adding DSD/PCM gpio line

Discussions about USB Audio on XMOS devices
MartinG
New User
Posts: 2
Joined: Wed Jul 24, 2024 10:28 am

XK-EVK-XU316: Adding DSD/PCM gpio line

Post by MartinG »

Hi all, I've been really struggling to get an GPIO signaling of PCM/DSD playback on the XK-EVK-XU316.

The background is that I want to output the sampling rates (44/48..), clock domain (22M/24M) and the format (PCM/DSD) via GPIO lines.

I have already enabled DSD accordingly in “xua_conf.h”:

Code: Select all

/* Number of DSD channels to DACs */
#define NATIVE_DSD         0 /* 0: Support only DoP */
#define DSD_CHANS_DAC      (2)
#define PORT_DSD_DAC0      PORT_I2S_DAC0
#define PORT_DSD_DAC1      PORT_I2S_LRCLK
#define PORT_DSD_CLK       PORT_I2S_BCLK

This is what I tried:

I use the function AudioHwConfig() in “audiohw.xc” and have extended it for testing with simple printf outputs.

Code: Select all

void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC)
{
...
    printf("samFreq: %d\n", samFreq);
    printf("mClk: %d\n", mClk);
    printf("dsdMode: %d\n", dsdMode);
...
}
When I now play PCM and DSD, "samFreq" and "mClk" are always output correctly, but "dsdMode" always remains 0. I have tested with Foobar2000 and Roon. I have also made sure that DSD is explicitly played back and not converted to PCM. On the XK-EVK-XU316 I have verified that DSD is really being output by checking the LRCK signal wtih an oscilliscope.


Please share any thoughts on this, I'll be very grateful...
Audma_lm
Member
Posts: 11
Joined: Thu Oct 05, 2023 3:14 pm

Post by Audma_lm »

Hi,

are you using sw_usb_audio v8.1.0?
Anyway, I'm just guessing but have you tried to switch on the NATIVE_DSD?

From xua_conf_default.h

Code: Select all

#define NATIVE_DSD       1  /* Always enable Native DSD when DSD mode is enabled */
MartinG
New User
Posts: 2
Joined: Wed Jul 24, 2024 10:28 am

Post by MartinG »

Yes, I am using the current version sw_usb_audio v8.1.0

I set NATIVE_DSD 1 and now it works. I was just wondering because DoP is played back even though NATIVE_DSD is set to 1, thought 1 meant DSD native and 0 DoP.

At least the problem is solved. Thank you very much!
User avatar
Ross
Verified
XCore Legend
Posts: 1071
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

The values you should expect here are:

#define DSD_MODE_OFF 0
#define DSD_MODE_DOP 1
#define DSD_MODE_NATIVE 2
Technical Director @ XMOS. Opinions expressed are my own