XCore-200 How are audio rates passed back to host?

Discussions about USB Audio on XMOS devices
Zed1970
Active Member
Posts: 55
Joined: Tue Oct 15, 2019 10:36 am

XCore-200 How are audio rates passed back to host?

Post by Zed1970 »

Hi,

We're nearly through a development cycle porting the xcore-200 USB Audio code over to a XU208 and need some information on how the individual and available music rates are passed back to the host over USB. In Linux the audio rates can be listed using the following command:

cat /proc/asound/card0/stream0
XMOS xCORE USB Audio 2.0 at usb-ci_hdrc.0-1, high speed : USB Audio

Playback:
Status: Stop
Interface 1
Altset 1
Format: S32_LE
Channels: 2
Endpoint: 1 OUT (ASYNC)
Rates: 44100, 48000, 88200, 96000, 176400, 192000 <============= These rates
Data packet interval: 125 us

Examining the USB descriptors in the code and the USB standard there are no fixed descriptors that are responsible for passing these rate values back. What we have observed through debugging, although a vague theory at this stage, that it seems the host (Linux ALSA in this case) appears probe the XMOS board for each 'standard' rate and if successful carries on to the next. After probing all the rates is appears to settle on the highest rate waiting for the host to play something (after which it will match the requested rate accordingly)

Any help or clarification on how the rate finding process works would be greatly appreciated (especially explained using the code).

Thanks.
User avatar
Ross
Verified
XCore Expert
Posts: 976
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

The rates are in the descriptors for USB Audio Class 1.0 but in USB Audio Class 2.0 are gathered from the device using a range request to a clock unit.

Either method will respect the MIN_FREQ and MAX_FREQ defines.

(Moved topic to USB Audio)