USB descriptor information not shown correctly in Chrome/Chromium
shepherd007 opened this issue · 3 comments
When I'm trying to run example console demo using Arduino Leonardo I can see that navigator.usb.getDevices() doesn't seem to work correctly. It seems to return valid product name (Arduino Leonardo) but no serial number (USBLyzer tool shows there is a serial number: "WUART") and no manufacturer field:
It looks to me there can be some kind of the issue in the Chromium implementation which I'd like to confirm (or something missing in the USB descriptors) related to Windows 10.
The issue can be reproduced on the Windows 10 in another way:
- connect Arduino Leonardo with WebUSB sketch uploaded
- start console demo page
- allow using Arduino Leonardo
- go to second Chromium tab and navigate to: chrome://usb-internals
- on the 'Devices' tab you'll see Arduino Leonardo with empty fields (such as: serial number)
The navigator.usb.getDevices() seem to return all data on the Linux (i.e. CentOS 7)
On Windows, intermittently will have missing fields. See this
#57
If your application is running on Windows, do not make it depending on anything other than the VID and PID.
This is Chromium issue 637404. The problem is that on Windows and macOS Chromium currently uses libusb to communicate with USB devices rather than the native OS API. libusb does not provide a way of reading the string descriptors cached by the operating system and so Chromium must try to read them itself directly from the device. This is not reliable as the device may not be ready for connections so soon after being connected. There is an ongoing project to replace libusb on Windows with code using the native API directly. It has taken longer than I'd like to find the time to complete it.
@reillyeon Thanks for clarification. It sounds like an issue in Windows implementation of the libusb library.