Open mcuee opened 3 years ago
Same with latest git.
$ ./bin/Release/winhiddump.exe
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_01&col04#7&1ebb799e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 01 A1 01 85 10 15 00 25 01 35 00 45
01 65 00 55 00 75 01 95 30 81 03 91 03 C1 00
(31 bytes)
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_01&col05#7&1ebb799e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 02 A1 01 85 11 15 00 25 01 35 00 45
01 65 00 55 00 75 01 95 98 81 03 91 03 C1 00
(31 bytes)
044E:1212: -
PATH:\\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
DESCRIPTOR:
05 01 09 06 A1 01 85 07 05 07 19 E0 29 E7 15 00
25 01 35 00 45 01 65 00 55 00 75 01 95 08 81 02
95 38 81 03 C1 00
(38 bytes)
Unhandled Exception: HidSharp.Exceptions.DeviceIOException: Failed to get info.
at HidSharp.Platform.Windows.WinHidDevice.RequiresGetInfo(GetInfoFlags flags) in C:\work\libusb\HidSharp\HidSharp\Platform\Windows\WinHidDevice.cs:line 139
at HidSharp.Platform.Windows.WinHidDevice.GetManufacturer() in C:\work\libusb\HidSharp\HidSharp\Platform\Windows\WinHidDevice.cs:line 156
at winhiddump.Program.Main(String[] args) in C:\work\hid\win-hid-dump\Program.cs:line 30
But the issue may be related to HIDSharp.
HIDSharp seems to work.
I have a long list of HID device in the system.
That's weird because win-hid-dump
is just a thin wrapper on the HIDSharp stuff
That's weird because
win-hid-dump
is just a thin wrapper on the HIDSharp stuff
Further tests show that HIDSharp is also not stable for my particular system, sometimes it hangs. So I think it is not a real issue of win-hid-dump (maybe adding retry may help) but rather HIDSharp issues.
It seems to me the issue is only with Logitech USB receiver.
Tested with my home Acer Windows 10 laptop.
With Logitech USB Receiver plugged in, it will crash.
$ ./winhiddump.exe
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_01&col01#7&2fa52f82&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 01 09 02 A1 01 85 02 09 01 A1 00 05 09 19 01
29 10 15 00 25 01 35 00 45 01 65 00 55 00 75 01
95 10 81 02 05 01 09 30 26 FF 07 45 00 75 0C 95
01 81 06 09 31 81 06 09 38 25 7F 75 08 81 06 05
0C 0A 38 02 81 06 C1 00 C1 00
(74 bytes)
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_01&col02#7&2fa52f82&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
Unhandled Exception: System.NotSupportedException: Unable to reconstruct the report descriptor.
at HidSharp.Platform.Windows.WinHidDevice.GetRawReportDescriptor() in C:\work\hid\HidSharp\HidSharp\Platform\Windows\WinHidDevice.cs:line 195
at winhiddump.Program.Main(String[] args) in C:\work\hid\win-hid-dump\Program.cs:line 32
Without the Logitech USB Receiver plugged in, it will not crash.
$ ./winhiddump.exe
2BF6:A096: Acer Inc. - Launch Manager Wireless Device
PATH:\\?\hid#hidclass&col02#1&2d595ca7&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 01 09 0C A1 01 85 01 09 C6 15 00 25 01 35 00
45 01 65 00 55 00 75 01 95 01 81 06 95 07 81 03
C1 00
(34 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col01#5&10870616&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 01 09 02 A1 01 85 01 09 01 A1 00 05 09 19 01
29 02 15 00 25 01 35 00 45 01 65 00 55 00 75 01
95 02 81 02 95 06 81 03 05 01 09 30 25 7F 45 00
75 08 95 01 81 06 09 31 81 06 15 00 25 01 45 01
75 01 95 28 81 03 85 0E C1 00 06 00 FF 09 01 25
FF 45 00 75 08 95 01 B1 02 09 C5 95 03 B1 02 C1
00
(97 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col03#5&10870616&1&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 0D 09 05 A1 01 85 04 09 22 A1 02 09 47 15 00
25 01 35 00 45 01 65 00 55 00 75 01 95 01 81 02
09 42 81 02 95 02 81 03 09 51 25 0F 45 00 75 04
95 01 81 02 05 01 09 30 26 A2 0C 46 94 01 65 13
55 0E 75 10 81 02 09 31 26 26 09 46 24 01 81 02
C1 00 05 0D 09 56 26 FF FF 46 FF FF 66 01 10 55
0C 81 02 09 54 25 7F 75 08 81 02 05 09 09 01 25
01 45 01 65 00 55 00 75 01 81 02 95 07 81 03 09
C5 46 FF FF 66 01 10 55 0C 75 08 95 02 81 03 85
07 05 0D 09 60 45 01 65 00 55 00 75 01 95 01 B1
02 96 FF 07 B1 03 85 02 09 55 25 0F 46 FF FF 66
01 10 55 0C 75 04 95 01 B1 02 09 59 B1 02 25 01
45 01 65 00 55 00 75 01 96 F8 07 B1 03 85 06 06
00 FF 09 C5 25 FF 46 FF FF 66 01 10 55 0C 75 08
96 00 01 B1 02 C1 00
(231 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col04#5&10870616&1&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 0D 09 0E A1 01 85 05 09 22 A1 00 09 57 15 00
25 01 35 00 45 01 65 00 55 00 75 01 95 01 B1 02
09 58 B1 02 95 0E B1 03 85 03 C1 00 09 22 A1 00
09 52 25 0A 46 FF FF 66 01 10 55 0C 75 10 95 01
B1 02 C1 00 C1 00
(70 bytes)
2BF6:A096: Acer Inc. - Launch Manager Wireless Device
PATH:\\?\hid#hidclass&col01#1&2d595ca7&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 01 A1 01 85 40 09 02 15 00 25 FF 35
00 45 00 65 00 55 00 75 08 95 10 81 02 09 02 91
02 C1 00
(35 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col02#5&10870616&1&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 01 A1 01 85 5C 09 01 15 00 25 FF 35
00 45 00 65 00 55 00 75 08 95 0B 81 06 85 0D 09
C5 95 04 B1 02 25 01 45 01 75 01 96 E0 15 B1 03
85 0C 09 C6 25 FF 45 00 75 08 96 C0 02 B1 02 85
0B 09 C7 95 42 B1 02 25 01 45 01 75 01 96 F0 13
B1 03 C1 00
(84 bytes)
0925:7001: Lakeview Research - Generic HID
PATH:\\?\hid#vid_0925&pid_7001#6&18b7cc42&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 01 A1 01 85 01 09 00 15 00 25 FF 35
00 45 00 65 00 55 00 75 08 95 02 82 02 01 85 02
09 00 92 02 01 85 03 09 00 B2 02 01 85 04 09 00
B2 02 01 C1 00
(53 bytes)
HIDSharp does not crash with the Logitech USB receiver plugged in.
I seemed to be having a similar problem with a different device. HIDSharp appeared fine with it and this program worked fine without it plugged in. At least in my case it turned out that the 'manufacturer' value associated with the device was null so as a result when I reached this line in Program.cs:
Console.Write(string.Format("{0:X4}:{1:X4}: {2} - {3}\nPATH:{4}\n",
dev.VendorID, dev.ProductID, dev.GetManufacturer(), dev.GetProductName(), dev.DevicePath));
The dev.GetManufacturer()
would result in an exception. Replacing the GetManufacturer() call with a placeholder string got things working for me. I'm not sure how commonplace a null value for any of these fields might actually be as my device here is essentially in testing and values that should be there are currently either placeholders or left empty, but for example I would think that a null product name would result in this issue as well. A null check or two here might solve the problem.
In my case it is different, it has no issues with "dev.GetManufacturer(), dev.GetProductName(), dev.DevicePath)" but crashes since it can not carry out the operation GetRawReportDescriptor().
The exception points to HIDSharp but HIDSharpDemo seems not to crash, strange. Here I am using git head of HIDSharp.
PATH:\?\hid#vid_046d&pid_c534&mi_01&col02#7&2fa52f82&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} is recognized in Windows as "HID-complaint consumer control device".
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col01#5&10870616&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 01 09 02 A1 01 85 01 09 01 A1 00 05 09 19 01
29 02 15 00 25 01 35 00 45 01 65 00 55 00 75 01
95 02 81 02 95 06 81 03 05 01 09 30 25 7F 45 00
75 08 95 01 81 06 09 31 81 06 15 00 25 01 45 01
75 01 95 28 81 03 85 0E C1 00 06 00 FF 09 01 25
FF 45 00 75 08 95 01 B1 02 09 C5 95 03 B1 02 C1
00
(97 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col02#5&10870616&1&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 01 A1 01 85 5C 09 01 15 00 25 FF 35
00 45 00 65 00 55 00 75 08 95 0B 81 06 85 0D 09
C5 95 04 B1 02 25 01 45 01 75 01 96 E0 15 B1 03
85 0C 09 C6 25 FF 45 00 75 08 96 C0 02 B1 02 85
0B 09 C7 95 42 B1 02 25 01 45 01 75 01 96 F0 13
B1 03 C1 00
(84 bytes)
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_01&col05#7&2fa52f82&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 02 A1 01 85 11 15 00 25 01 35 00 45
01 65 00 55 00 75 01 95 98 81 03 91 03 C1 00
(31 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col03#5&10870616&1&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 0D 09 05 A1 01 85 04 09 22 A1 02 09 47 15 00
25 01 35 00 45 01 65 00 55 00 75 01 95 01 81 02
09 42 81 02 95 02 81 03 09 51 25 0F 45 00 75 04
95 01 81 02 05 01 09 30 26 A2 0C 46 94 01 65 13
55 0E 75 10 81 02 09 31 26 26 09 46 24 01 81 02
C1 00 05 0D 09 56 26 FF FF 46 FF FF 66 01 10 55
0C 81 02 09 54 25 7F 75 08 81 02 05 09 09 01 25
01 45 01 65 00 55 00 75 01 81 02 95 07 81 03 09
C5 46 FF FF 66 01 10 55 0C 75 08 95 02 81 03 85
07 05 0D 09 60 45 01 65 00 55 00 75 01 95 01 B1
02 96 FF 07 B1 03 85 02 09 55 25 0F 46 FF FF 66
01 10 55 0C 75 04 95 01 B1 02 09 59 B1 02 25 01
45 01 65 00 55 00 75 01 96 F8 07 B1 03 85 06 06
00 FF 09 C5 25 FF 46 FF FF 66 01 10 55 0C 75 08
96 00 01 B1 02 C1 00
(231 bytes)
2BF6:A096: Acer Inc. - Launch Manager Wireless Device
PATH:\\?\hid#hidclass&col01#1&2d595ca7&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
06 00 FF 09 01 A1 01 85 40 09 02 15 00 25 FF 35
00 45 00 65 00 55 00 75 08 95 10 81 02 09 02 91
02 C1 00
(35 bytes)
2BF6:A096: Acer Inc. - Launch Manager Wireless Device
PATH:\\?\hid#hidclass&col02#1&2d595ca7&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 01 09 0C A1 01 85 01 09 C6 15 00 25 01 35 00
45 01 65 00 55 00 75 01 95 01 81 06 95 07 81 03
C1 00
(34 bytes)
04F3:3060: Microsoft - HIDI2C Device
PATH:\\?\hid#elan0501&col04#5&10870616&1&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
DESCRIPTOR:
05 0D 09 0E A1 01 85 05 09 22 A1 00 09 57 15 00
25 01 35 00 45 01 65 00 55 00 75 01 95 01 B1 02
09 58 B1 02 95 0E B1 03 85 03 C1 00 09 22 A1 00
09 52 25 0A 46 FF FF 66 01 10 55 0C 75 10 95 01
B1 02 C1 00 C1 00
(70 bytes)
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_00#7&73a81b9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
DESCRIPTOR:
05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01
35 00 45 01 65 00 55 00 75 01 95 08 81 02 95 38
81 03 05 08 19 01 29 05 95 05 91 02 95 03 91 03
C1 00
(50 bytes)
046D:C534: Logitech - USB Receiver
PATH:\\?\hid#vid_046d&pid_c534&mi_01&col02#7&2fa52f82&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
Call stack
HidSharp.dll!HidSharp.Platform.Windows.WinHidDevice.GetRawReportDescriptor() Line 194
at C:\work\hid\HidSharp\HidSharp\Platform\Windows\WinHidDevice.cs(194)
winhiddump.exe!winhiddump.Program.Main(string[] args) Line 32
at C:\work\hid\win-hid-dump\Program.cs(32)
It is a pretty complicated device. https://github.com/libusb/hidapi/issues/249#issuecomment-864510041
Example Logitech USB Receiver. It is a USB Composite Device, under Windows Device Manager, it will show as 9 devices, one USB Composite Device parent, then six devices in Human Interface Devices section, one in mouse and one in keyboard.
HIDSharp will show it as six HID devices, one for Interface 0, one for each top level collection of Interface 1 (col 1/2/3/4/5)..
Logitech USB Receiver (no serial number) (VID 1133, PID 50484, version 29.1) @ \\?\hid#vid_046d&pid_c534&mi_01&col02#7&2fa52f82&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
Logitech USB Receiver (no serial number) (VID 1133, PID 50484, version 29.1) @ \\?\hid#vid_046d&pid_c534&mi_00#7&73a81b9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
Logitech USB Receiver (no serial number) (VID 1133, PID 50484, version 29.1) @ \\?\hid#vid_046d&pid_c534&mi_01&col01#7&2fa52f82&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Logitech USB Receiver (no serial number) (VID 1133, PID 50484, version 29.1) @ \\?\hid#vid_046d&pid_c534&mi_01&col04#7&2fa52f82&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
Logitech USB Receiver (no serial number) (VID 1133, PID 50484, version 29.1) @ \\?\hid#vid_046d&pid_c534&mi_01&col03#7&2fa52f82&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
Logitech USB Receiver (no serial number) (VID 1133, PID 50484, version 29.1) @ \\?\hid#vid_046d&pid_c534&mi_01&col05#7&2fa52f82&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
USB Prober output from Mac Mini M1.
If I use the fork here ( https://github.com/afinetapestry/win-hid-dump/tree/main ), the exception seems to point to HIDSharp.
System.NotSupportedException
HResult=0x80131515
Message=Unable to reconstruct the report descriptor.
Source=HidSharp
StackTrace:
at HidSharp.Platform.Windows.WinHidDevice.GetRawReportDescriptor()
at winhiddump.Program.Main(String[] args) in C:\work\hid\win-hid-dump-mod\Program.cs:line 62
I get the same issue with Logitech - USB Reciever
.
It being the first thing it reports, and dying immediately.
Going to try with no mouse, see what happens.
okay, I found out it was my dasKeyboard that was the cause.. and of course, it was the last USB device I had to try.
Ended up using a automation program, to press enter on the command line window, after 10 seconds to giving me enough time to start it and remove ALL other USB devices other than the one I wanted a report on
Please refer to this thread: https://github.com/libusb/hidapi/issues/249 HIDSharp is not very good for this task in reality. The resulting HID report descriptors are often not correct. This is not the fault of HIDSharp though, rather it is the limitation of Windows native HID API.
The following hidapi pull request has the same limitations. https://github.com/libusb/hidapi/pull/262
So far the best effort is here using reverse engineering. But it still needs more efforts. https://github.com/libusb/hidapi/pull/306
Could you put the problematic line in try catch block so it does not fail because of a single device?
try
{
rawReportDescriptor = dev.GetRawReportDescriptor();
} catch (Exception e) {
Console.Write("Unable to parse report: {0}", e);
}
Trying out winHIDdump to learn a bit about the Videonics CP1 device found in my wtf boxes. It shows up in Device Manager under HDI as USB Input Device. The properties/Events shows "Device Not Migrated" event: Device USB\VID_0947&PID_CF01\5&2edb8ad2&0&2 was not migrated due to partial or ambiguous match.
Last Device Instance Id: USB\VID_1038&PID_2006&MI_00\2&5e99c07&0&0000 Class Guid: {745a17a0-74d3-11d0-b6fe-00a0c90f57da} Location Path: Migration Rank: 0xF000FFFF0000F120 Present: false Status: 0xC0000719
winHIDdump says: C:\Users\jerry\Downloads\winhiddump>.\winhiddump.exe WinHIDdump: 04F3:30FA: Microsoft - HIDI2C Device PATH:\?\hid#cust0001&col03#5&2f1d7da6&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
Unhandled Exception: System.NotSupportedException: Unable to reconstruct the report descriptor. at HidSharp.Platform.Windows.WinHidDevice.GetRawReportDescriptor() at winhiddump.Program.Main(String[] args)
My guess is the device is so old (pre-2000) and vendor gone, that its all unknown to MS. Oh well. maybe I can scavenge it for parts or put in a rPiPico
update: i grabbed https://github.com/rene-aguirre/pywinusb and the raw_data.py was able to read all the buttons, sticks, etc on the CP1.
It crashes on me too. I unplugged my wacom tablet and its not crashing now. It does crash with the generic xbox controller btw
WinHIDdump: 258A:002A: SINO WEALTH - Gaming KB PATH:\?\hid#vid_258a&pid_002a&mi_01&col06#7&af6b46a&0&0005#{4d1e55b2-f16f-11cf-88cb-001111000030} DESCRIPTOR: 06 00 FF 09 01 A1 01 85 0A 09 00 15 00 25 FF 35 00 45 00 65 00 55 00 75 08 95 29 B1 02 C1 00 (31 bytes) 08BB:2902: Burr-Brown from TI - USB Audio CODEC PATH:\?\hid#vid_08bb&pid_2902&mi_03#8&1f3c160&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} DESCRIPTOR: 05 0C 09 01 A1 01 09 E2 15 00 25 01 35 00 45 01 65 00 55 00 75 01 95 01 81 42 09 E9 81 42 09 EA 81 42 95 05 81 03 C1 00 (40 bytes) 056A:00F4: Tablet - Cintiq 24HD Tablet PATH:\?\hid#vid_056a&pid_00f4&col02#8&2d57ec0f&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
Unhandled Exception: System.NotSupportedException: Unable to reconstruct the report descriptor. at HidSharp.Platform.Windows.WinHidDevice.GetRawReportDescriptor() at winhiddump.Program.Main(String[] args)
Both of these are HidSharp library error, a library that win-hid-dump
is a very thin wrapper on.
You could try running the HidSharp library's HidSharp.Test.exe
that's inside the HidSharp zip file. If it also errors out, then there's nothing I know of in Windows you can do to get the HID Report Descriptor. Use Linux or MacOS instead.
HidSharp is doing a kind of reconstruction of the HID Report Descriptor since Windows does not support interrogating the device directly for this information.
I think that error can occur for devices that are not true HID devices (i.e. a device with a driver that creates a "virtual HID" device for applications to use. I think XBox controllers do this) or devices that have a custom driver that overrides the default HID driver.
Again, try your device on a different OS or even a different Windows box that doesn't have any extra drivers for the device installed.
Where is this HidSharp.test.exe? I do not see any HidSharp.zip either.
For anybody that is having issues with win-hid-dump or HidSharp due to Windows limitations, try installing WSL2 (WSL1 does not support USB device redirection) and redirecting your HID device to it and then use the Linux based usbhid-dump.
Where is this HidSharp.test.exe? I do not see any HidSharp.zip either.
Sorry I didn't provide a direct link earlier: https://www.zer7.com/software/hidsharp
That's the homepage for HidSharp. On it is a zip download containing the library and the test file.
I think in the end hidsharp will not work very well with many devices under Windows.
The best effors are here to try to get Windows working with hidapi and Report Descriptor, using reverse engineering approach. https://github.com/libusb/hidapi/tree/get-descriptor
Discussions and many test reports here. https://github.com/libusb/hidapi/issues/249
For anybody that is having issues with win-hid-dump or HidSharp due to Windows limitations, try installing WSL2 (WSL1 does not support USB device redirection) and redirecting your HID device to it and then use the Linux based usbhid-dump.
Nice idea.
For me I just reboot my Windows laptop to Linux since I use dual-boot. :-)
Or I will use my Mac Mini.
has been closed with the merge of https://github.com/libusb/hidapi/pull/451.
So if people are having issues with win-hid-dump or HIDSharp, you can try latest git of hidapi which inlcude the hidtest application. hidtest will dump the report descriptors of the HID devices.
It does not seem to work with Logitech USB Receiver.