
USB Audio Design Guide 15/61
3.5.4 Audio Request: Setting The Sample Rate
When the host requests a change of sample rate, it sends a command to Endpoint
0.
Since the
DescriptorRequests()
function does not deal with audio requests it re-
turns 1. After some parsing the request is handled by either the
AudioRequests_1()
or
AudioRequests_2()
function (based on whether the device is running in Audio
Class 1.0 or 2.0 mode).
3.5.5 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 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
in 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.9.
3.6 Audio Endpoints (Endpoint Buffer and Decoupler)
3.6.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 loop is responsive to the XUD library.
This core is also responsible for feedback calculation based on SOF notification
and reads from the port counter of a port connected to the master clock.
3.6.2 Decoupler
The decoupler supplies the USB buffering core with buffers to transmit/receive
audio data to/from the host. It marshals these buffers into FIFOs. The data from
the FIFOs are then sent over XC channels to other parts of the system as they need
REV 6.1
Comentários a estes Manuais