Skip to content

Migrate USB v3 discovery while preserving Windows HID mouse support - #109

Merged
marcmy merged 3 commits into
mainfrom
fix/usb-v3-compat
Oct 12, 2026
Merged

marcmy merged 3 commits into
mainfrom
fix/usb-v3-compat

Conversation

@marcmy

@marcmy marcmy commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

USB v3 removes getDeviceList(), which the application aliases as listDevices; a dependency-only upgrade breaks discovery. It also replaces libusb with nusb, which cannot claim standard Windows HID interfaces. This migration handles both changes without bundling USB v2.

Runtime selection and the read-only startup probe now await usb.getDevices() through a descriptor-only adapter. It avoids native serial/configuration getters that can open devices and preserves the serial-free identities used by Windows Raw Input presentation recovery. Device classification, Razer priority, active-mouse overrides and wired CrazyLight preference remain intact.

Windows CrazyLight retains its existing HID bridge. Windows Razer devices use node-hid for the same 90-byte feature reports, with report-ID prefix/strip and validated HID collection sizes; WinUSB-bound Razer devices and other platforms retain WebUSB. The existing Razer command construction, timing, retries, two-stage rate writes and readback stay in the original backend.

Validation: 246 tests pass with 3 platform skips under TZ=UTC. New tests cover asynchronous discovery, reconnects, unknown devices, errors, native getter avoidance, Windows HID byte alignment, exact product/serial/interface selection, rate readback, short replies, reopen and WinUSB fallback. Dependency audit reports zero vulnerabilities; syntax and YAML checks pass. Native USB enumeration is unavailable in the local container because /sys/bus/usb/devices is absent.

Windows CI smoke-tests real USB and HID enumeration from source and from packaged Electron, then uploads a portable Windows test artifact. USB's shipped N-API binary is excluded from recompilation while node-hid's rebuild behavior is retained.

All applicable PR checks passed, including Windows packaging and native USB/HID smoke tests from the packaged executable. The user reported that the portable test build works and confirmed testing the Razer HyperPolling hardware as well. The test checklist remains in docs/usb-v3-hardware-test.md.

@marcmy marcmy changed the title Migrate to USB v3 with asynchronous discovery and Windows smoke tests Migrate USB v3 discovery while preserving Windows HID mouse support Oct 12, 2026
@marcmy
marcmy marked this pull request as ready for review October 12, 2026 02:01
@marcmy
marcmy merged commit 979104d into main Oct 12, 2026
9 checks passed
@marcmy
marcmy deleted the fix/usb-v3-compat branch October 12, 2026 02:01
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

Successfully merging this pull request may close these issues.

1 participant