| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hey there, I tested this PR locally on Linux Mint 22.1 with a Logitech G733 (046d:0afe). What worked correctly on real hardware:
However, I found a behavioral issue with combined lighting state:
This also matches the current implementation in lib/devices/logitech_g633_g933_935.hpp:
So from my testing, isolated static color control looks good, and the animation modes themselves do work, but combined color/mode/brightness state is not fully preserved yet on 046d:0afe. I think the underlying issue is state composition rather than the raw packet format itself. A cleaner fix would probably be to store the current lighting state in the device instance (RGB, brightness, mode, speed, enabled) and have all of setLights(), setLightColor(), setLightBrightness(), setLightMode(), and setLightSpeed() update that state and then call a single helper that writes the full state to both zones. |
Sorry, something went wrong.
|
Code review — 2 issues found Issue 1: Color lost when combining --light-color with other light flags File: lib/devices/logitech_g633_g933_935.hpp, lines 154–157 HeadsetControl/lib/devices/logitech_g633_g933_935.hpp Lines 154 to 157 in b1592f4 setLightBrightness, setLightMode, and setLightSpeed all hardcode RGB to (0x00, 0xff, 0xff) (cyan). The class stores light_mode_ and light_speed_ as members but has no light_color_ member, so when any of these runs after setLightColor, the device is reprogrammed to cyan and the user-supplied color is lost. Reproducer: headsetcontrol --light-color purple --light-mode breathing ends up cyan-breathing because setLightMode runs second and calls sendZoneLighting with hardcoded cyan. The comment // Keep current color roughly cyan if we don't know previous color acknowledges the root cause. The same hardcoded pattern appears in setLightMode (lines 184–188) and setLightSpeed (lines 227–231). Fix: Add mutable std::array<uint8_t, 3> light_color_ {0x00, 0xff, 0xff}; to the private section, persist it in setLightColor, and replace the three hardcoded r/g/b blocks with reads from light_color_. Issue 2: C API enum renumbering is an ABI-breaking change File: lib/headsetcontrol_c.h, lines 91–107 HeadsetControl/lib/headsetcontrol_c.h Lines 91 to 107 in b1592f4 The four new HSC_CAP_LIGHT_* entries are inserted at positions 4–7, shifting every existing value by 4 (HSC_CAP_INACTIVE_TIME moves from 4 to 8, HSC_NUM_CAPABILITIES from 16 to 20). Any pre-compiled consumer of the public C library API (the GUI apps in README.md) that passes the old integer 4 for inactive time will silently query HSC_CAP_LIGHT_COLOR instead. Fix: append the new entries to the end of the enum to preserve existing integer assignments: HSC_CAP_INACTIVE_TIME = 4,
...
HSC_CAP_BT_CALL_VOLUME = 15,
HSC_CAP_LIGHT_COLOR = 16,
HSC_CAP_LIGHT_BRIGHTNESS = 17,
HSC_CAP_LIGHT_MODE = 18,
HSC_CAP_LIGHT_SPEED = 19,
HSC_NUM_CAPABILITIES = 20,
Note: the C++ capabilities enum in lib/device.hpp is used only by name (never by integer), so it is not affected. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Changes made
Implemented advanced RGB lighting control for the Logitech G733 family (via the existing LogitechG633Family device handler).
Usage examples (one setting at a time):
Related context:
Checklist