Skip to content

fix(asusd): bind GX651AR AURA button listener to matching HID device - #289

Closed
Cymirk wants to merge 11 commits into
OpenGamingCollective:mainfrom
Cymirk:aura-button-cycle-mode
Closed

fix(asusd): bind GX651AR AURA button listener to matching HID device#289
Cymirk wants to merge 11 commits into
OpenGamingCollective:mainfrom
Cymirk:aura-button-cycle-mode

Conversation

@Cymirk

@Cymirk Cymirk commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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
AuraZbus instance and HID device, while avoiding a second independent
device 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

  • ASUS Laptop Model: ROG Zephyrus Duo GX651AR
  • Keyboard: ASUS 0b05:1ce6 detachable keyboard
  • Aura interface: USB interface 1.2
  • Linux Distribution: Fedora 44

Verification and testing

  • Self-reviewed the change
  • cargo clippy --all -- -D warnings
  • cargo cranky
  • Built and installed asusd successfully
  • Verified the GX651AR AURA button is detected
  • Verified each button press advances exactly one Aura mode
  • Verified mode cycling wraps correctly:
    Static → Breathe → RainbowCycle → Pulse → Static
  • Verified Aura mode changes continue to work without requiring
    repeated button presses
  • Verified the listener is bound to the matching GX651AR HID interface

Cymirk and others added 10 commits August 10, 2026 18:45
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.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5e086343-0a7d-4420-98b4-3f72c11bd267

📥 Commits

Reviewing files that changed from the base of the PR and between b572eca and 3ec2e3e.

📒 Files selected for processing (1)
  • asusd/src/aura_manager.rs
📜 Recent review details
🧰 Additional context used
🧠 Learnings (1)
📓 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.
🔇 Additional comments (3)
asusd/src/aura_manager.rs (3)

8-10: LGTM!

Also applies to: 137-154, 197-206, 325-329


175-190: 🩺 Stability & Availability

No change needed. Linux hidraw returns EIO when the device disconnects, and the existing error branch breaks the loop.

			> Likely an incorrect or invalid review comment.

161-194: 🩺 Stability & Availability

No listener shutdown change is required. hidraw wakes a blocked read on device removal and returns an error. This listener handles that error, exits, and drops its File and AuraZbus clone, so it does not leave a duplicate listener after re-enumeration.

			> Likely an incorrect or invalid review comment.

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added support for cycling through Aura lighting modes, including wrapping from the last mode to the first.
    • Added ASUS Zephyrus Duo Aura-button support for switching lighting modes.
  • Bug Fixes
    • Improved lighting-mode handling when no compatible backlight is available.
    • Enhanced reliability when opening or reading the Aura-button interface.

Walkthrough

Adds AuraZbus::cycle_led_mode and connects the Zephyrus Duo AURA button to a hidraw listener. The listener detects button reports and cycles Aura modes. Brightness restoration now requires an available backlight.

Changes

Aura button mode control

Layer / File(s) Summary
Aura mode cycling and brightness handling
asusd/src/aura_laptop/trait_impls.rs
cycle_led_mode advances through supported modes with wraparound and handles empty or unsupported mode lists. Brightness restoration runs only when a backlight exists.
AURA-button HID integration
asusd/src/aura_manager.rs
The Aura manager detects interface 0b05:1ce6 version 1.2, reads matching hidraw reports, invokes cycle_led_mode, and starts the listener after Aura task setup.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: ⚪ Minimal · up to 3ec2e

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: asusd, rog-aura, fix

Suggested reviewers: scardracs

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()
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately identifies binding the GX651AR AURA listener to the matching HID device, a central change in the pull request.
Description check ✅ Passed The description explains the changes, tested hardware, environment, and verification results, although the issue and kernel version are unspecified.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added asusd System Daemon / D-Bus fix Fix a bug or an issue rog-aura Keyboard / Aura RGB labels Aug 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5d4da and b572eca.

📒 Files selected for processing (2)
  • asusd/src/aura_laptop/trait_impls.rs
  • asusd/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.rs
  • asusd/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

Comment thread asusd/src/aura_manager.rs Outdated
@Ghoul4500

Copy link
Copy Markdown
Member

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..

@scardracs

Copy link
Copy Markdown
Contributor

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

@Cymirk

Cymirk commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

sorry im going to rework on this

@Ghoul4500

Copy link
Copy Markdown
Member

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

@Cymirk
Cymirk force-pushed the aura-button-cycle-mode branch from b572eca to 3ec2e3e Compare August 12, 2026 23:27
@Cymirk Cymirk changed the title fix(asusd): tolerate missing keyboard backlight on Aura mode changes fix(asusd): bind GX651AR AURA button listener to matching HID device Aug 13, 2026
@Cymirk

Cymirk commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

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.

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

Labels

asusd System Daemon / D-Bus fix Fix a bug or an issue rog-aura Keyboard / Aura RGB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants