Custom design on XU316 - no USB audio from I2S Topic is solved

Discussions about USB Audio on XMOS devices
maxter
Member++
Posts: 24
Joined: Fri Jun 14, 2024 9:55 am

Custom design on XU316 - no USB audio from I2S

Post by maxter »

I have a custom board based on the XU316, the board has 8 I2S inputs, 8 I2S output and ADAT RX.

My project is based on XTC tool 15.3.0 and the USB Audio software v8.1.0 .
I configured the I2S to be master (i.e. CODEC_MASTER=0) and I configured my ADC to be slave.
I see I2S data been driven by the ADC, so I assume that all the configuration on the acquisition side is correct, but I don't receive any audio from USB (I haven't tried the other way around, yet); before I dive into the I2S library, is there anything "obvious" I may have missed?
Do you have any advice on what start looking at to find out where the problem is?

These are my build flags:

Code: Select all

BUILD_FLAGS    = $(EXTRA_BUILD_FLAGS) -fcomment-asm -O3 -report \
    -lquadflash -lotp3\
    -g -fxscope \
    -DAUDIO_IO_TILE=0 \
    -DXUD_TILE=1 \
    -DUSB_TILE=tile[1] \
    -DI2S_CHANS_DAC=6 \
    -DI2S_CHANS_ADC=8 \
    -DXUA_ADAT_RX_EN=1 \
    -DMIN_FREQ=44100 \
    -DMAX_FREQ=192000 \
    -DADAT_TX_USE_SHARED_BUFF=1 -DXUA_QUAD_SPI_FLASH=1
The card is correctly detected by the OS (tried with both Mac and Linux) and when I change the sampling frequency on the Mac (in the Audio MIDI setup app)I see that the code passes through the AudioHwConfig() function and the PLL is being reconfigured.
View Solution
danielp
Member++
Posts: 16
Joined: Tue Jul 16, 2024 9:52 am
Location: Bristol, UK

Post by danielp »

I don't think there is anything obviously wrong with your configuration - I built an equivalent application using sw_usb_audio v8.1.0 for our XK-AUDIO-316-MC-AB board using your build flags, and I can correctly record eight channels from the ADCs.

Since you've already checked that you can see data driven by the ADC, I would start by debugging whether any samples are being received in the AudioHub_MainLoop function from the p_i2s_adc port array in lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc
XMOS, Senior Software Engineer
maxter
Member++
Posts: 24
Joined: Fri Jun 14, 2024 9:55 am

Post by maxter »

danielp wrote: Thu Nov 14, 2024 11:22 am I don't think there is anything obviously wrong with your configuration - I built an equivalent application using sw_usb_audio v8.1.0 for our XK-AUDIO-316-MC-AB board using your build flags, and I can correctly record eight channels from the ADCs.

Since you've already checked that you can see data driven by the ADC, I would start by debugging whether any samples are being received in the AudioHub_MainLoop function from the p_i2s_adc port array in lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc
I can see moving data in the samplesIn buffers (and 0s when I mute the ADC output), so definitely the I2S data arrives into the chip.
I tried to follow where those buffers are used, but without much luck.. any advice on how to proceed with debugging it?
User avatar
Ross
Verified
XCore Legend
Posts: 1150
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

This sounds like a custom board - make sure you have MCLK going into the xcore correctly.

For a two tile design it will need to go to both tiles (so two pins). One of the I2S to use and one for the USB sub-system to use to generate USB feedback and calculate packet sizes etc.
Technical Director @ XMOS. Opinions expressed are my own
maxter
Member++
Posts: 24
Joined: Fri Jun 14, 2024 9:55 am

Post by maxter »

Thanks all for the assistance; in the end we found that everything was correct both hardware and firmware, and was "only" the test setup wrong, due to my lack of knowledge of the software I was meant to use (I am neither an audio engineer nor a Mac person).

We managed to have audio out from our board and back in a "nice" loop.
User avatar
Ross
Verified
XCore Legend
Posts: 1150
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Well done :) Thanks for letting us know!
Technical Director @ XMOS. Opinions expressed are my own