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: 1154
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
User avatar
HerbieSundiver
Active Member
Posts: 32
Joined: Mon Dec 30, 2013 12:49 pm
Location: Germany

Post by HerbieSundiver »

Hi guys,

I have actually a similar problem:
System: Playback from windows PC (with foobar or Jriver) to custom ASIO driver to xmos XU316 and via I2S to custom fpga dac. (driver and whole chain is verified in our older systems with older xmos chip)

1. Playback of PCM: everything works fine up to 384kHz
2. Playback of DoP: plays back fine (and the dac recognizes it, all good) --> but "dsdMode" in "AudioHwConfig" does not go to DSD_MODE_DOP.
3. Playback of DSD natively: The software players do not start with an error "not supported" or similar --> do I have to change some descriptor?

I do have "#define NATIVE_DSD (1)" in "xua_defs.h" but this does not change anything...what am I missing?

Thanks for your thoughts!
Greets,
Bert
User avatar
HerbieSundiver
Active Member
Posts: 32
Joined: Mon Dec 30, 2013 12:49 pm
Location: Germany

Post by HerbieSundiver »

Hi again,
today I played around with the THESYCON demo driver and found something weird:
If I use the xmos VID/PID and the THESYCON driver, everything works! PCM, DoP, and native DSD.
When I now ONLY change the VID/PID to ours and our driver, then only native DSD is not working anymore. BUT: All products with the old xmos work fine with the same VID/PID and the same driver on the same PC...

Anyone a clue?

Thanks,
regards,
Bert
User avatar
Ross
Verified
XCore Legend
Posts: 1154
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Herbie, please start a new thread. Looks to be a different issue.
Technical Director @ XMOS. Opinions expressed are my own
User avatar
HerbieSundiver
Active Member
Posts: 32
Joined: Mon Dec 30, 2013 12:49 pm
Location: Germany

Post by HerbieSundiver »

Hi Ross,
thanks, ok, I opened a new topic
https://www.xcore.com/viewtopic.php?p=41593#p41593
and copied everything, hope that is ok...
Greets