Skip to content
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

HID broken on Linux #853

Closed
tresf opened this issue Aug 19, 2021 · 1 comment
Closed

HID broken on Linux #853

tresf opened this issue Aug 19, 2021 · 1 comment

Comments

@tresf
Copy link
Contributor

tresf commented Aug 19, 2021

Since hid4java was updated to the latest snapshot, Linux can no longer claim a device and the redundant device listing is very large. This affects all master builds currently.

#852 fixes device listing, however even with this patch, the device still cannot be claimed.

Edit: #852 has been updated to fix claiming as well.

tresf added a commit that referenced this issue Aug 19, 2021
@tresf
Copy link
Contributor Author

tresf commented Aug 19, 2021

So it turns out hid4java 0.7.0 shipped the wrong binary for it's hidraw support on Linux. The binary in its place was the libusb implementation. This means that QZ Tray 2.1.3 unknowingly shipped with libusb implementation.

When we created our own snapshot build, we did not make this mistake so the correct (and thus non-working) library was used instead. I believe this is due to hidraw requiring special udev rules.

This regression is documented in detail here:
gary-rowe/hid4java#113 (comment)

The fix is to force the old QZ Tray 2.1.3 behavior by using the libusb version at all times, which hid4java allows through a flag HidApi.useLibUsbVariant at runtime. Since hid4java can be swapped with purejavahidapi, I've chosen to use reflection for this call to avoid any edge-case linking errors.

P.S. @bberenz, reverting to libusb also seems to fix the redundant device listing which you patched into #852 but I'm leaving that logic in in case we decide to add hidraw support in the future.

@tresf tresf closed this as completed in b9fe674 Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant