Adding support of subtracting of a white with a given color temperature#1993
Open
lougovsk wants to merge 13 commits intohyperion-project:masterfrom
Open
Adding support of subtracting of a white with a given color temperature#1993lougovsk wants to merge 13 commits intohyperion-project:masterfrom
lougovsk wants to merge 13 commits intohyperion-project:masterfrom
Conversation
This commit introduces RGBW (Red, Green, Blue, White) data handling
for the E1.31 UDP LED device.
Key changes:
1. **LedDeviceUdpE131.h modifications:**
* Included `utils/ColorRgbw.h` and `utils/RgbToRgbw.h`.
* Added private member variables:
* `_whiteAlgorithm` (RGBW::WhiteAlgorithm) to store the selected white calibration mode.
* `_ledRGBWCount` (int) to store the total number of channels (3 for RGB, 4 for RGBW).
* `_temp_rgbw` (ColorRgbw) as a temporary variable for color conversion.
2. **LedDeviceUdpE131.cpp modifications:**
* Constructor now initializes `_whiteAlgorithm` to `INVALID` and `_ledRGBWCount` to 0.
* `init()` method:
* Reads `whiteAlgorithm` from the device configuration (defaults to "white_off").
* Converts the string to `RGBW::WhiteAlgorithm`.
* Sets `_ledRGBWCount` based on `_ledCount` and whether a white channel is active (3 * _ledCount for RGB, 4 * _ledCount for RGBW).
* `write()` method:
* Uses `_ledRGBWCount` for `dmxChannelCount`.
* Creates a temporary buffer for pixel data.
* If `_whiteAlgorithm` is `WHITE_OFF`, copies RGB data directly.
* Otherwise, converts RGB to RGBW using `RGBW::Rgb_to_Rgbw` and copies R,G,B,W data.
* Populates E1.31 packet properties using the new (potentially RGBW) data buffer.
3. **JSON Schema Update (libsrc/leddevice/schemas/schema-e131.json):**
* Added a `whiteAlgorithm` property to the E1.31 device schema.
* This allows users to select the white channel calibration method ("white_off", "subtractive", "additive").
* Includes a default value of "white_off".
**Compilation Status:**
The project successfully configures with CMake after installing numerous dependencies (Qt6, libudev, XCB libs, ALSA, CEC, libp8-platform, libusb).
However, the `make` process consistently times out after approximately 6 minutes and 40 seconds, regardless of the number of parallel jobs (`-j nproc`, `-j 2`, `-j 1`) or if a specific target (`hyperiond`) is built.
This suggests a potential hang or an extremely long compilation step for a particular file/module within the project, which could not be identified due to lack of verbose output during the timeout.
Further investigation or environment adjustments are needed to complete the full build.
ledRGB(W)Count variable from LedDevice instead of creating a new locally 2. Fixed the problem where DMX Max channel count was hardcoded to 512. WLED e.g. in MultiRGB mode relies on 510 (3*170) channels. On other hand for MultiRGBW it expect 512 (4*128) channels. So obviously it has to be a parameter. 3. Updated corresponding configuration for WebUI
The previous implementation used the raw limiting channel value (uScale) as the white LED drive, which undershot by a factor of sumW/wlim. The correct drive under the 1/3-efficiency model is fRatio*sumW, capped at 255 with fActualRatio back-calculated for the RGB subtraction. Also fix div-by-zero on low color temperatures (zero white channel components), replace non-standard u_int16_t/u_int8_t with uint16_t/ uint8_t, fix invalid default whiteTemp=0 -> 5000, fix _customWhite- Temperature type int -> uint16_t, and improve readability of ColorRgb::white(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 1/3 efficiency assumption (fRatio * sumW) was over-driving the white channel by up to 2x at 2700K, causing warm white flood that washed out saturated colors: magenta lost saturation, green shifted yellow, cyan lost its blue component. Switch to 1:1 (fRatio * 255) which assumes the white LED matches one RGB channel in per-channel output — a better fit for typical RGBW strips. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Revert white drive from fRatio*255 back to fRatio*sumW to test whether the 1/3 efficiency model produces better results now that post-processing gamma correction is properly configured. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 5386c0b.
This reverts commit 2477854.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello @lougovsk 👋 I'm the Hyperion Project Bot and I want to thank you for To help you and other users test your pull requests faster, 🔗 https://github.com/hyperion-project/hyperion.ng/actions/runs/23771942253 Of course, if you make changes to your PR, I will create a new link. Best regards, |
pow/log -> qPow/qLn in ColorRgb::white(), add <QtMath> include. round -> qRound, std::numeric_limits::infinity() -> qInf() in RgbToRgbw.cpp, remove <limits> include. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hey @lougovsk I created a new link to your workflow artifacts: |
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.
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of web configuration, please provide the before/after screenshot:
After

Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing setups:
The PR fulfills these requirements:
Fixes: #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
This MR corresponds to the #1956