-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Revise libusb-1.0 usage in Windows branch #1507
Comments
Currently, both libusb-0.1-compat and libusb-1.0 builds misbehave in regard to data collection: effectively just the data points from device discovery (vendor, model...) are populated. Even status is not (remains "OB" by default, lacking other info). These builds claim I/O errors with interrupt processing mode, and nearly no data is collected with polling mode. Maybe snatching the device from "kernel" should be done differently (Windows does represent the "USB HID Battery" and probably holds the critical resources). Have yet to try with original libusb-win32 project the branch was built against. |
FWIW, data collected there also complains about resource descriptor length which is miniscule and may be technically behind seeing no data (why - is another matter):
|
Seems to be a NUT for Windows-specific (or Windows builds of libusb-1.0 codebase specific, e.g. kernel detachment) problem. Same NUT commit built and executed on Linux extracts a lot of data from the same UPS, without any hassle regarding descriptor lengths (both ways of calculation yield same result, and as much gets returned from the call):
This level of detail also allows to dismiss issue #1625 ;) |
m4/nut_check_libusb.m4: when on Windows, prefer libusb-0.1 [#1507]
Looking at https://github.com/libusb/libusb/wiki/Windows#known-restrictions maybe my problems seeing device data stem from not installing libusb-win32 right (or libusbK at all) on the testbed. There should be a kernel level driver to access the device so Windows HID battery support does not preempt a NUT driver, probably. See also https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/supported-usb-classes |
The NUT for Windows effort up to 2.6.5-7 branch abandoned several years ago did not consider the not-yet-existing libusb-1.0 codebase, but included some changes for the libusb-0.1 codebase.
While preparing the Windows-2.8.0-1 branch, I tried to apply changes that happened in
libusb0.c
tolibusb1.c
as well, but there may be things I've missed or misunderstood (APIs do differ).It would be beneficial if someone better versed in libusb APIs went over those changes (comparing Windows branch to master), preferably both files for good measure, so we are more confident that it should actually work.
(Per small-scale testing at the time of this codebase update, linking with libusb-compat did function enough to discover the device and get initial data from the driver, although device-closing crashed when stopping it and I am not sure that run-time measurement/status updates did happen)
The text was updated successfully, but these errors were encountered: