Distorted audio from DAC using 24-bit I2S bus Topic is solved

Discussions about USB Audio on XMOS devices
User avatar
Ross
Verified
XCore Legend
Posts: 1150
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

There are two values used in the USB Audio Class spec relating to sample resolution "subslot size" (in bytes) and "resolution" (in bits).

By default the codebase uses 4 byte subslot with a 24bit resolution as a bit of special case. The xcore is a 32bit machine so unpacking/packing 24bit samples is a bit of a pain, it's *much* more optimal to just allow 4 bytes per sample.

I have experienced drivers padding out samples to the subslot size regardless of resolution - typically macOS.

When you set the resolution to 16bits, by default, the code does what you might expect - simply uses 2 bytes per sample.
Technical Director @ XMOS. Opinions expressed are my own
View Solution
User avatar
Ross
Verified
XCore Legend
Posts: 1150
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

What was the source of the audio distortion?
Technical Director @ XMOS. Opinions expressed are my own
maxter
Member++
Posts: 24
Joined: Fri Jun 14, 2024 9:55 am

Post by maxter »

Ross wrote: Thu Nov 28, 2024 11:29 am What was the source of the audio distortion?
No, we just found there was a "rogue" setting which was changing the data format on the DAC at a later stage.

Fixed that I am happy to say we have a nice audio loop over USB :D

And I confirm that the extra byte was using MacOS.