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

Bugs in blending styles #4520

Open
1 task done
DedeHai opened this issue Jan 25, 2025 · 8 comments
Open
1 task done

Bugs in blending styles #4520

DedeHai opened this issue Jan 25, 2025 · 8 comments
Assignees
Labels

Comments

@DedeHai
Copy link
Collaborator

DedeHai commented Jan 25, 2025

What happened?

Playing with blending styles I found these issues:

  • when transition time is set >1s, the first transition after selecting a new style does not start from the beginning
  • during transitions, FPS limit is disabled, making all PS effects speed up (this may be related to the new FPS limit handling)

To Reproduce Bug

see above

Expected Behavior

  • animations always start from beginning
  • no chang in FPS limit during transitions

Install Method

Self-Compiled

What version of WLED?

nightly

Which microcontroller/board are you seeing the problem on?

ESP32-C3

Relevant log/trace output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@DedeHai DedeHai added the bug label Jan 25, 2025
@blazoncek blazoncek self-assigned this Jan 27, 2025
@DedeHai
Copy link
Collaborator Author

DedeHai commented Jan 31, 2025

I want to add the "blending" on brightness change to the list. I only tested that on 2D so far and it makes 2D setups unusable with anything other than "fade". I dont think anyone wants to go to base color every time the brightness changes.

edit:
it is the same in 1D. to reproduce: choose any effect other than solid, set to swipe right for example, change brightness.

@DedeHai
Copy link
Collaborator Author

DedeHai commented Feb 9, 2025

I did some investigation on the "FPS limit not respected" issue. Printing out time intervals between service() shows it is correct. however, there seems something odd about transitions, FPS do drop a lot even if it is not an FX transition, for example I set the transition time to 5s, ran three "soap" FX in overlay (to stress the MCU more) and compared 0.15 to 0.16:

Image

in 0.15 there is barely any change in FPS, in 0.16 it drops significantly. I can confirm this is happening only since the "blending styles" were merged.
@softhack007 do you know what is going on here? may this be related to your update to FPS limit/timing handling? Unfortunately the commits are all over so I was not able to pin it to any commit.

edit:
during my testing, commenting this line made the FPS drop go away (and also breaks transitions, so just as a hint): https://github.com/Aircoookie/WLED/blob/4d53e0adde054519e84b5bc1b637452980ff9975/wled00/FX_fcn.cpp#L1531

@blazoncek
Copy link
Collaborator

What if you move min() out of function call?

unsigned frameDelay2 = (*_mode[seg.currentMode()])();
if (frameDelay2 < frameDelay) frameDelay = frameDelay2;

@DedeHai
Copy link
Collaborator Author

DedeHai commented Feb 10, 2025

The issue is actually not the frame delay, that stays constant and correct.
what may be at play is how old/new FX is treated during non-FX transitions. So far I was not able to decipher what exactly is going on but FPS drop suggests that effects are executed twice now where as in the old code it was not.

@blazoncek
Copy link
Collaborator

effects are executed twice now where as in the old code it was not.

That is correct and expected if you want to transition from one effect to another. Unfortunately if effect does not change it is still run twice as color/palette change may need rewriting LED data.

@DedeHai
Copy link
Collaborator Author

DedeHai commented Feb 10, 2025

can it be skipped in fade mode?
The double-execution of course makes sense in other transition styles but in fade it just slows down the FX "for no apparent reason", also some effects can speed up (all PS effects for example, maybe some others as well).
Since fade was the default up to now, it should behave the same as before.

@blazoncek
Copy link
Collaborator

Not with current implementation. It would require additional checking.

@blazoncek
Copy link
Collaborator

FYI if you did not notice in previous versions, there was an abrupt change of effect at some point of transition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants