Intermittent audio (and crashes) with 32-bit USB Audio

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

Intermittent audio (and crashes) with 32-bit USB Audio

Post by maxter »

We have a custom board with the XU316-1024-FB265-C24 chip, with 6 Analogue Outputs, 8 Analogue Inputs (using I2S) and ADAT Input.
Our firmware is based on the USB audio platform (moved Audio stack to tile 0, USB to tile 1, added an extra I2C module - both on tile 0, and a couple to "threads" to deal with IO).

We are having some intermittent audio issues (and crashes) when the application is built with 32-bit USB Audio enabled, both with the 8.1 and 9.0 USB Audio.

The issues arise after I switch sample rate or bit-depth: often the audio playback becomes intermittent, i.e. it plays for up to 1, 2 seconds then drops and gets back up and so on; sometimes changing sample rate (or bit-depth) fixes the issues, sometimes not.
I can see that the I2S data follow the audio, i.e. I see bursts of data followed by silence, instead of a continuum of data.

In some rarer events, when the system is in this intermittent state after some time it may crash (i.e. this doesn't happen all the time, when it's in this state), always with the following trace message

Code: Select all

xrun: Program received signal ET_LOAD_STORE, Memory access exception.
      0x00082398 in handle_audio_request (c_mix_out=<optimised out>) at /home/max/workspace/xmos/bkp-usbaudio/lib_xua/lib_xua/src/core/buffer/decouple/decouple.xc:589
I also verified that if I reduce the Analogue Input count to 4 (while keeping all the rest) the audio is always fine, so it seems related to the USB bandwidth.

Did anyone experience this issue before or have any advice on how to solve this?
Is there any setting on the client's side that needs adjusting for the bw required by this configuration (currently I am testing with Reaper on a Mac, with default block size).
User avatar
Ross
Verified
XCore Legend
Posts: 1158
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Can you confirm what you mean by "audio stack" i.e. what threads?

What changes did you make to enable 32bit?
Technical Director @ XMOS. Opinions expressed are my own
maxter
Member++
Posts: 29
Joined: Fri Jun 14, 2024 9:55 am

Post by maxter »

Ross wrote: Mon Jan 27, 2025 12:34 pm Can you confirm what you mean by "audio stack" i.e. what threads?
I just set the relevant defines for the audio & usb tile in the Makefile (CMakeLists.txt, actually)

Code: Select all

                                            -DAUDIO_IO_TILE=0
                                            -DXUD_TILE=1
                                            -DUSB_TILE=tile[1]
What changes did you make to enable 32bit?
I added these defines in xua_conf.h, which I had found in some threads on this forum (this one https://www.xcore.com/viewtopic.php?t=2814)

Code: Select all

#define OUTPUT_FORMAT_COUNT                         3
#define STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS      32
#define STREAM_FORMAT_OUTPUT_2_RESOLUTION_BITS      24
#define STREAM_FORMAT_OUTPUT_3_RESOLUTION_BITS      16

#define STREAM_FORMAT_INPUT_1_RESOLUTION_BITS       32
#define STREAM_FORMAT_INPUT_2_RESOLUTION_BITS       24
#define STREAM_FORMAT_INPUT_3_RESOLUTION_BITS       16