Skip to content

Some effects are not working with "sparse" LED matrix #3712

Closed

Description

@imeszaros

What happened?

In my clock project I'd like to use the 2D features of WLED, so I set up a ledmap.json where my "display" is 17x7 matrix, but lot's of LEDs are missing so I put -1 to the appropriate places (having 58 LEDs instead of 119 only).

The above works totally fine except that some effects refuse to work properly, since they update their output using the colors from the previous effect iteration. Since physically missing LEDs also do not have memory allocations, the previous color cannot be used by the effect to work properly.

To Reproduce Bug

Create a matrix with one row "missing" i.e. with -1 cells in ledmap.json and try to use the Matrix effect for example. Rows under the "missing" row will not be affected by the effect.

Expected Behavior

All effects work with sparse matrices.

Install Method

Self-Compiled

What version of WLED?

0.14.1

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

I could work the problem around by setting the LED count to the theoretic number of LEDs (17x7=119) and filling the -1 cells with numbers >58 incrementally, this way WLED allocates the necessary memory for all the LEDs and effects work properly, but the problem is that automatic brightness limiter now thinks of course that there are 119 LEDs instead of 58 so it estimates that more current is flowing and therefore it limits the brightness to significantly less value.

To be honest I do not know what the proper solution would be. Maybe -2 in ledmap.json could mean that the pixel is phisically not there (do not consider it with ABL nor try to drive it i.e. do not shift out the value to the strip) but allocate memory for it for calculations.

Another workaround would be to allow an overriding LED count for the ABL feature. Whis probably makes things even more confusing... :)

I would happy to help with this if a decision is made about which direction to go to.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. blazoncek commented on Jan 22, 2024

    @blazoncek
    Contributor

    Known issue for the effects that rely on previous pixel values. For sparse matrices missing pixels will always produce black value.
    There is no other way than to re-engineer such effects.

  2. added
    confirmed
    on Jan 22, 2024
  3. blazoncek commented on Jan 22, 2024

    @blazoncek
    Contributor

    BTW I fixed Matrix effect in the upcoming 0.15.

  4. imeszaros commented on Jan 22, 2024

    @imeszaros
    ContributorAuthor

    Thanks for the confirmation. Just for reference, in 0.14.1 the following effects are affected (calling SEGMENT.getPixelColor(...) or SEGMENT.getPixelColorXY(...)):

    • mode_fireworks
    • mode_rain
    • mode_juggle
    • mode_colortwinkle
    • mode_ripple (via ripple_base())
    • mode_ripple_rainbow (via ripple_base())
    • mode_2Dgameoflife
    • mode_2Dmatrix - fixed in 0.15
    • mode_matripix
    • mode_pixelwave
    • mode_DJLight
    • mode_freqmatrix
    • mode_freqwave
    • mode_waterfall
    • mode_2DFunkyPlank
    • mode_2Dsoap
  5. added
    backburner
    on Jan 22, 2024
  6. added this to the 0.16.0 candidate milestone on Nov 2, 2024
  7. blazoncek commented on Jul 12, 2025

    @blazoncek
    Contributor

    No longer an issue since 0.16

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    backburnerbugconfirmed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions