I apologize in advance if this is obvious, as I'm working a little out of my element here :roll:
I've been digging through the ref design code, trying to find some indication of how many bits per sample are being sent in the USB audio stream. I can see (for example) where the sample rate gets set... but nothing about bits/sample. It almost looks like the driver is always sending the same size packets, and I2S is always 32 bits/frame, so maybe the HW doesn't even need to know?
I'd like to know this so I can display the current sample rate and bits/sample (16 or 24) on a UI.
TIA,
Pete
USB Audio ref design: bits per sample
-
- New User
- Posts: 2
- Joined: Mon Nov 28, 2011 10:47 pm
-
Verified
- XCore Legend
- Posts: 1163
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
In the default reference design the number of bits transmitted to/from the device is 32bits. This is made up of 24 bits of sample and 8-bits of zero padding (See bBitResolution and bSlotSize in the device descriptors/USB Audio Class specification). If a 16 bit file is being played the host will zero-pad.pmillett wrote:I apologize in advance if this is obvious, as I'm working a little out of my element here :roll:
I've been digging through the ref design code, trying to find some indication of how many bits per sample are being sent in the USB audio stream. I can see (for example) where the sample rate gets set... but nothing about bits/sample. It almost looks like the driver is always sending the same size packets, and I2S is always 32 bits/frame, so maybe the HW doesn't even need to know?
I'd like to know this so I can display the current sample rate and bits/sample (16 or 24) on a UI.
TIA,
Pete
Technical Director @ XMOS. Opinions expressed are my own
-
- New User
- Posts: 2
- Joined: Mon Nov 28, 2011 10:47 pm
Thanks Ross. So it seems only the host knows how many bits are really being used...Ross wrote:
In the default reference design the number of bits transmitted to/from the device is 32bits. This is made up of 24 bits of sample and 8-bits of zero padding (See bBitResolution and bSlotSize in the device descriptors/USB Audio Class specification). If a 16 bit file is being played the host will zero-pad.
Pete