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

陆阳曜
2023-12-01

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的高低位;

 类似资料: