UAC 特性单元描述符
2021-02-09
3754
0
UAC特性单元描述符即Feature Unit Descriptor,用于描述音频的控制特性,用bmaControls字段的各bit描述各通道支持的特性。
特性单元描述符结构定义
UAC1.0和UAC2.0的结构定义一样。
UINT8 bLength;
UINT8 bDescriptorType;
UINT8 bDescriptorSubtype;
UINT8 bUnitID;
UINT8 bSourceID;
UINT8 bControlSize;
UINT8 bmaControls[ch+1]; //0为主通道,后续依次为各逻辑通道
UINT8 iFeature;
- bLength :描述符总长度。7+(ch+1)*n
- bDescriptorType:描述符类型 CS_INTERFACE = 0x24
- bDescriptorSubtype:描述符子类型 FEATURE_UNIT = 0x06
- bUnitID:惟一的标识ID
- bSourceID:数据源ID.
- bControlSize:每个bControlSize的字节数。
bmaControls[0]:偏移为6,长度为bControlSize。位设为1表示主通道0支持上述控制:
- D0:Mute 静音
- D1:Volume 声音
- D2:Bass 低音
- D3:Mid 中音
- D4:Treble 高音
- D5:Graphic Equalizer图形均衡器
- D6:Automatic Gain 自动增益
- D7:Delay 延迟
- D8:Bass Boost 低音增强
- D9: Loudness 响度
- D10..(n*8-1):保留
bmaControls(1):偏移为6+bControlSize,长度为bControlSize,表示逻辑通道1支持的特性。
- 后续一直到逻辑通道N
- iFeature:特性单元描述符的字符串索引。
如有2个通道的特性单元描述示例:
-------- Audio Control Feature Unit Descriptor --------
bLength : 0x0D (13 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x06 (Feature Unit)
bUnitID : 0x02 (2)
bSourceID : 0x01 (1)
bControlSize : 0x02 (2 bytes per control)
bmaControls[0] : 0x03, 0x00 //主通道
D0: Mute : 1
D1: Volume : 1
D2: Bass : 0
D3: Mid : 0
D4: Treble : 0
D5: Graphic Equalizer : 0
D6: Automatic Gain : 0
D7: Delay : 0
D8: Bass Boost : 0
D9: Loudness : 0
D10: Reserved : 0
D11: Reserved : 0
D12: Reserved : 0
D13: Reserved : 0
D14: Reserved : 0
D15: Reserved : 0
bmaControls[1] : 0x00, 0x00 //逻辑通道1
D0: Mute : 0
D1: Volume : 0
D2: Bass : 0
D3: Mid : 0
D4: Treble : 0
D5: Graphic Equalizer : 0
D6: Automatic Gain : 0
D7: Delay : 0
D8: Bass Boost : 0
D9: Loudness : 0
D10: Reserved : 0
D11: Reserved : 0
D12: Reserved : 0
D13: Reserved : 0
D14: Reserved : 0
D15: Reserved : 0
bmaControls[2] : 0x00, 0x00 //逻辑通道2
D0: Mute : 0
D1: Volume : 0
D2: Bass : 0
D3: Mid : 0
D4: Treble : 0
D5: Graphic Equalizer : 0
D6: Automatic Gain : 0
D7: Delay : 0
D8: Bass Boost : 0
D9: Loudness : 0
D10: Reserved : 0
D11: Reserved : 0
D12: Reserved : 0
D13: Reserved : 0
D14: Reserved : 0
D15: Reserved : 0
iFeature : 0x00 (No String Descriptor)
Data (HexDump) : 0D 24 06 02 01 02 03 00 00 00 00 00 00 .$...........
UAC接口类型表
Descriptor Type | Value |
---|---|
CS_UNDEFINED | 0x20 |
CS_DEVICE | 0x21 |
CS_CONFIGURATION | 0x22 |
CS_STRING | 0x23 |
CS_INTERFACE | 0x24 |
CS_ENDPOINT | 0x25 |
Descriptor Subtype | Value |
---|---|
AC_DESCRIPTOR_UNDEFINED | 0x00 |
HEADER | 0x01 |
INPUT_TERMINAL | 0x02 |
OUTPUT_TERMINAL | 0x03 |
MIXER_UNIT | 0x04 |
SELECTOR_UNIT | 0x05 |
FEATURE_UNIT | 0x06 |
PROCESSING_UNIT | 0x07 |
EXTENSION_UNIT | 0x08 |
HID人机交互QQ群:564808376
UAC音频QQ群:218581009
UVC相机QQ群:331552032
BOT&UASP大容量存储QQ群:258159197
STC-USB单片机QQ群:315457461
USB技术交流QQ群2:580684376
USB技术交流QQ群:952873936