Skip to content

feat(razer): extended-matrix lighting for the Basilisk V3 - #156

Merged
snekxs merged 3 commits into
OpenMouse-Project:mainfrom
ydw1904:feat/razer-basilisk-v3-lighting
Oct 3, 2026
Merged

snekxs merged 3 commits into
OpenMouse-Project:mainfrom
ydw1904:feat/razer-basilisk-v3-lighting

Conversation

@ydw1904

@ydw1904 ydw1904 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A Basilisk V3 user reported the mouse connecting with no lighting card. OpenRazer drives the Basilisk V3 (0x0099) and V3 35K (0x00cb) through the extended-matrix lighting family on transaction id 0x1f, addressed per led, so this adds that family to the generic RazerHidClient behind a new extendedMatrixLighting product flag.

Stacked on #151 (Diamondback standard-matrix lighting), which holds the shared setLighting / brightness plumbing. Until #151 merges this diff shows its commits too; only the top commit is this PR.

  • codec: razerSetExtendedEffectCommand takes an optional led (default stays the logo, so the Cobra and Viper Mini are byte-identical) and gains wave (effect 0x04, direction 0x01, speed 0x28, size 6). New per-led brightness pair 0x0f/0x04 + 0x0f/0x84. RAZER_LED names ZERO_LED, scroll wheel and logo. All from razerchromacommon.c.
  • driver: readStatus reports three zones (Mouse = every LED incl. underglow, Scroll wheel, Logo) with each led's brightness read from the mouse. setLighting writes the effect to that zone's led on 0x1f, then brightness only when it changed, confirmed by read-back. Effects have no read so they are cached and writeOnly.
  • effects: Off, Spectrum, Wave, Static. OpenRazer creates wave/spectrum/static/brightness for these ids and no reactive or breathing; Off is the family's effect 0x00 and is the first thing to drop if it fails.
  • registry: flag set on 0x0099 and 0x00cb only.
  • docs: docs/razer-testing.md gets a Basilisk V3 section with the test checklist.

Not verified on hardware

Nobody on the project owns the mouse. The reporter can test it: the app needs only the protocol bump, since it already renders lightingZones.

Test plan

  • tsc --noEmit clean
  • Razer suites: 178 pass (new: codec bytes for led/wave/brightness, fake Basilisk V3 for zones, 0x1f id, per-led brightness confirm, refused brightness, unknown zone)
  • Hardware: checklist in docs/razer-testing.md

ydw1904 and others added 3 commits October 1, 2026 11:52
Firmware "Mouse 1.0" over the cable, through OpenMouse Bridge on Windows,
with RazerHidClient unmodified:

- Identity, firmware, DPI (1800) and polling (500 Hz) read back on the
  existing 0xff transaction id.
- 800 DPI and 1000 Hz each wrote, read back and were restored.
- Polling was read back but not measured (the sampler saw dropouts), and
  the DPI stage read gave nothing usable, so no stage editor is offered.

The app's hardware test export is in captures/razer-diamondback-chroma/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenRazer drives the Diamondback Chroma's LEDs through the older Chroma
command family (class 0x03), not the extended matrix the Cobra and Viper
Mini use. Adds that family to the generic RazerHidClient behind a new
per-product standardMatrixLighting flag, set only on 0x004c:

- codec: razerSetStandardEffectCommand (off, spectrum, wave, static,
  reactive, breathing random/single/dual on 0x03/0x0a) and the backlight
  brightness pair (0x03/0x03, 0x03/0x83, backlight led 0x05, 0-255 level
  as whole percent), byte for byte from razerchromacommon.c
- driver: readStatus reports one "Mouse" zone with the brightness read
  from the mouse; setLighting writes the effect, then the brightness only
  when it changed, confirmed by read-back. The effect has no read, so it
  is cached and marked write-only, as on the Cobra and Viper Mini.

Every command uses the product's 0xff transaction id, breathing included,
although OpenRazer lists this model's breathing on 0x3f: that entry sits
in the block where the Cobra's breathing turned out to answer on its usual
id. Untested on hardware; the checklist is in docs/razer-testing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Basilisk V3 user reported the mouse connecting with no lighting card. The
generic RazerHidClient had no lighting for it: OpenRazer drives this model
(and the 35K) through the extended-matrix family on transaction id 0x1f,
per led, not the standard family the Diamondback Chroma uses. Adds that
behind a per-product extendedMatrixLighting flag on 0x0099 and 0x00cb:

- codec: razerSetExtendedEffectCommand takes an optional led (default
  stays the logo, so the Cobra and Viper Mini are unchanged) and gains the
  wave effect (0x04, direction 0x01, speed 0x28, size 6); new per-led
  brightness pair 0x0f/0x04 and 0x0f/0x84; RAZER_LED names ZERO_LED, the
  scroll wheel and the logo. Byte for byte from razerchromacommon.c.
- driver: readStatus reports three zones (Mouse, Scroll wheel, Logo) with
  each led's brightness read from the mouse; setLighting dispatches to the
  extended family, writes the effect to that zone's led, then the
  brightness only when it changed, confirmed by read-back. Effects have no
  read, so they are cached and marked write-only. Off, Spectrum, Wave and
  Static are offered; OpenRazer exposes no reactive or breathing here.

Untested on hardware; the checklist is in docs/razer-testing.md. The app
needs only the protocol bump: it already renders lightingZones.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ydw1904
ydw1904 marked this pull request as ready for review October 2, 2026 18:46
@snekxs
snekxs merged commit 08061af into OpenMouse-Project:main Oct 3, 2026
5 checks passed
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants