usbip-win2 icon indicating copy to clipboard operation
usbip-win2 copied to clipboard

Insights on why audio devices don't work with UDE

Open nefarius opened this issue 1 year ago • 29 comments

Ahoy!

Thought this project might be interested in my findings as it took me and a colleague months to figure it out 🤪

Cheers, and keep up the good work!

nefarius avatar Mar 26 '23 12:03 nefarius

Thank you very much! I'll implement QueryBusTime as WDM driver does. WDM driver implements many similar stuff, that's why most devices work.

vadimgrn avatar Mar 26 '23 13:03 vadimgrn

Great! here's a snippet on what worked for me:

static
NTSTATUS
USB_BUSIFFN
UsbInterfaceQueryBusTime(
	IN PVOID BusContext,
	IN OUT PULONG CurrentUsbFrame
)
{
	FuncEntry(TRACE_DEVICE);

	const PCHILD_DEVICE_CONTEXT pCtx = ChildDeviceGetContext(BusContext);

	NTSTATUS status = pCtx->OriginalInterface.QueryBusTime(
		pCtx->OriginalInterface.BusContext,
		CurrentUsbFrame
	);

	if (CurrentUsbFrame)
	{
		TraceInformation(
			TRACE_DEVICE,
			"UsbInterfaceQueryBusTime.CurrentUsbFrame = %d",
			*CurrentUsbFrame
		);
	}

	// fake-succeed the call
	if (CurrentUsbFrame && status == STATUS_NOT_SUPPORTED)
	{
		*CurrentUsbFrame = 0;
		status = STATUS_SUCCESS;
	}

	FuncExit(TRACE_DEVICE, "status=%!STATUS!", status);

	return status;
}

nefarius avatar Mar 26 '23 13:03 nefarius

I my case audio device does not work for another reason. The kernel sets interface 1.1 and issues ISOCH transfers, but UDE has not called yet EVT_UDECX_USB_DEVICE_ENDPOINTS_CONFIGURE to set 1.1. My driver does not receive ISOCH transfers at all, because UDE fails them. I still can't comprehend a logic of EVT_UDECX_USB_DEVICE_ENDPOINTS_CONFIGURE.

# UDE
endpoint_add:dev bbdfbdc8, endp cc2b4798{Address 0000: Ctrl Out[0], MaxPacketSize 0, Interval 0}, queue c701d758
	0000  07050000 000000                      .......

# filter driver
select_interface:ConfigurationHandle 4d1a1320
Interface(Length 24, InterfaceNumber 1, AlternateSetting 0, Class 0x1, SubClass 0x2, Protocol 00, InterfaceHandle 465b8aa0, NumberOfPipes 0)

# UDE
endpoint_add:dev bbdfbdc8, endp cc2b4c18{Address 0x06: Isoch Out[6], MaxPacketSize 192, Interval 1}, queue c790c4d8
	0000  09050609 C0000100 00                 .........

# UDE
endpoints_configure:dev bbdfbdc8, EndpointsToConfigure[1]
	0000  184C2BCC 7C590000                    .L+.|Y..

# UDE
endpoints_configure:dev bbdfbdc8, InterfaceNumber 1, NewInterfaceSetting 0

# filter driver
select_interface:ConfigurationHandle 4d1a1320
Interface(Length 48, InterfaceNumber 1, AlternateSetting 1, Class 0x1, SubClass 0x2, Protocol 00, InterfaceHandle 4ac3dda0, NumberOfPipes 1)
Pipes[0](MaximumPacketSize 0xc0, EndpointAddress 0x6 OUT[6], Interval 0x1, Isoch, PipeHandle 39cc5be0, MaximumTransferSize 0x17700, PipeFlags 0x8)

# UDE, reset endpoint ISOCH OUT[6]
control_transfer:req bf66a4d8 -> PipeHandle 3afaf3d0, OUT|SHORT_OK|DEFAULT_PIPE, TransferBufferLength 3, Timeout 0, {OUT|CLASS|ENDPOINT, CLEAR_FEATURE(0x1), wValue 0x100, wIndex 0x06, wLength 0x03(3)}

# filter driver, ISOCH transfers did not reach the main driver (because UDE has not selected interface 1.1 yet?)
ISOCH: PipeHandle 39cc5be0, OUT|ISO_ASAP, TransferBufferLength 1920, StartFrame 0, NumberOfPackets 10, ErrorCount 0
dev 4e64d7d0, ISOCH_TRANSFER, USBD_STATUS_INVALID_PARAMETER, 0xc000000d(STATUS_INVALID_PARAMETER)

# filter driver
dev 4e64d7d0, SYNC_RESET_PIPE_AND_CLEAR_STALL, PipeHandle 39cc5be0

...

# UDE does not receieve these ISOCH

endpoint_purge:dev bbdfbdc8, endp cc2b4c18, queue c790c4d8
endpoint_start:endp cc2b4c18, queue c790c4d8
...

endpoint_purge:dev bbdfbdc8, endp cc2b4c18, queue c790c4d8

endpoints_configure:dev bbdfbdc8, ReleasedEndpoints[1]
	0000  184C2BCC 7C590000                    .L+.|Y..

# too late
endpoints_configure:dev bbdfbdc8, InterfaceNumber 1, NewInterfaceSetting 1

# filter driver
select_interface:ConfigurationHandle 4d1a1320
Interface(Length 24, InterfaceNumber 1, AlternateSetting 0, Class 0x1, SubClass 0x2, Protocol 00, InterfaceHandle 465b5ea0, NumberOfPipes 0)

vadimgrn avatar Apr 10 '23 11:04 vadimgrn

I haven't yet used dynamic endpoints myself so there might be other lingering issues nobody has addressed yet 🤔

nefarius avatar Apr 11 '23 16:04 nefarius

Here I'm describing results of my work on this issue. It stubbornly does not work, no matter what I do. Sequence of events in the filter driver:

- Select interface 1.1 which has ISOCH OUT (address 0x6) endpoint
- OUT|CLASS|ENDPOINT, CLEAR_FEATURE(0x1), wValue 0x100, wIndex 0x06, wLength 3
- ucx01000 fails ISOCH OUT transfer with USBD_STATUS_INVALID_PARAMETER, STATUS_INVALID_PARAMETER
- ABORT_PIPE
- SYNC_RESET_PIPE_AND_CLEAR_STALL
- ISOCH OUT ...

vadimgrn avatar Apr 13 '23 09:04 vadimgrn

Sequence of events int the main driver

select_interface 1.1
control_transfer {OUT|CLASS|ENDPOINT, CLEAR_FEATURE(0x1), wValue 0x100, wIndex 0x06, wLength 0x03(3)}

endpoint_purge
endpoint_start
clear_endpoint_stall

endpoint_purge
...

vadimgrn avatar Apr 13 '23 09:04 vadimgrn

It does not work even if complete ISOCH transfers in the filter driver. The result is the same, the loop of {ABORT_PIPE, SYNC_RESET_PIPE_AND_CLEAR_STALL, ISOCH OUT}. I have no more ideas what to do to avoid this.

Call stack when filter detects that ISOCH out is failed. ucx01000!UrbHandler_USBPORTStyle_Legacy_IsochTransfer completes IRP with the error.

PROCESS_NAME:  audiodg.exe

STACK_TEXT:  
usbip2_filter!`anonymous namespace'::irp_completed+0x261 [D:\usbip-win2\drivers\ude_filter\int_dev_ctrl.cpp @ 207] 
nt!IopUnloadSafeCompletion+0x56
nt!IovpLocalCompletionRoutine+0x16e
nt!IopfCompleteRequest+0x1b4
nt!IovCompleteRequest+0x1e1
nt!IofCompleteRequest+0x1c522d
ucx01000!UrbHandler_USBPORTStyle_Legacy_IsochTransfer+0x2a5
ucx01000!Urb_USBPORTStyle_ProcessURB+0x28b
ucx01000!RootHub_Pdo_EvtInternalDeviceControlIrpPreprocessCallback+0xc3
Wdf01000!PreprocessIrp+0x58 [minkernel\wdf\framework\shared\core\fxdevice.cpp @ 1519] 
Wdf01000!FxDevice::DispatchWithLock+0x46a4 [minkernel\wdf\framework\shared\core\fxdevice.cpp @ 1445] 
nt!DifIRP_MJ_INTERNAL_DEVICE_CONTROLWrapper+0xdb
nt!IopfCallDriver+0x53
nt!IovCallDriver+0x5f
nt!IofCallDriver+0x2081f1
UsbHub3!HUBPDO_EvtDeviceWdmIrpPreprocess+0x4db
Wdf01000!PreprocessIrp+0x58 [minkernel\wdf\framework\shared\core\fxdevice.cpp @ 1519] 
Wdf01000!FxDevice::DispatchWithLock+0x46a4 [minkernel\wdf\framework\shared\core\fxdevice.cpp @ 1445] 
nt!IopfCallDriver+0x53
nt!IovCallDriver+0x5f
nt!IofCallDriver+0x2081f1
usbip2_filter!`anonymous namespace'::pre_process_irp+0xd4 [D:\usbip-win2\drivers\ude_filter\int_dev_ctrl.cpp @ 233] 
usbip2_filter!usbip::int_dev_ctrl+0x13b [D:\usbip-win2\drivers\ude_filter\int_dev_ctrl.cpp @ 253] 
nt!DifIRP_MJ_INTERNAL_DEVICE_CONTROLWrapper+0xdb
nt!IopfCallDriver+0x53
nt!IovCallDriver+0x5f
nt!IofCallDriver+0x2081f1
usbccgp!DispatchPdoUrb+0x2d2
usbccgp!DispatchPdoInternalDeviceControl+0x1db
usbccgp!USBC_Dispatch+0x282
nt!IopfCallDriver+0x53
nt!IovCallDriver+0x5f
nt!IofCallDriver+0x2081f1
usbaudio!USBType1BuildIsochUrbRequest+0x47c
usbaudio!USBType1ProcessStreamPointer+0x57
usbaudio!USBType1ProcessPin+0x8e
usbaudio!PinProcess+0x64
ks!CKsPin::ProcessingObjectWork+0x9d
ks!CKsPin::Process+0x79
ks!CKsQueue::SetDeviceState+0x2f7
ks!CKsPipeSection::DistributeDeviceStateChange+0x6b
ks!CKsPipeSection::SetDeviceState+0x30d
ks!CKsPin::Property_ConnectionState+0x362
ks!KspPropertyHandler+0x453
ks!KspHandleAutomationIoControl+0xce
ks!CKsPin::DispatchDeviceIoControl+0x1fd
ks!KsDispatchIrp+0x5c
usbaudio!UsbAudioIrpDispatcher+0x5b
nt!IopfCallDriver+0x53
nt!IovCallDriver+0x5f
nt!IofCallDriver+0x2081f1
ksthunk!CKernelFilterDevice::DispatchIrp+0xf0
ksthunk!CKernelFilterDevice::DispatchIrpBridge+0x13
nt!IopfCallDriver+0x53
nt!IovCallDriver+0x5f
nt!IofCallDriver+0x2081f1
nt!IopSynchronousServiceTail+0x1d0
nt!IopXxxControlFile+0x72c
nt!NtDeviceIoControlFile+0x56
nt!KiSystemServiceCopyEnd+0x25

vadimgrn avatar Apr 13 '23 09:04 vadimgrn

Here I'm describing results of my work on this issue. It stubbornly does not work, no matter what I do. Sequence of events in the filter driver:

- Select interface 1.1 which has ISOCH OUT (address 0x6) endpoint
- OUT|CLASS|ENDPOINT, CLEAR_FEATURE(0x1), wValue 0x100, wIndex 0x06, wLength 3
- ucx01000 fails ISOCH OUT transfer with USBD_STATUS_INVALID_PARAMETER, STATUS_INVALID_PARAMETER
- ABORT_PIPE
- SYNC_RESET_PIPE_AND_CLEAR_STALL
- ISOCH OUT ...

This sequence ocurres because of the missing QueryBusTime implementation.

nefarius avatar Apr 13 '23 10:04 nefarius

QueryBusTime is implemented, it doesn't affect on this issue.

vadimgrn avatar Apr 13 '23 11:04 vadimgrn

QueryBusTime is implemented, it doesn't affect on this issue.

I see, I got PTSD hunting down ABORT_PIPE, SYNC_RESET_PIPE_AND_CLEAR_STALL sequences for weeks 😅

nefarius avatar Apr 13 '23 11:04 nefarius

The question is what argument is incorrect, all members of UrbIsochronousTransfer look the same as in WDM driver. By the way, transfer flags has USBD_START_ISO_TRANSFER_ASAP, thus StartFrame is set to zero.

vadimgrn avatar Apr 13 '23 11:04 vadimgrn

QueryBusTime affected only USB Audio card which works now. All headsets and speaker don't work, I've spent a huge amount of time trying in vain to figure out what's wrong. If I had sources of ucx1000, the reason of the error would be detected instantly.

vadimgrn avatar Apr 20 '23 08:04 vadimgrn

This is a configuration descriptor of my audio speaker (length 116 or 0x74)

0000  09027400 02010080 FA090400 00000101  ..t.............
0010  00000924 0100012B 0001010C 24020101  ...$...+....$...
0020  01000203 0000000D 24060D01 02010202  ........$.......
0030  00020000 09240303 0103000D 00090401  .....$..........
0040  00000102 00000904 01010101 02000007  ................
0050  24010101 01000E24 02010202 100244AC  $......$......D.
0060  0080BB00 09050609 C0000100 00072501  ..............%.
0070  01000000                             ....

USBD_ValidateConfigurationDescriptor returns

USBD_STATUS_BAD_DESCRIPTOR_BLEN, offset 0x64(100)
	0000  09050609 C0000100 00072501 01000000  ..........%.....

It does not like audio endpoint length 9. I tried to return a corrected version of the descriptor, but it didn't help, the same USBD_STATUS_INVALID_PARAMETER for isoch transfers.

char s[115] = 
"\x09\x02\x72\x00\x02\x01\x00\x80\xFA\x09\x04\x00\x00\x00\x01\x01"
"\x00\x00\x09\x24\x01\x00\x01\x2B\x00\x01\x01\x0C\x24\x02\x01\x01"
"\x01\x00\x02\x03\x00\x00\x00\x0D\x24\x06\x0D\x01\x02\x01\x02\x02"
"\x00\x02\x00\x00\x09\x24\x03\x03\x01\x03\x00\x0D\x00\x09\x04\x01"
"\x00\x00\x01\x02\x00\x00\x09\x04\x01\x01\x01\x01\x02\x00\x00\x07"
"\x24\x01\x01\x01\x01\x00\x0E\x24\x02\x01\x02\x02\x10\x02\x44\xAC"
"\x00\x80\xBB\x00\x07\x05\x06\x09\xC0\x00\x01\x07\x25\x01"
"\x01\x00\x00\x00";

vadimgrn avatar Jun 04 '23 09:06 vadimgrn

udecx default set usb2.0 port status is HighSpeedDeviceAttached, but usb audio device is full speed device, UsbHub3 check isoch_transfer packets number alignment is not match 64 (for High speed ) , so irp complete status USBD_STATUS_INVALID_PARAMETER, these urb packets is not send to usbip-ude drivers.

bozax avatar Mar 12 '24 03:03 bozax

Thank you very much, this is very valuable info for me! I'll deal with that as soon as will have free time.

vadimgrn avatar Mar 12 '24 06:03 vadimgrn

Do you know the best way to fix that?

vadimgrn avatar Mar 12 '24 12:03 vadimgrn

udecx default set usb2.0 port status is HighSpeedDeviceAttached, but usb audio device is full speed device, UsbHub3 check isoch_transfer packets number alignment is not match 64 (for High speed ) , so irp complete status USBD_STATUS_INVALID_PARAMETER, these urb packets is not send to usbip-ude drivers.

This post is golden; I remember now that I noticed the UDE child device starting to act differently when I changed the device speed flags on creation and until now didn't know the details why that happened, or that it in fact did happen and I didn't just hallucinate 😅

nefarius avatar Mar 12 '24 12:03 nefarius

Do you know how the best way to fix that?

When calling UdecxUsbDeviceInitSetSpeed set it to UdecxUsbHighSpeed instead of UdecxUsbFullSpeed (see)

nefarius avatar Mar 12 '24 12:03 nefarius

I always knew that it will be very simple fix. But I didn't notice that it is due to the device speed. Great! UDE has added its own issues and oddities that WDM driver never had.

vadimgrn avatar Mar 12 '24 16:03 vadimgrn

UdecxUsbDeviceInitSetSpeed The speed also determines the kind of port to which the device can connect. For example, a USB SuperSpeed device cannot connect to a USB 2.0 port. This set only check for device speed is fit for usb port, it's not affect port status. I'm try to fix interface‘s IsDeviceHighSpeed routine return false,it's not affect port status.

bozax avatar Mar 13 '24 10:03 bozax

Do you know how the best way to fix that?

When calling UdecxUsbDeviceInitSetSpeed set it to UdecxUsbHighSpeed instead of UdecxUsbFullSpeed (see)

It does not work, the same error occurs. You cannot just change the device speed because it has corresponding usb descriptors. For example, device descriptor has bcdUSB, etc.

vadimgrn avatar Mar 14 '24 10:03 vadimgrn

Do you know how the best way to fix that?

When calling UdecxUsbDeviceInitSetSpeed set it to UdecxUsbHighSpeed instead of UdecxUsbFullSpeed (see)

It does not work, the same error occurs. You cannot just change the device speed because it has corresponding usb descriptors. For example, device descriptor has bcdUSB, etc.

What bInterval value are you using in your configuration descriptor? I assume 1? Try it with 4. Leave bcdUSB as it is.

nefarius avatar Mar 14 '24 17:03 nefarius

Thank you, I'll try. usbip means that the driver receives usb transfers from the device driver on Windows and sends them to Linux server. The received results from Linux are returned back. I do nothing like you mentioned. All descriptors read from the remote device.

vadimgrn avatar Mar 14 '24 17:03 vadimgrn

Thank you, I'll try. usbip means that the driver receives usb transfers from the device driver on Windows and sends them to Linux server. The received results from Linux are returned back. I do nothing like you mentioned.

Let me rephrase that then; the device you currently use for your testing; what bInterval, uh, values, does it report in its configuration descriptor?

nefarius avatar Mar 14 '24 18:03 nefarius

I'll answer tomorrow, today is too late.

vadimgrn avatar Mar 14 '24 18:03 vadimgrn

This is the info for virtual device on UDE hub


    =========================== USB Port1 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 3-1
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x01 (Port 1)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#ROOT_HUB30#1&2b53a856&2e&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x1F (Port 31)
 -> CompanionPortChain   : 3-31

      ========================== Summary =========================
Vendor ID                : 0x0D8C (C-MEDIA ELECTRONICS INC.)
Product ID               : 0x0103
USB Version              : 1.1
Port maximum Speed       : High-Speed (Companion Port 3-31 supports SuperSpeed)
Device maximum Speed     : High-Speed
Device Connection Speed  : High-Speed
Self powered             : no
Demanded Current         : 500 mA
Used Endpoints           : 1

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_0D8C&PID_0103#2&2b7483fe&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-6
Device ID                : USB\VID_0D8C&PID_0103\2&2B7483FE&0&1
Hardware IDs             : USB\VID_0D8C&PID_0103&REV_0010 USB\VID_0D8C&PID_0103
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0007 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.22621.3155  Date: 2024-02-14)
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_#0003
Container ID             : {33b69b3a-e201-11ee-9dc2-c018035e89da}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x84 (Removable, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 1
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D3, wake from D0)
 Child Device 1          : USB Sound Device (USB Audio Device)
  Device Path 1          : \\?\USB#VID_0D8C&PID_0103&MI_00#3&879833&0&0000#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\global (AM_KSCATEGORY_AUDIO)
  Device Path 2          : \\?\USB#VID_0D8C&PID_0103&MI_00#3&879833&0&0000#{65e8773e-8f56-11d0-a3b9-00a0c9223196}\global (AM_KSCATEGORY_RENDER)
  Kernel Name            : \Device\00000114
  Device ID              : USB\VID_0D8C&PID_0103&MI_00\3&879833&0&0000
  Class                  : MEDIA
  Driver KeyName         : {4d36e96c-e325-11ce-bfc1-08002be10318}\0006 (GUID_DEVCLASS_MEDIA)
  Service                : usbaudio
  Location               : 0000.0000.0000.001.000.000.000.000.000
   Child Device 1        : Speakers (USB Sound Device ) (Audio Endpoint)
    Device ID            : SWD\MMDEVAPI\{0.0.0.00000000}.{28E0363A-A464-4FCB-9E42-EE16ACC6B73A}
    Class                : AudioEndpoint
    Driver KeyName       : {c166523c-fe0c-4a94-a586-f1a80cfbbf3e}\0002 (AUDIOENDPOINT_CLASS_UUID)

        ---------------- Connection Information ---------------
Connection Index         : 0x01 (Port 1)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x00 (0)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x02 (High-Speed)
Number Of Open Pipes     : 0x00 (0 pipes to data endpoints)
Data (HexDump)           : 01 00 00 00 12 01 10 01 00 00 00 08 8C 0D 03 01   ................
                           10 00 01 02 00 01 01 02 00 00 00 00 00 00 00 01   ................
                           00 00 00                                          ...

        --------------- Connection Information V2 -------------
Connection Index         : 0x01 (1)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes, port supports USB 1.1)
 Usb200                  : 1 (yes, port supports USB 2.0)
 Usb300                  : 0 (no, port not supports USB 3.0) -> but Companion Port 3-31 does
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 01 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x110 (USB Version 1.1)
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x08 (8 bytes)
idVendor                 : 0x0D8C (C-MEDIA ELECTRONICS INC.)
idProduct                : 0x0103
bcdDevice                : 0x0010
iManufacturer            : 0x01 (String Descriptor 1)
 Language 0x0409         : "C-Media INC."
iProduct                 : 0x02 (String Descriptor 2)
 Language 0x0409         : "USB Sound Device        "
iSerialNumber            : 0x00 (No String Descriptor)
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 10 01 00 00 00 08 8C 0D 03 01 10 00 01 02   ................
                           00 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0074 (116 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0xFA (500 mA)
Data (HexDump)           : 09 02 74 00 02 01 00 80 FA 09 04 00 00 00 01 01   ..t.............
                           00 00 09 24 01 00 01 2B 00 01 01 0C 24 02 01 01   ...$...+....$...
                           01 00 02 03 00 00 00 0D 24 06 0D 01 02 01 02 02   ........$.......
                           00 02 00 00 09 24 03 03 01 03 00 0D 00 09 04 01   .....$..........
                           00 00 01 02 00 00 09 04 01 01 01 01 02 00 00 07   ................
                           24 01 01 01 01 00 0E 24 02 01 02 02 10 02 44 AC   $......$......D.
                           00 80 BB 00 09 05 06 09 C0 00 01 00 00 07 25 01   ..............%.
                           01 00 00 00                                       ....

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x01 (Audio Control)
bInterfaceProtocol       : 0x00
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 00 00 00 01 01 00 00                        .........

        ------ Audio Control Interface Header Descriptor ------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (Header)
bcdADC                   : 0x0100
wTotalLength             : 0x002B (43 bytes)
bInCollection            : 0x01
baInterfaceNr[1]         : 0x01
Data (HexDump)           : 09 24 01 00 01 2B 00 01 01                        .$...+...

        ------- 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              : 0x02 (2 channels)
wChannelConfig           : 0x0003 (L, R)
iChannelNames            : 0x00 (No String Descriptor)
iTerminal                : 0x00 (No String Descriptor)
Data (HexDump)           : 0C 24 02 01 01 01 00 02 03 00 00 00               .$..........

        -------- Audio Control Feature Unit Descriptor --------
bLength                  : 0x0D (13 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x06 (Feature Unit)
bUnitID                  : 0x0D (13)
bSourceID                : 0x01 (1)
bControlSize             : 0x02 (2 bytes per control)
bmaControls[0]           : 0x01, 0x02
 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
 D8: Bass Boost          : 0
 D9: Loudness            : 1
 D10: Reserved           : 0
 D11: Reserved           : 0
 D12: Reserved           : 0
 D13: Reserved           : 0
 D14: Reserved           : 0
 D15: Reserved           : 0
bmaControls[1]           : 0x02, 0x00
 D0: Mute                : 0
 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[2]           : 0x02, 0x00
 D0: Mute                : 0
 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
iFeature                 : 0x00 (No String Descriptor)
Data (HexDump)           : 0D 24 06 0D 01 02 01 02 02 00 02 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                : 0x0D (13)
iTerminal                : 0x00 (No String Descriptor)
Data (HexDump)           : 09 24 03 03 01 03 00 0D 00                        .$.......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
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 01 00 00 01 02 00 00                        .........

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x00
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 01 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               : 0x0001 (PCM)
Data (HexDump)           : 07 24 01 01 01 01 00                              .$.....

        ------- Audio Streaming Format Type Descriptor --------
bLength                  : 0x0E (14 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bNrChannels              : 0x02 (2 channels)
bSubframeSize            : 0x02 (2 bytes per subframe)
bBitResolution           : 0x10 (16 bits per sample)
bSamFreqType             : 0x02 (supports 2 sample frequencies)
tSamFreq[1]              : 0x0AC44 (44100 Hz)
tSamFreq[2]              : 0x0BB80 (48000 Hz)
Data (HexDump)           : 0E 24 02 01 02 02 10 02 44 AC 00 80 BB 00         .$......D.....

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x06 (Direction=OUT EndpointID=6)
bmAttributes             : 0x09 (TransferType=Isochronous  SyncType=Adaptive  EndpointType=Data)
wMaxPacketSize           : 0x00C0
 Bits 15..13             : 0x00 (reserved, must be zero)
 Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              : 0xC0 (192 bytes per packet)
bInterval                : 0x01 (1 ms)
bRefresh                 : 0x00
bSynchAddress            : 0x00
Data (HexDump)           : 09 05 06 09 C0 00 01 00 00                        .........

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x01
 D0   : Sampling Freq    : 0x01 (supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0000
Data (HexDump)           : 07 25 01 01 00 00 00                              .%.....

      -------------------- 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                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "C-Media INC."
Data (HexDump)           : 1A 03 43 00 2D 00 4D 00 65 00 64 00 69 00 61 00   ..C.-.M.e.d.i.a.
                           20 00 49 00 4E 00 43 00 2E 00                      .I.N.C...
             ------ String Descriptor 2 ------
bLength                  : 0x32 (50 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "USB Sound Device        "  *!*CAUTION  trailing space characters
Data (HexDump)           : 32 03 55 00 53 00 42 00 20 00 53 00 6F 00 75 00   2.U.S.B. .S.o.u.
                           6E 00 64 00 20 00 44 00 65 00 76 00 69 00 63 00   n.d. .D.e.v.i.c.
                           65 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00   e. . . . . . . .
                           20 00                                              .

vadimgrn avatar Mar 15 '24 09:03 vadimgrn

This is the info for real device



    =========================== USB Port4 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 2-4
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x04 (Port 4)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#ROOT_HUB30#4&1474365&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x11 (Port 17)
 -> CompanionPortChain   : 2-17

      ========================== Summary =========================
Vendor ID                : 0x0D8C (C-MEDIA ELECTRONICS INC.)
Product ID               : 0x0103
USB Version              : 1.1
Port maximum Speed       : High-Speed (Companion Port 2-17 supports SuperSpeed)
Device maximum Speed     : Full-Speed
Device Connection Speed  : Full-Speed
Self powered             : no
Demanded Current         : 500 mA
Used Endpoints           : 1

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_0D8C&PID_0103#5&45549b7&0&4#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-7
Device ID                : USB\VID_0D8C&PID_0103\5&45549B7&0&4
Hardware IDs             : USB\VID_0D8C&PID_0103&REV_0010 USB\VID_0D8C&PID_0103
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0009 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.22621.3155  Date: 2024-02-14)
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_#0004.Hub_#0002
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(4), ACPI(_SB_)#ACPI(PC00)#ACPI(XHCI)#ACPI(RHUB)#ACPI(HS04)
Container ID             : {33b69b86-e201-11ee-9dc2-c018035e89da}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x84 (Removable, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 4
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D3, wake from D0)
 Child Device 1          : USB Sound Device (USB Audio Device)
  Device Path 1          : \\?\USB#VID_0D8C&PID_0103&MI_00#6&3169eb15&0&0000#{65e8773e-8f56-11d0-a3b9-00a0c9223196}\global (AM_KSCATEGORY_RENDER)
  Device Path 2          : \\?\USB#VID_0D8C&PID_0103&MI_00#6&3169eb15&0&0000#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\global (AM_KSCATEGORY_AUDIO)
  Kernel Name            : \Device\00000118
  Device ID              : USB\VID_0D8C&PID_0103&MI_00\6&3169EB15&0&0000
  Class                  : MEDIA
  Driver KeyName         : {4d36e96c-e325-11ce-bfc1-08002be10318}\0007 (GUID_DEVCLASS_MEDIA)
  Service                : usbaudio
  Location               : 0000.0014.0000.004.000.000.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(4)#USBMI(0)  PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(4)#USB(4)  ACPI(_SB_)#ACPI(PC00)#ACPI(XHCI)#ACPI(RHUB)#ACPI(HS04)#USBMI(0)  ACPI(_SB_)#ACPI(PC00)#ACPI(XHCI)#ACPI(RHUB)#ACPI(HS04)#USB(4)
   Child Device 1        : Speakers (2- USB Sound Device ) (Audio Endpoint)
    Device ID            : SWD\MMDEVAPI\{0.0.0.00000000}.{80A3C7FD-10E0-4B56-95F8-E06B542E11ED}
    Class                : AudioEndpoint
    Driver KeyName       : {c166523c-fe0c-4a94-a586-f1a80cfbbf3e}\0007 (AUDIOENDPOINT_CLASS_UUID)

        ---------------- Connection Information ---------------
Connection Index         : 0x04 (Port 4)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x03 (3)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x01 (Full-Speed)
Number Of Open Pipes     : 0x00 (0 pipes to data endpoints)
Data (HexDump)           : 04 00 00 00 12 01 10 01 00 00 00 08 8C 0D 03 01   ................
                           10 00 01 02 00 01 01 01 00 03 00 00 00 00 00 01   ................
                           00 00 00                                          ...

        --------------- Connection Information V2 -------------
Connection Index         : 0x04 (4)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes, port supports USB 1.1)
 Usb200                  : 1 (yes, port supports USB 2.0)
 Usb300                  : 0 (no, port not supports USB 3.0) -> but Companion Port 2-17 does
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 04 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x110 (USB Version 1.1)
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x08 (8 bytes)
idVendor                 : 0x0D8C (C-MEDIA ELECTRONICS INC.)
idProduct                : 0x0103
bcdDevice                : 0x0010
iManufacturer            : 0x01 (String Descriptor 1)
 Language 0x0409         : "C-Media INC."
iProduct                 : 0x02 (String Descriptor 2)
 Language 0x0409         : "USB Sound Device        "
iSerialNumber            : 0x00 (No String Descriptor)
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 10 01 00 00 00 08 8C 0D 03 01 10 00 01 02   ................
                           00 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0074 (116 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0xFA (500 mA)
Data (HexDump)           : 09 02 74 00 02 01 00 80 FA 09 04 00 00 00 01 01   ..t.............
                           00 00 09 24 01 00 01 2B 00 01 01 0C 24 02 01 01   ...$...+....$...
                           01 00 02 03 00 00 00 0D 24 06 0D 01 02 01 02 02   ........$.......
                           00 02 00 00 09 24 03 03 01 03 00 0D 00 09 04 01   .....$..........
                           00 00 01 02 00 00 09 04 01 01 01 01 02 00 00 07   ................
                           24 01 01 01 01 00 0E 24 02 01 02 02 10 02 44 AC   $......$......D.
                           00 80 BB 00 09 05 06 09 C0 00 01 00 00 07 25 01   ..............%.
                           01 00 00 00                                       ....

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x01 (Audio Control)
bInterfaceProtocol       : 0x00
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 00 00 00 01 01 00 00                        .........

        ------ Audio Control Interface Header Descriptor ------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (Header)
bcdADC                   : 0x0100
wTotalLength             : 0x002B (43 bytes)
bInCollection            : 0x01
baInterfaceNr[1]         : 0x01
Data (HexDump)           : 09 24 01 00 01 2B 00 01 01                        .$...+...

        ------- 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              : 0x02 (2 channels)
wChannelConfig           : 0x0003 (L, R)
iChannelNames            : 0x00 (No String Descriptor)
iTerminal                : 0x00 (No String Descriptor)
Data (HexDump)           : 0C 24 02 01 01 01 00 02 03 00 00 00               .$..........

        -------- Audio Control Feature Unit Descriptor --------
bLength                  : 0x0D (13 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x06 (Feature Unit)
bUnitID                  : 0x0D (13)
bSourceID                : 0x01 (1)
bControlSize             : 0x02 (2 bytes per control)
bmaControls[0]           : 0x01, 0x02
 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
 D8: Bass Boost          : 0
 D9: Loudness            : 1
 D10: Reserved           : 0
 D11: Reserved           : 0
 D12: Reserved           : 0
 D13: Reserved           : 0
 D14: Reserved           : 0
 D15: Reserved           : 0
bmaControls[1]           : 0x02, 0x00
 D0: Mute                : 0
 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[2]           : 0x02, 0x00
 D0: Mute                : 0
 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
iFeature                 : 0x00 (No String Descriptor)
Data (HexDump)           : 0D 24 06 0D 01 02 01 02 02 00 02 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                : 0x0D (13)
iTerminal                : 0x00 (No String Descriptor)
Data (HexDump)           : 09 24 03 03 01 03 00 0D 00                        .$.......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
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 01 00 00 01 02 00 00                        .........

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x00
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 01 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               : 0x0001 (PCM)
Data (HexDump)           : 07 24 01 01 01 01 00                              .$.....

        ------- Audio Streaming Format Type Descriptor --------
bLength                  : 0x0E (14 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bNrChannels              : 0x02 (2 channels)
bSubframeSize            : 0x02 (2 bytes per subframe)
bBitResolution           : 0x10 (16 bits per sample)
bSamFreqType             : 0x02 (supports 2 sample frequencies)
tSamFreq[1]              : 0x0AC44 (44100 Hz)
tSamFreq[2]              : 0x0BB80 (48000 Hz)
Data (HexDump)           : 0E 24 02 01 02 02 10 02 44 AC 00 80 BB 00         .$......D.....

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x06 (Direction=OUT EndpointID=6)
bmAttributes             : 0x09 (TransferType=Isochronous  SyncType=Adaptive  EndpointType=Data)
wMaxPacketSize           : 0x00C0 (192 bytes)
bInterval                : 0x01 (1 ms)
bRefresh                 : 0x00
bSynchAddress            : 0x00
Data (HexDump)           : 09 05 06 09 C0 00 01 00 00                        .........

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x01
 D0   : Sampling Freq    : 0x01 (supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0000
Data (HexDump)           : 07 25 01 01 00 00 00                              .%.....

      -------------------- 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                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "C-Media INC."
Data (HexDump)           : 1A 03 43 00 2D 00 4D 00 65 00 64 00 69 00 61 00   ..C.-.M.e.d.i.a.
                           20 00 49 00 4E 00 43 00 2E 00                      .I.N.C...
             ------ String Descriptor 2 ------
bLength                  : 0x32 (50 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "USB Sound Device        "  *!*CAUTION  trailing space characters
Data (HexDump)           : 32 03 55 00 53 00 42 00 20 00 53 00 6F 00 75 00   2.U.S.B. .S.o.u.
                           6E 00 64 00 20 00 44 00 65 00 76 00 69 00 63 00   n.d. .D.e.v.i.c.
                           65 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00   e. . . . . . . .
                           20 00                      
```                        .

vadimgrn avatar Mar 15 '24 10:03 vadimgrn

The difference is that real device connection speed is Full-Speed, but virtual device is connected at High-Speed, as you mentioned above.

vadimgrn avatar Mar 15 '24 10:03 vadimgrn

This is most probably your issue on the endpoint descriptors:

bInterval                : 0x01 (1 ms)

I sadly do not remember where I exactly got that Eureka Moment from but I do recall that UDE (perhaps due to its dependency on USBHUB3) does not support 1ms polling, it always treats bInterval as 0.125ms intervals, not 1ms, and it doesn't care if everything else in the device descriptor or speed is correct, I had to set it to at least 4 to get my device(s) to work.


So the unholy trinity of getting a virtual USB audio device to work with UDE:

  • Present the device as High-Speed, even if the physical one is Full-Speed
    • bcdUSB can remain smaller - like 0x110 - it doesn't care
  • The USB host controller device needs to provide an implementation of QueryBusTime that can report nonsense like always 0 but has to report STATUS_SUCCESS
  • The bInterval of each ISOCH endpoint in the configuration descriptor must not be smaller than 4, even if the physical device reports 1

nefarius avatar Mar 15 '24 15:03 nefarius

The issue has fixed

vadimgrn avatar Apr 28 '24 10:04 vadimgrn