Skip to content

Stable USB frames, auto-detected layout, 60 FPS - #68

Open
BrenOne wants to merge 1 commit into
mskutin:mainfrom
BrenOne:contrib/usb-stability
Open

BrenOne wants to merge 1 commit into
mskutin:mainfrom
BrenOne:contrib/usb-stability

Conversation

@BrenOne

@BrenOne BrenOne commented Oct 30, 2026 •

Copy link
Copy Markdown

Fixes #67. Hardware validation for #45.

What changes for users

  • Bring more stable connection without "Waiting for strip" / 0x3E5 errors during normal use: frames use the controller's own format (1-based inclusive ranges, at most 34 → 3 HID reports instead of 8), with a 1 ms gap between reports. A stalled write is retried and the interface reopened before the strip is reported lost.

  • Full brightness: hardware brightness 255 instead of 100 (0x87 is 0–255). The brightness slider still scales colours.

  • Automatic setup: LED count and display size come from the 0x82 reply. On a fresh setup the app picks 3 or 4 edges (from the kits' ~2 cm LED pitch) and splits LEDs by the display's real aspect ratio, leaving a gap at the corners. For 94 LEDs on a 27" 16:9 display: four edges, 16/31/16/31. The 34" OpenRGB kit (71 LEDs) resolves to three edges.

  • Device setup: LEDs per side and corner gap, with a warning when the counts don't add up to the strip length; the strip preview shows real LED positions.

  • 45 and 60 FPS (60 by default). RGB recordings stay at 30 frames/s.

  • Windows: the strip turns off on shutdown, restart and sign-out with (WM_ENDSESSION).

Validation

  • Windows 11, Robobloq 27" kit (94 LEDs, 1A86:FE07): Screen mode at 60 FPS for hours, 0 write failures in Diagnostics, no reconnects; quick mode/setting changes no longer hang the controller; layout auto-detected as 4 sides 16/31/16/31;

  • Unit tests: frame layout and report splitting (1, 34, 94, 127 LEDs), range merging keeps single-LED detail and covers every LED, edge detection for 24"/27"/32"/34" kits, cargo fmt, cargo clippy -D warnings.

Limitations

  • Not tested on macOS or Linux hardware, or on other Robobloq kit sizes (detection for 24"/32" kits is computed, not measured).

  • Lock-key flashes above 30 FPS (issue point 4) will be addressed in a separate, upcoming PR.

- Frames use the controller's own format: 1-based inclusive
  (start, r, g, b, end) ranges after the 0x80 command, merged greedily to
  at most 34 ranges (3 HID reports instead of 8), as the vendor app and
  OpenRGB do. The previous 0-based ranges and trailing byte matched no
  known firmware behaviour.
- 1 ms gap between reports; a stalled hid_write (0x3E5) is retried, then
  the interface is reopened before the strip is reported lost.
- Hardware brightness 255 (0x87 takes 0-255; 100 left the strip at ~39 %).
- Read LED count and display size from the 0x82 reply and adopt them.
  On a fresh setup pick 3 or 4 edges from the kit's ~2 cm LED pitch and
  split LEDs by the display's real aspect ratio, leaving a configurable
  gap at the corners (bars wired at the corners have no LEDs there).
- Per-side LED counts and corner gap in Device setup, with a warning when
  they do not add up; the strip preview shows the real positions.
- 45 and 60 FPS (60 by default); RGB recordings stay at 30 frames/s.
- Windows: turn the strip off on shutdown, restart and sign-out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Sqdi9StAk5iH4ETYHDqEq
@BrenOne BrenOne changed the title Robobloq: stable USB frames, auto-detected layout, 60 FPS Stable USB frames, auto-detected layout, 60 FPS Oct 30, 2026
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.

Connection stability: "Waiting for strip" / hid_write 0x3E5 error, 30 FPS cap, low brightness, lock keys strobe the strip

1 participant