fix(asusd): bind GX651AR AURA button listener to matching HID device - #289
fix(asusd): bind GX651AR AURA button listener to matching HID device#289Cymirk wants to merge 11 commits into
Conversation
…1ce6 device ID & fix syntax
Some laptops (e.g. GX651AR Zephyrus Duo) have no sysfs keyboard backlight class. set_led_mode_data called set_brightness()? right after a successful color write, so a brightness failure aborted the whole operation -- including config.write(), meaning color changes never persisted to disk even though they succeeded on the hardware.
Previous entry (from earlier experimentation) claimed PerKey lighting, a borrowed per-key layout, and 7 additional effects that were never tested against real hardware. Corrected to only the modes actually verified: Static, Breathe, RainbowCycle, Pulse.
set_led_mode_data was fixed to not abort on brightness failures, but the sibling set_led_mode setter had the identical bug: an unhandled set_brightness()? would abort before config.write(), so mode changes via this path would not persist on backlight-less devices like the GX651AR. Applies the same warn-and-continue fix here.
Comments referred to interface 3 / hidraw3 from an earlier draft of this fix, but the actual code correctly targets interface 1.2. Also clarified that hidraw numbering is not stable across boots.
Earlier edit inserted 0x1ce6 multiple times with mixed pipe/comma separators. Cleaned up to a single, consistent comma-separated list.
The interface-1.2 filter previously only ran during initial device enumeration. USB reconnect/resume events go through a separate hotplug handler that called init_hid_devices directly, so a disconnect/reconnect or resume-from-sleep could re-select the wrong interface for the Zephyrus Duo. Extracted the filter into a shared is_non_aura_1ce6_interface() helper used by both paths. Verified: unbind/rebind the USB device and confirmed asusctl aura effect still works correctly afterward with no manual intervention.
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used🧠 Learnings (1)📓 Common learnings🔇 Additional comments (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds ChangesAura button mode control
Estimated code review effort: 3 (Moderate) | ~25 minutes Mergeability Score: ⚪ Minimal · up to The change skips unavailable keyboard-backlight writes while preserving Aura mode changes and removing spurious warnings; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant AURAButton as AURA button
participant HidrawNode as hidraw node
participant AuraManager
participant AuraZbus
AURAButton->>HidrawNode: emit AURA-button report
AuraManager->>HidrawNode: read report
AuraManager->>AuraZbus: cycle_led_mode()
AuraZbus->>AuraZbus: select next supported mode
AuraZbus->>AuraZbus: set_led_mode()
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@asusd/src/aura_manager.rs`:
- Around line 161-172: Update spawn_aura_button_listener and its call site near
DeviceHandle::Aura initialization so the listener is started only for the
current device when is_1ce6_aura_interface passes. Reuse the matching device’s
hidraw node by passing it into spawn_aura_button_listener instead of rescanning
independently, ensuring button events and persisted mode changes remain
associated with the correct AuraZbus instance.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 70add83b-1fd1-47eb-8335-d5860999b14b
📒 Files selected for processing (2)
asusd/src/aura_laptop/trait_impls.rsasusd/src/aura_manager.rs
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: NB-Group
Repo: OpenGamingCollective/asusctl PR: 230
File: rog-control-center/ui/pages/slash.slint:174-185
Timestamp: 2026-07-29T15:23:06.899Z
Learning: For OpenGamingCollective/asusctl’s rog-control-center Slint UI, keyboard navigation, focus indicators, and accessible slider behavior should be addressed together in a follow-up PR by improving shared widgets, rather than through piecemeal per-page fixes or separate issues.
📚 Learning: 2026-07-29T03:37:08.906Z
Learnt from: NB-Group
Repo: OpenGamingCollective/asusctl PR: 230
File: rog-control-center/ui/pages/aura.slint:141-211
Timestamp: 2026-07-29T03:37:08.906Z
Learning: In `rog-control-center/ui/pages/aura.slint`, the four fixed `RogEffectButton` controls intentionally mirror the Armoury Crate effect set and rely on `AuraPageData.supported_basic_modes` being in stable ASUS mode order. Their fixed labels/icons are deliberately paired with the corresponding mode by index; do not recommend dynamically generating these controls merely because the available-mode lists are dynamic.
Applied to files:
asusd/src/aura_laptop/trait_impls.rsasusd/src/aura_manager.rs
🔇 Additional comments (2)
asusd/src/aura_laptop/trait_impls.rs (1)
48-69: LGTM!Also applies to: 162-165, 208-211
asusd/src/aura_manager.rs (1)
8-10: LGTM!Also applies to: 137-154, 213-222
|
Isn't the missing backlight control an issue in the kernel rather than something we need workarounds for in userspace? The warnings aren't necessarily wrong. Also this PR seems to do a lot more than that.. |
Yeah that should be kernel side rather than on asusctl |
|
sorry im going to rework on this |
You could open an issue with relevant logs and details. Since we already have ongoing keyboard backight work, this fix can be sent as part of my upcoming patches. Tag me in the issue you create and close this PR |
b572eca to
3ec2e3e
Compare
|
Thanks for the feedback. I reworked the PR and removed the keyboard backlight workaround entirely. The PR is now limited to the GX651AR AURA button handling. The listener is bound to the already-identified GX651AR 0b05:1ce6 Aura HID interface rather than performing a separate HID scan, and it uses the existing Aura mode-setting path to cycle modes. I also verified the button behavior on the GX651AR: each press advances exactly one mode through Static → Breathe → RainbowCycle → Pulse → Static. This should leave the missing generic keyboard backlight control as a separate kernel-side issue. |
The ASUS ROG Zephyrus Duo GX651AR detachable keyboard exposes its
Aura button through the same HID interface used for Aura LED control.
On the GX651AR, the AURA button generates an input report on the
0b05:1ce6 USB keyboard's Aura HID interface (interface 1.2). The
listener previously discovered this HID node independently, which
could allow the listener to become associated with the wrong Aura
device when multiple Aura devices were present.
This change binds the AURA button listener to the specific HID device
being initialized. The listener is only started when the current
device is the verified GX651AR Aura interface, and its already-resolved
hidraw device node is passed directly to the listener.
This keeps the button listener associated with the correct
AuraZbusinstance and HID device, while avoiding a second independentdevice scan.
The listener then uses the existing Aura mode-changing path to advance
through the supported Aura modes when the GX651AR AURA button is
pressed.
Tested Hardware & Environment
Verification and testing
cargo clippy --all -- -D warningscargo crankyasusdsuccessfullyStatic → Breathe → RainbowCycle → Pulse → Staticrepeated button presses