Add stick lighting control for the AYN Odin 3 - #255
Open
Rayekkk wants to merge 1 commit into
Open
Conversation
The Odin 3 has two HTR3212 controllers driving four RGB emitters around each stick, and the kernel already exposes all 24 channels, but nothing in userspace ever wrote to them, so the rings stayed dark. Add a small daemon that applies a saved colour, brightness and mode, and a Stick Lighting section in Armada Control's Settings tab to drive it. The layout was mapped on hardware rather than read off the device tree. Channel labels match the emitted colours, both rings run clockwise, and the right ring is offset by one position from the left: upper left is l:*4 and r:*1, upper right l:*1 and r:*2, lower right l:*2 and r:*3, lower left l:*3 and r:*4. The four emitters are not evenly spaced, with a wider gap on the left of each ring, so no animation runs around the circumference; the modes are static and breathing only. Levels are gamma corrected before they reach the PWM registers because duty is linear in current and perception is not, and breathing runs at 60 Hz because 20 Hz visibly bands on a four second ramp. armada-ledd polls its config file instead of taking a signal so the Quick Access Menu can preview a colour while a slider is being dragged. The unit carries no ConditionPathExists: systemd evaluates conditions once, and the i2c controllers can probe after the unit starts, so the daemon waits for the LED devices itself. Lighting is gated on ayn-odin-3, the only device whose ring wiring has been verified. The AYN Thor, Odin 2 Portal and Retroid Pocket 6 declare the same controllers in their device trees, but nobody has confirmed their layout, so they are deliberately left out. Off by default, so an update does not change how anyone's device looks without being asked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #167 for the Odin 3.
The Odin 3 has two HTR3212 controllers driving four RGB emitters around each stick. The kernel already exposes all 24 channels at
/sys/class/leds/{l,r}:{r,g,b}{1..4}, but nothing in userspace ever wrote to them, so the rings have always been dark. This adds a small daemon plus a Stick Lighting section in Armada Control's Settings tab: colour, brightness, and a static or breathing mode, with an optional separate colour per stick.Off by default, so an update does not change how anyone's device looks without being asked.
Verified on hardware, not read off the device tree
Everything below was measured on an Odin 3 running
beta(20260729.d812101), not inferred:ledr_b1carrieslabel = "r:r1"), and it is the exported labels that are right.l:*4andr:*1, upper rightl:*1andr:*2, lower rightl:*2andr:*3, lower leftl:*3andr:*4.Implementation notes
armada-leddpolls its config file rather than taking a signal, so the Quick Access Menu can preview a colour while a slider is being dragged.ConditionPathExists. systemd evaluates conditions once, and the i2c controllers can probe after the unit starts, so the daemon waits for the LED devices itself and exits cleanly if they never appear.ayn-odin-3. AYN Thor, Odin 2 Portal and Retroid Pocket 6 declare the same controllers in their device trees, but nobody has confirmed their ring layout, so they are deliberately left out. Enabling them is a one line change once someone with the hardware maps them.Why Armada Control and not Steam's own UI
Steam has no general device lighting API, and
steamos-managerexposes nothing for LEDs either. The only native route is the DualSense lightbar: InputPlumber 0.77.2 ships an LED source driver that forwards a target device's colour to a LED class device. Taking it would mean:leds-group-multicolor(the kconfig option is already enabled), because that driver needsmulti_intensityandmulti_index, which the Odin 3 does not expose;That route is worth having later, and the recipe above is the whole of it, but the two must be made mutually exclusive if it ever lands, because they would fight over the same LEDs.
Tests
tests/leds-test.shcovers config clamping and fallbacks, the gamma conversion, both daemon exit paths, and asserts the unit has noConditionand that the image actually enables the service. It was checked by mutation: reverting the fixes turns it red.The rest of
tests/passes, exceptabl-update-test.shandperf-settings-test.sh, which fail the same way on a pristinemainand are unrelated to this change.