Skip to content

APA102/SK9822 FASTLED_USE_GLOBAL_BRIGHTNESS: field from pixel 0 dims the rest of the strip; unreviewed on managed channels #4457

Closed

Description

@zackees

Problem

Found while writing P8's encoder table (#4445, docs/color-pipeline-contracts.md → "Encoder table").

With FASTLED_USE_GLOBAL_BRIGHTNESS=1 (off by default), APA102/SK9822 (non-HD) encode through encodeAPA102_AutoBrightness / encodeSK9822_AutoBrightness:

  • They derive one strip-wide 5-bit field from the first pixel's peak.
  • They rescale only that pixel's codes to it.
  • Every other pixel keeps its codes under the reduced field, so it is dimmed by field/31.

The legacy APA102Controller does the same for pixels 2..n: getGlobalBrightnessAndScalingFactors, commented "This function is pure magic."

It also runs on colour-managed channels. There it re-derives a field from drives the pipeline already solved. The encoder table names this as the one exception to "no second shaping stage after the device solve" (§6).

Decide

  1. Is the first-pixel-only rescale intended? It dims the rest of the strip by a factor chosen from pixel 0.
  2. On a managed channel, should this mode hold the field fixed (B1's conservative treatment) instead?

Not in scope of P8

P8's criteria are met without it. This is a pre-existing legacy behaviour, and changing it changes output for every sketch that sets the flag.

Part of #4034.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions