USB Audio Design GuideREV 6.1Publication Date: 2013/4/9XMOS © 2013, All Rights Reserved.
USB Audio Design Guide 10/61This results in many potential build configuration permutations. It is not possi-ble for all of these to be exhaustively te
USB Audio Design Guide 11/613.3 The USB Audio System ArchitectureThe XMOS USB Audio platform consists of a series of communicating components.Every sy
USB Audio Design Guide 12/61Figure 6:USB AudioComponentArchitecture3.4 USB Audio Class SupportThe XMOS USB Audio framework supports both USB Audio Cla
USB Audio Design Guide 13/613.4.1 Driver SupportAudio Class 1.0 had been fully supported in Apple OSX for many years. AudioClass 2.0 has been fully su
USB Audio Design Guide 14/61·The Endpoint 0 core controls the enumeration/configuration tasks of the USBdevice.·The buffering core sends/receives data p
USB Audio Design Guide 15/613.5.4 Audio Request: Setting The Sample RateWhen the host requests a change of sample rate, it sends a command to Endpoint
USB Audio Design Guide 16/61it. This core also determines the size of each packet of audio sent to the host (thusmatching the audio rate to the USB pa
USB Audio Design Guide 17/61The first operation the interrupt handler does is to send back a word acknowledgingthe request (if there was a change of sa
USB Audio Design Guide 18/613.6.4.2 USB Rate ControlThe Audio core must consume data from USB and provide data to USB at the correctrate for the selec
USB Audio Design Guide 19/613.8 Audio DriverThe audio driver receives and transmits samples from/to the decoupler or mixercore over an XC channel. It
USB Audio Design Guide 2/61SYNOPSISThe XMOS USB Audio solution provides USB Audio Class compliant devices over USB 2.0 (high-speed or full-speed). Bas
USB Audio Design Guide 20/61respectively). This master clock input is then provided to the CODEC and the XS1device.3.8.1 Port Configuration (CODEC Slav
USB Audio Design Guide 21/61Divide Output pattern Outputs per sample2 0xAAAAAAAA 24 0xCCCCCCCC 48 0xF0F0F0F0 8Figure 13:OutputpatternsIn any case, the
USB Audio Design Guide 22/61Since the sum of these inputs may be more then the 18 possible mix inputs toeach mixer, there is a mapping from all the po
USB Audio Design Guide 23/61·Set the mapping for physical outputs which can either come directly from theinputs or via the mixer.There is enough flexib
USB Audio Design Guide 24/61To get the audio from the analogue inputs to outputs 1 and 2, nodes 80 and 89need to be set:./ xmos_mixer --set - value 0
USB Audio Design Guide 25/61The core takes PCM audio samples via a channel and outputs them in S/PDIF formatto a port. Audio samples are encapsulated
USB Audio Design Guide 26/61outuint Sample frequency (Hz)outuint Master clock frequency (Hz)outuint Left sampleoutuint Right sampleoutuint Left sample
USB Audio Design Guide 27/61Bits0:3 A tag (see below)4:28 PCM encoded sample value29:31 User bits (parity, etc)Figure 20:S/PDIF RXWordStructureTag Mea
USB Audio Design Guide 28/61case FRAME_X :// Store leftbreak ;case FRAME_Z :// Store rightbreak ;}}3.12 ADAT ReceiveThe ADAT component receives up to
USB Audio Design Guide 29/613.12.1 IntegrationThe ADAT receive function communicates with the clockGen component whichpasses audio data onto the audio
USB Audio Design Guide 3/61Table of Contents1 Overview 42 Hardware Platforms 52.1 USB Audio 2.0 Hardware Reference Design (L-Series) . . . . . . . . .
USB Audio Design Guide 30/61This functionality is enabled by setting theHID_CONTROLSdefine to1. Setting to0disables this feature.When turned on the fol
USB Audio Design Guide 31/613.17 Resource UsageThe following table details the resource usage of each component of the referencedesign software.Compon
USB Audio Design Guide 32/61· S/PDIF Transmitter or MIDIThe diagrams Figure 24 and Figure 25 show the software layout of the code runningon the XS1-L
USB Audio Design Guide 33/613.18.1 Port 32APort 32A on the XS1-L device is a 32-bit wide port that has several separate signalbit signals connected to
USB Audio Design Guide 34/61L8A-64-TQ128 Codec CS4270 11.2896 MHz Crystal 24.576 MHz Crystal MCLK BCLK LRCLK SDIN SDOUT MCLK_SEL Figure 27:Audio Clo
USB Audio Design Guide 35/613.18.3 HIDThe reference design implements basic HID controls. The call tovendor_ReadHidButtons()simply reads from buttons
USB Audio Design Guide 36/613.18.4.1 Configuration 2ioxsThis configuration runs in high-speed Audio Class 2.0 mode, has the mixer disabled,supports 2 ch
USB Audio Design Guide 37/61The software layout is the identical to the single tile L-Series Reference Design andtherefore the diagrams Figure 24 and
USB Audio Design Guide 38/613.19.4 HID ExampleThe codebase includes an example of a HID volume control implementation basedon ADC data. This code shou
USB Audio Design Guide 39/613.19.5.1 Configuration 2ioxsThis configuration runs in high-speed Audio Class 2.0 mode, has the mixer disabled,supports 2 ch
USB Audio Design Guide 4/613.18.4 Validated Build Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.19 The USB Audio 2.0 DJ Ki
USB Audio Design Guide 40/613.20 The USB Audio 2.0 Multichannel Reference Design (L-Series)SoftwareThe USB Audio 2.0 Multichannel Reference Design is
USB Audio Design Guide 41/61tile[0]tile[1]Figure 29:Dual TileL-SeriesReferenceDesign CoreLayout3.20.2.1 Configuration 1All the #defines are set as per t
USB Audio Design Guide 42/613.20.2.3 Configuration 3This configuration supports sample rates up to 192kHz but only supports 10channels in and out. It al
4 Programming GuideIN THIS CHAPTER· Getting Started· Code Structure· A USB Audio Application (walkthrough)· Adding Custom CodeThe following sections p
USB Audio Design Guide 44/61mon build infrastructure inmodule_xmos_common. This system includes the sourcefiles from the relevant modules and is docume
USB Audio Design Guide 45/61module_xud Low level USB librarymodule_usb_shared Common code for USB applicationsmodule_usb_aud_shared Common code for US
USB Audio Design Guide 46/61/* Enable Fall - bac k to aud io clas s 1.0 when c onnec ted to FS hub */# i fndef A UDIO_C L ASS_FA L LBACK# d efine A UD
USB Audio Design Guide 47/61For a full description of all the defines that can be set incustomdefines.hsee §5.1.4.3.2 Configuration FunctionsIn addition
USB Audio Design Guide 48/61t when t i mera fter ( time ) : > int _ ;/* Cod ec out of reset */PORT 32A_P E EK ( tmp ) ;tmp |= P32A_ COD_R S T ;PORT
USB Audio Design Guide 49/61/* Output to por t */asm ( " out res [%0] , %1" ::"r"( XS1_P O RT_32 A ) , "r"(x));}/* Any a
1 OverviewFunctionalityProvides USB interface to digital audio I/O.Supported StandardsUSB USB 2.0 (Full-speed and High-speed)USB Audio Class 1.02USB A
USB Audio Design Guide 50/61{uns igned x ;asm ( " ldw %0, dp[ clk_a udio_ m clk ] " : " = r"(x));asm ( " setc lk res [%0] , %
USB Audio Design Guide 51/61/* MIDI IO / IAP */on stdc ore [ AUDIO _ IO_CO R E ]:{thre ad_sp e ed ();# i fde f MIDIusb _midi ( p_m idi_rx , p_midi_tx
USB Audio Design Guide 52/614.4.1 Example: Changing output formatYou may wish to customize the digital output format e.g. for a CODEC that expectssamp
5 APIIN THIS CHAPTER· Custom Defines· Required User Function Definitions· Component API5.1 Custom DefinesAn application using the USB audio framework nee
USB Audio Design Guide 54/61Define Description DefaultMIXER Define to enable the MIXER. not definedMIN_VOLUMEThe minimum volume setting above -inf.This i
USB Audio Design Guide 55/61void CodecConfig(unsigned samFreq, unsigned mclk, chanend ?c_codec)This function is called when the audio core starts or c
USB Audio Design Guide 56/61chanend ?c_sof,XUD_EpType epTypeTableOut[],XUD_EpType epTypeTableIn[],out port ?p_usb_rst,clock ?clk,unsigned rstMask,unsi
USB Audio Design Guide 57/61reset_maskThe mask to use when sending a reset. The mask is ORed into theport to enable reset, and unset when deasserting
USB Audio Design Guide 58/61c_mix_ctl Optional chanend to be connected to the mixer thread if presentc_clk_ctlOptional chanend to be connected to the
USB Audio Design Guide 59/61c_clk_int Optional chanend connected to the clockGen() thread if presentvoid mixer(chanend c_to_host, chanend c_to_audio,
2 Hardware PlatformsIN THIS CHAPTER· USB Audio 2.0 Hardware Reference Design (L-Series)· USB Audio 2.0 Multichannel Hardware Reference Design (L-Serie
USB Audio Design Guide 60/61c_audio channel connected to the audio() threadc_clk_ctl channel connected to Endpoint0() for configuration of the clockc_c
USB Audio Design Guide 61/61p ADAT port - should be 1-bit and clocked at 100MHzoChan channel on which decoded samples are outputvoid adatReceiver44100
USB Audio Design Guide 62/61Copyright © 2013, All Rights Reserved.Xmos Ltd. is the owner or licensee of this design, code, or Information (collectivel
USB Audio Design Guide 7/61The reference board has an associated firmware application that uses the USBAudio 2.0 software reference platform. Details o
USB Audio Design Guide 8/61The core board includes a U-Series device with integrated USB PHY. The audio sliceboard is equipped with two stereo audio C
3 Software ArchitectureIN THIS CHAPTER· Validated Build Options· Binary Naming· The USB Audio System Architecture· USB Audio Class Support· USB Interf
Comentarios a estos manuales