-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Expose device speed #240
Comments
I've been using @RReverser's libgphoto2 hackery. I'd alter what sized media I try to capture/download/stream adaptively if I had this capability! |
@beaufortfrancois I think both of these properties make sense to expose. My only concern is that we need to double-check that we can get the USB speed on all platforms. Proposed WebIDL change:
|
FWIW libusb has "unknown" constant for this scenario. It should be possible to either return that or perhaps more idiomatic |
For reference, here's what says https://www.beyondlogic.org/usbnutshell/usb5.shtml
|
I suspect that definition is somewhat outdated. It was true for older versions of USB, but not for USB 3.0 / SuperSpeed I think. I need to find a better reference link though. |
Can't find a good reference link, but this patch discussion that pops up among first Google results is helpful:
|
For some applications (particularly, radio) it's important to know the device speed to choose the best packet size for communication.
They normally use
libusb_get_device_speed
, which, in turn, consults implementation backend to get device speed reported the OS. I implemented most functions in the WebUSB backend of libusb, but currently reporting device speed as "unknown" as it's not possible to determine it from the WebUSB API, and some apps fail on this as they expect speed to be well-defined.I think (although not sure) it would be possible to infer speed from
bMaxPacketSize
andwMaxPacketSize
if they were available, but right now only the latter is exposed (asUSBEndpoint::packetSize
) while the former is not.The text was updated successfully, but these errors were encountered: