Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghost pixels with "Use global LED buffer" #58

Open
1 task done
softhack007 opened this issue Jul 13, 2023 · 0 comments
Open
1 task done

ghost pixels with "Use global LED buffer" #58

softhack007 opened this issue Jul 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@softhack007
Copy link
Collaborator

softhack007 commented Jul 13, 2023

What happened?

The "Use global LED buffer" (LED preferences) option can add ghost pixels which are not there without global buffer.

To Reproduce Bug

It seems that "ingredients" are

  • using global leds buffer, plus
  • some segments have width different from the overall 2D layout, plus
  • a smaller segment overlaps with the bigger one, plus
  • a) the bigger segment does something that reads buffered leds -> blur, fade-out, move, ...
  • b) or the smaller segment is an overlay

Example:

  • global leds size 24x37
  • segment 0: black hole effect
  • segment 1: android effect
  • segment 2: size 12x8 (scrolling text overlay "45")
  • the white pixels to the right of "45" should not be there. They are "ghosts" from segment 2.

GlobalLEDs_epic_fail

First Analysis

  • when drawing a pixel into segment[2], two things happen in setpixelcolorXY
    1. if (ledsrgb) ledsrgb[XY(x,y)] = col; // buffer assigned to segment
    1. strip.setPixelColorXY(start + xX, startY + yY, col); // write-thru to NPB driver

the "ghost pixels" are from the write to ledsrgb, which assumes wrong buffer coordinates; XY() is computed using segment boundaries only. As Segment#0 later uses "blur()", the global ledsrgb buffer pixels are used and ghost pixels appear next to the white text.

Conclusion

It seems we need a different XY() function for global buffer, as it must consider the "global" width instead of segment width. I think this new global_XY() needs to also use rotation and mirroring of a segment in the calculation.

Expected Behavior

Effects look (almost) the same, independent from using global buffer or not.

Install Method

Self-Compiled or other

What version/release of MM WLED?

any 0.14.0 build

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

This problem exists since "global buffer" was introduced in upstream WLED 0.14.
We can either

  • wait until 0.14.0-beta4 is available (where global buffer will be removed)
  • find our own solution for MM (in case we want to keep global double-buffering)

To avoid wrong pixels, I would suggest to not use global buffer unless all segments have the same width as your overall layout. Without global buffer, there are no wrong pixels.

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant