1. 程式人生 > >Usb Audio Device Descriptor(8) Type I Format Type Descriptor

Usb Audio Device Descriptor(8) Type I Format Type Descriptor

Type I Format Type Descriptor

struct usb_format_type_1
{
    U8 bLength; /*Size of this descriptor, in bytes: 8+(ns*3)*/
    U8 bDescriptorType; /*CS_INTERFACE descriptor type*/
    U8 bDescriptorSubtype; /*FORMAT_TYPE descriptor subtype.*/
    U8 bFormatType; /*FORMAT_TYPE_I. Constant identifying
                    the
Format Type the AudioStreaming interface is using.*/ U8 bNrChannels; /*Indicates the number of physical channels in the audio data stream.*/ U8 bSubframeSize; /*The number of bytes occupied by one audio subframe. Can be 1, 2, 3 or 4.
*/ U8 bBitResolution; /*The number of effectively used bits from the available bits in an audio subframe.*/ U8 bSamFreqType; /*Indicates how the sampling frequency can be programmed: 0: Continuous sampling frequency 1.
.255: The number of discrete sampling frequencies supported by the isochronous data endpoint of the AudioStreaming interface (ns)*/ U8 tLowerSamFreq[3]; /*Lower bound in Hz of the sampling frequency range for this isochronous data endpoint.*/ U8 tUpperSamFreq[3]; /*Upper bound in Hz of the sampling frequency range for this isochronous data endpoint.*/ };

bLength = 8+(ns*3); 當為continous frequecy 時, ns = 2;
bDescriptorType = 0x24; class-specific interface;
bDescriptorSubtype = 0x02; 同input terminal->bDescriptorSubtype, 此時要通過bLength來區別,input terminal->bLength = 12;
bFormatType = 0x01; FORMAT_TYPE_I;
bNrChannels: audio streaming 物理聲道數;
bSubframeSize: 對於一個subframe, 需要多少bytes;
bBitResolution: bit resolution,即多少位的pcm資料;
bSamFreqType: 0 表示 continuous sampling frequecy; 1…ns(max=255)表示離散的sampling freqency;
tLowSamFreq/tUpperSamFreq: Sampling Frequency的高低位;