Hi
We want to implement a high-res file detection into our USB-Audio device (derived from the xmos app_usb_aud_xk_216_mc example application) – an LED shall indicate to the user whether the audio material streamed fulfills the High-Res-Logo requirements or not (more than 16bits per sample OR Fs>= 88200). Samplerate detection is easy since a function to change PLL-configuration is called each time the samplerate changes (audiohw.xc). I’ve implemented that and the LED already indicates streaming formats above 88.2kHz, but how do I detect the bit-depth of the audio stream? Where in the code is this negotioated between the host and the audio device?
Regards
Markus
How to detect bit depth of USB audio stream?
-
- Member
- Posts: 11
- Joined: Tue Dec 20, 2016 4:09 pm
-
Verified
- XCore Legend
- Posts: 1156
- Joined: Thu May 27, 2010 10:08 am
Hi, the place to pick up this info is in audiohw.xc which contains the user modifiable callback on sample rate change. You can find this in sw_usb_audio. Here's where you can take the appropriate action:
sampRes_DAC will contain the bit depth (16, 24, 32 etc..)
Code: Select all
void AudioHwConfig(unsigned samFreq, unsigned mClk, chanend ?c_codec, unsigned dsdMode,
unsigned sampRes_DAC, unsigned sampRes_ADC)