USB to I2S

Discussions about USB Audio on XMOS devices
lmariotti
Junior Member
Posts: 6
Joined: Mon Nov 21, 2022 5:38 pm

USB to I2S

Post by lmariotti »

Hi everyone, I've to develop a USB to I2S converter with XU208-128-QF48-C10, there's maybe any free-to-use code that already perform this task?

Thanks everyone.


User avatar
Ross
XCore Expert
Posts: 860
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

The code here: https://www.xmos.ai/develop/usb-multichannel-audio/ can be easily modified to run on a single tile device

<moved to USB Audio>
lmariotti
Junior Member
Posts: 6
Joined: Mon Nov 21, 2022 5:38 pm

Post by lmariotti »

Thanks for the fast reply and for the code provided.

I was looking at app_usb_aud_xk_evk_xu316 READ ME file:
"Supports for the following sample frequencies: 44.1, 48, 88.2, 96, 176.4, 192kHz"

My application should be able to sample until 768kHz, is the XU208-128-QF48-C10 capable to reach these requests? Or I should pick a different XMOS MCU?
User avatar
Ross
XCore Expert
Posts: 860
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

We don't currently test anything over 192kHz since we have no dev kits that support it. We previously had kits that ran at 384kHz but these are no longer available.

Out of interest I did try on my lunch break by making the following changes:

Code: Select all

diff --git a/app_usb_aud_xk_316_mc/src/core/xua_conf.h b/app_usb_aud_xk_316_mc/src/core/xua_conf.h
index 8bc72af..4b4366b 100644
--- a/app_usb_aud_xk_316_mc/src/core/xua_conf.h
+++ b/app_usb_aud_xk_316_mc/src/core/xua_conf.h
@@ -114,12 +114,12 @@
 #endif
 
 #ifndef MCLK_48
-#define MCLK_48            (512*48000)   /* 48, 96 etc */
+#define MCLK_48            (512*48000*2)   /* 48, 96 etc */
 #endif
 
 /* Maximum frequency device runs at */
 #ifndef MAX_FREQ
-#define MAX_FREQ           (192000)
+#define MAX_FREQ           (192000*4)
 #endif
 
A couple of notes:
- 768KHz requires a 49MHz bit clock so at least a 49MHz MCLK. Setting the define MCLK_48 causes the Secondary/Application PLL settings to be adjusted to generate this frequency.
- The DACs on the new XK-AUDIO-316-MC board support 384KHz but the ADCs do not
- None of the hardware supports 768kHz but I eye-balled the I2S signalled on the scope and it looked fine
- I only tried on the 2channel input/2channel output build configuration with the xCORE as I2S master (2AMI2o2xxxxxxx)

Since this isn't something that we regression test then we cannot really officially support this configuration.

Good luck with your project!