Audio Endpoints (Endpoint Buffer And Decoupler); Endpoint Buffer - XMOS xCORE-200 Multi-channel Audio board Design Manual

Usb audio
Hide thumbs Also See for xCORE-200 Multi-channel Audio board:
Table of Contents

Advertisement

USB Audio Design Guide
3.3.3.2 Audio Request: Set Sample Rate
The AudioClassRequests_2() function parses the passed USB_SetupPacket_t struc-
ture for a CUR request of type SAM_FREQ_CNTROL to a Clock Unit in the devices
topology (as described in the devices descriptors).
The new sample frequency is extracted and passed via channel to the rest of
the design - through the buffering code and eventually to the Audio IO/I2S core.
The AudioClassRequests_2() function waits for a handshake to propagate back
though the system before signalling to the host that the request has completed
successfully. Note, during this time the USB library is NAKing the host essentially
holding off further traffic/requests until the sample-rate change is fully complete.
3.3.3.3 Audio Request: Volume Control
When the host requests a volume change, it sends an audio interface request to
Endpoint 0. An array is maintained in the Endpoint 0 core that is updated with
such a request.
When changing the volume, Endpoint 0 applies the master volume and channel
volume, producing a single volume value for each channel. These are stored in the
array.
The volume will either be handled by the decoupler core or the mixer component
(if the mixer component is used). Handling the volume in the mixer gives the
decoupler more performance to handle more channels.
If the effect of the volume control array on the audio input and output is imple-
mented by the decoupler, the decoupler core reads the volume values from this
array. Note that this array is shared between Endpoint 0 and the decoupler core.
This is done in a safe manner, since only Endpoint 0 can write to the array, word
update is atomic between cores and the decoupler core only reads from the array
(ordering between writes and reads is unimportant in this case). Inline assembly is
used by the decoupler core to access the array, avoiding the parallel usage checks
of XC.
If volume control is implemented in the mixer, Endpoint 0 sends a mixer command
to the mixer to change the volume. Mixer commands are described in §3.6.
3.4 Audio Endpoints (Endpoint Buffer and Decoupler)
3.4.1 Endpoint Buffer
All endpoints other that Endpoint 0 are handled in one core. This core is imple-
mented in the file usb_buffer.xc . This core is communicates directly with the XUD
library.
The USB buffer core is also responsible for feedback calculation based on USB Start
Of Frame (SOF) notification and reads from the port counter of a port connected to
the master clock.
XM0088546.1
24/110

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents