本帖最后由 sssare 于 2025-7-11 14:44 编辑
在整合官方例程CDC和UAC时,发现整合出来代码在电脑上呈现这样的效果
 
如果这时安装了虚拟端口驱动,设备管理器这里又变成只剩一个虚拟端口,而另一个UAC设备就消失了

我使用的是下面的这两个例程来整合,用的板子是国民的G455demo板

以下是从USBtreeview读出的相关描述符
=========================== USB Port1 ===========================
Connection Status : 0x01 (Device is connected)
Port Chain :
========================== Summary =========================
Vendor ID : 0x19F5 (Nationz Technologies Inc.)
Product ID : 0x5740
Manufacturer String : "NATIONS"
Product String : "N32G45x Port "
Serial : "N32G45x"
USB Version : 2.0 (but 12 Mbit/s FullSpeed only)
Port maximum Speed : High-Speed
Device maximum Speed : Full-Speed
Device Connection Speed : Full-Speed
Self powered : yes
Demanded Current : 100 mA
Used Endpoints : 4
======================== USB Device ========================
+++++++++++++++++ Device Information ++++++++++++++++++
Friendly Name : NS-Virtual-Port (COM37)
Device Description : USB Composite Device
Device Path : \\?\USB#VID_19F5&PID_5740#N32G45x#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name : \Device\USBPDO-4
Device ID : USB\VID_19F5&PID_5740\N32G45X
Hardware IDs : USB\VID_19F5&PID_5740&REV_0200 USB\VID_19F5&PID_5740
Driver KeyName : {36fc9e60-c465-11cf-8056-444553540000}\0049 (GUID_DEVCLASS_USB)
Driver : system32\DRIVERS\usbser.sys (Version: 6.1.7601.23403 Date: 2016-03-26 Company: Microsoft Corporation)
Driver Inf : C:\windows\inf\usb.inf
Legacy BusType : PNPBus
Class : USB
Class GUID : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service : usbccgp
Enumerator : USB
Location Info : Port_#0001.Hub_#0004
Address : 1
Location IDs : PCIROOT(0)#PCI(1D00)#USBROOT(0)#USB(1)#USB(1)
Container ID : {5d4b33a9-448e-56f5-a39a-4e3c5f40100f}
Manufacturer Info : (标准 USB 主控制器)
Capabilities : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code : 0
Address : 1
First Install Date : 2025-07-11 11:36:45
Bus Relations : USB\VID_19F5&PID_5740&MI_00\7&11db9156&15&0000, USB\VID_19F5&PID_5740&MI_02\7&11db9156&15&0002
EnhancedPowerMgmtEnabled : 0
Power State : D0 (supported: D0, D3, wake from D0)
+++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\19F557400200
osvc : REG_BINARY 00 00
SkipContainerIdQuery : REG_BINARY 01 00 00 00
---------------- Connection Information ---------------
Connection Index : 0x01 (Port 1)
Connection Status : 0x01 (DeviceConnected)
Current Config Value : 0x01 (Configuration 1)
Device Address : 0x02 (2)
Is Hub : 0x00 (no)
Device Bus Speed : 0x01 (Full-Speed)
Number of open Pipes : 0x03 (3 pipes to data endpoints)
Pipe[0] : EndpointID=2 Direction=IN ScheduleOffset=0 Type=Interrupt wMaxPacketSize=0x8 bInterval=255 -> 196 Bits/ms = 24500 Bytes/s
Pipe[1] : EndpointID=3 Direction=OUT ScheduleOffset=0 Type=Bulk wMaxPacketSize=0x40 bInterval=0
Pipe[2] : EndpointID=1 Direction=IN ScheduleOffset=0 Type=Bulk wMaxPacketSize=0x40 bInterval=0
Data (HexDump) : 01 00 00 00 12 01 00 02 EF 02 01 40 F5 19 40 57 ...........@..@W
00 02 01 02 03 01 01 01 00 02 00 03 00 00 00 01 ................
00 00 00 07 05 82 03 08 00 FF 00 00 00 00 07 05 ................
03 02 40 00 00 00 00 00 00 07 05 81 02 40 00 00 ..@..........@..
00 00 00 00 ....
---------------------- Device Descriptor ----------------------
bLength : 0x12 (18 bytes)
bDescriptorType : 0x01 (Device Descriptor)
bcdUSB : 0x200 (USB Version 2.0) -> but device is Full-Speed only
bDeviceClass : 0xEF (Miscellaneous)
bDeviceSubClass : 0x02
bDeviceProtocol : 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0 : 0x40 (64 bytes)
idVendor : 0x19F5 (Nationz Technologies Inc.)
idProduct : 0x5740
bcdDevice : 0x0200
iManufacturer : 0x01 (String Descriptor 1)
Language 0x0409 : "NATIONS"
iProduct : 0x02 (String Descriptor 2)
Language 0x0409 : "N32G45x Port "
iSerialNumber : 0x03 (String Descriptor 3)
Language 0x0409 : "N32G45x"
bNumConfigurations : 0x01 (1 Configuration)
Data (HexDump) : 12 01 00 02 EF 02 01 40 F5 19 40 57 00 02 01 02 .......@..@W....
03 01 ..
------------------ Configuration Descriptor -------------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x02 (Configuration Descriptor)
wTotalLength : 0x00B7 (183 bytes)
bNumInterfaces : 0x04 (4 Interfaces)
bConfigurationValue : 0x01 (Configuration 1)
iConfiguration : 0x00 (No String Descriptor)
bmAttributes : 0xC0
D7: Reserved, set 1 : 0x01
D6: Self Powered : 0x01 (yes)
D5: Remote Wakeup : 0x00 (no)
D4..0: Reserved, set 0 : 0x00
MaxPower : 0x32 (100 mA)
Data (HexDump) : 09 02 B7 00 04 01 00 C0 32 08 0B 00 02 02 02 01 ........2.......
00 09 04 00 00 01 02 02 01 00 05 24 00 10 01 05 ...........$....
24 01 00 01 04 24 02 02 05 24 06 00 01 07 05 82 $....$...$......
03 08 00 FF 09 04 01 00 02 0A 00 00 00 07 05 03 ................
02 40 00 00 07 05 81 02 40 00 00 08 0B 02 02 01 .@......@.......
01 00 00 09 04 02 00 00 01 01 00 01 09 24 01 00 .............$..
01 27 00 01 02 0C 24 02 01 01 01 00 01 00 00 00 .'....$.........
00 09 24 06 02 01 01 01 00 00 09 24 03 03 01 03 ..$........$....
00 02 00 09 04 03 00 00 01 02 00 00 09 04 03 01 ................
01 01 02 00 00 07 24 01 01 01 02 00 0B 24 02 01 ......$......$..
01 01 08 01 80 3E 00 09 05 04 01 16 00 01 00 00 .....>..........
07 25 01 00 00 00 00 .%.....
------------------- IAD Descriptor --------------------
bLength : 0x08 (8 bytes)
bDescriptorType : 0x0B (Interface Association Descriptor)
bFirstInterface : 0x00 (Interface 0)
bInterfaceCount : 0x02 (2 Interfaces)
bFunctionClass : 0x02 (Communications and CDC Control)
bFunctionSubClass : 0x02
bFunctionProtocol : 0x01
iFunction : 0x00 (No String Descriptor)
Data (HexDump) : 08 0B 00 02 02 02 01 00 ........
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x00 (Interface 0)
bAlternateSetting : 0x00
bNumEndpoints : 0x01 (1 Endpoint)
bInterfaceClass : 0x02 (Communications and CDC Control)
bInterfaceSubClass : 0x02 (Abstract Control Model)
bInterfaceProtocol : 0x01 (AT Commands defined by ITU-T V.250 etc)
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 00 00 01 02 02 01 00 .........
-------------- CDC Interface Descriptor ---------------
bFunctionLength : 0x05 (5 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x00 (Header Functional Descriptor)
bcdCDC : 0x110 (CDC Version 1.10)
Data (HexDump) : 05 24 00 10 01 .$...
-------------- CDC Interface Descriptor ---------------
bFunctionLength : 0x05 (5 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x01 (Call Management Functional Descriptor)
bmCapabilities : 0x00
D7..2 : 0x00 (Reserved)
D1 : 0x00 (sends/receives call management information only over the Communication Class interface)
D0 : 0x00 (does not handle call management itself)
bDataInterface : 0x01
Data (HexDump) : 05 24 01 00 01 .$...
-------------- CDC Interface Descriptor ---------------
bFunctionLength : 0x04 (4 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x02 (Abstract Control Management Functional Descriptor)
bmCapabilities : 0x02
D7..4 : 0x00 (Reserved)
D3 : 0x00 (not supports the notification Network_Connection)
D2 : 0x00 (not supports the request Send_Break)
D1 : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State)
D0 : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)
Data (HexDump) : 04 24 02 02 .$..
-------------- CDC Interface Descriptor ---------------
bFunctionLength : 0x05 (5 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x06 (Union Functional Descriptor)
bControlInterface : 0x00
bSubordinateInterface[0] : 0x01
Data (HexDump) : 05 24 06 00 01 .$...
----------------- Endpoint Descriptor -----------------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x82 (Direction=IN EndpointID=2)
bmAttributes : 0x03 (TransferType=Interrupt)
wMaxPacketSize : 0x0008 (8 bytes)
bInterval : 0xFF (255 ms)
Data (HexDump) : 07 05 82 03 08 00 FF .......
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x01 (Interface 1)
bAlternateSetting : 0x00
bNumEndpoints : 0x02 (2 Endpoints)
bInterfaceClass : 0x0A (CDC-Data)
bInterfaceSubClass : 0x00
bInterfaceProtocol : 0x00
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 01 00 02 0A 00 00 00 .........
----------------- Endpoint Descriptor -----------------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x03 (Direction=OUT EndpointID=3)
bmAttributes : 0x02 (TransferType=Bulk)
wMaxPacketSize : 0x0040 (64 bytes)
bInterval : 0x00 (ignored)
Data (HexDump) : 07 05 03 02 40 00 00 ....@..
----------------- Endpoint Descriptor -----------------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x81 (Direction=IN EndpointID=1)
bmAttributes : 0x02 (TransferType=Bulk)
wMaxPacketSize : 0x0040 (64 bytes)
bInterval : 0x00 (ignored)
Data (HexDump) : 07 05 81 02 40 00 00 ....@..
------------------- IAD Descriptor --------------------
bLength : 0x08 (8 bytes)
bDescriptorType : 0x0B (Interface Association Descriptor)
bFirstInterface : 0x02 (Interface 2)
bInterfaceCount : 0x02 (2 Interfaces)
bFunctionClass : 0x01 (Audio)
bFunctionSubClass : 0x01 (Audio Control)
bFunctionProtocol : 0x00
iFunction : 0x00 (No String Descriptor)
Data (HexDump) : 08 0B 02 02 01 01 00 00 ........
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x02 (Interface 2)
bAlternateSetting : 0x00
bNumEndpoints : 0x00 (Default Control Pipe only)
bInterfaceClass : 0x01 (Audio)
bInterfaceSubClass : 0x01 (Audio Control)
bInterfaceProtocol : 0x00
iInterface : 0x01 (String Descriptor 1)
Language 0x0409 : "NATIONS"
Data (HexDump) : 09 04 02 00 00 01 01 00 01 .........
------ Audio Control Interface Header Descriptor ------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x01 (Header)
bcdADC : 0x0100
wTotalLength : 0x0027 (39 bytes)
bInCollection : 0x01
baInterfaceNr[1] : 0x02
Data (HexDump) : 09 24 01 00 01 27 00 01 02 .$...'...
------- Audio Control Input Terminal Descriptor -------
bLength : 0x0C (12 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x02 (Input Terminal)
bTerminalID : 0x01
wTerminalType : 0x0101 (USB Streaming)
bAssocTerminal : 0x00
bNrChannels : 0x01 (1 channel)
wChannelConfig : 0x0000 (-)
iChannelNames : 0x00 (No String Descriptor)
iTerminal : 0x00 (No String Descriptor)
Data (HexDump) : 0C 24 02 01 01 01 00 01 00 00 00 00 .$..........
-------- Audio Control Feature Unit Descriptor --------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x06 (Feature Unit)
bUnitID : 0x02 (2)
bSourceID : 0x01 (1)
bControlSize : 0x01 (1 byte per control)
bmaControls[0] : 0x01
D0: Mute : 1
D1: Volume : 0
D2: Bass : 0
D3: Mid : 0
D4: Treble : 0
D5: Graphic Equalizer : 0
D6: Automatic Gain : 0
D7: Delay : 0
bmaControls[1] : 0x00
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
iFeature : 0x00 (No String Descriptor)
Data (HexDump) : 09 24 06 02 01 01 01 00 00 .$.......
------- Audio Control Output Terminal Descriptor ------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x03 (Output Terminal)
bTerminalID : 0x03
wTerminalType : 0x0301 (Speaker)
bAssocTerminal : 0x00 (0)
bSourceID : 0x02 (2)
iTerminal : 0x00 (No String Descriptor)
Data (HexDump) : 09 24 03 03 01 03 00 02 00 .$.......
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x03 (Interface 3)
bAlternateSetting : 0x00
bNumEndpoints : 0x00 (Default Control Pipe only)
bInterfaceClass : 0x01 (Audio)
bInterfaceSubClass : 0x02 (Audio Streaming)
bInterfaceProtocol : 0x00
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 03 00 00 01 02 00 00 .........
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x03 (Interface 3)
bAlternateSetting : 0x01
bNumEndpoints : 0x01 (1 Endpoint)
bInterfaceClass : 0x01 (Audio)
bInterfaceSubClass : 0x02 (Audio Streaming)
bInterfaceProtocol : 0x00
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 03 01 01 01 02 00 00 .........
-------- Audio Streaming Interface Descriptor ---------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x01 (AS_GENERAL)
bTerminalLink : 0x01 (Terminal ID 1)
bDelay : 0x01 (1 frame)
wFormatTag : 0x0002 (PCM8)
Data (HexDump) : 07 24 01 01 01 02 00 .$.....
------- Audio Streaming Format Type Descriptor --------
bLength : 0x0B (11 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x02 (Format Type)
bFormatType : 0x01 (FORMAT_TYPE_I)
bNrChannels : 0x01 (1 channel)
bSubframeSize : 0x01 (1 bytes per subframe)
bBitResolution : 0x08 (8 bits per sample)
bSamFreqType : 0x01 (supports 1 sample frequence)
tSamFreq[1] : 0x03E80 (16000 Hz)
Data (HexDump) : 0B 24 02 01 01 01 08 01 80 3E 00 .$.......>.
----------------- Endpoint Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x04 (Direction=OUT EndpointID=4)
bmAttributes : 0x01 (TransferType=Isochronous SyncType=None EndpointType=Data)
wMaxPacketSize : 0x0016 (22 bytes)
bInterval : 0x01 (1 ms)
bRefresh : 0x00
bSynchAddress : 0x00
Data (HexDump) : 09 05 04 01 16 00 01 00 00 .........
----------- Audio Data Endpoint Descriptor ------------
bLength : 0x07 (7 bytes)
bDescriptorType : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype : 0x01 (General)
bmAttributes : 0x00
D0 : Sampling Freq : 0x00 (not supported)
D1 : Pitch : 0x00 (not supported)
D6..2: Reserved : 0x00
D7 : MaxPacketsOnly : 0x00 (no)
bLockDelayUnits : 0x00 (Undefined)
wLockDelay : 0x0000
Data (HexDump) : 07 25 01 00 00 00 00 .%.....
----------------- Device Qualifier Descriptor -----------------
Error : ERROR_GEN_FAILURE (because the device is Full-Speed only)
-------------------- String Descriptors -------------------
------ String Descriptor 0 ------
bLength : 0x04 (4 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language ID[0] : 0x0409 (English - United States)
Data (HexDump) : 04 03 09 04 ....
------ String Descriptor 1 ------
bLength : 0x26 (38 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language 0x0409 : "NATIONS°°°°°°°°°°°" *!*ERROR contains 11 NULL characters
Data (HexDump) : 26 03 4E 00 41 00 54 00 49 00 4F 00 4E 00 53 00 &.N.A.T.I.O.N.S.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 ......
------ String Descriptor 2 ------
bLength : 0x32 (50 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language 0x0409 : "N32G45x Port °°°°°°°°°°" *!*ERROR contains 10 NULL characters
Data (HexDump) : 32 03 4E 00 33 00 32 00 47 00 34 00 35 00 78 00 2.N.3.2.G.4.5.x.
20 00 50 00 6F 00 72 00 74 00 20 00 20 00 00 00 .P.o.r.t. . ...
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 ..
------ String Descriptor 3 ------
bLength : 0x1A (26 bytes)
bDescriptorType : 0x03 (String Descriptor)
Language 0x0409 : "N32G45x°°°°°" *!*ERROR contains 5 NULL characters
Data (HexDump) : 1A 03 4E 00 33 00 32 00 47 00 34 00 35 00 78 00 ..N.3.2.G.4.5.x.
00 00 00 00 00 00 00 00 00 00 ..........
|