Skip to content

introduce new_with_rmt_driver() to be able to use multiple mem blocks for TxRmtDriver to mitigate flickering #62

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

Conversation

weber-software
Copy link

I had the issue that my output was flickering like describe over here: #33

Using two mem blocks solved the flickering entirely for me (and i think for many others).

@aligator
Copy link

I tried it and on my first tests this improved it a lot.
Thanks for this finding.

I stil got veeeery few flickerings, but in dev mode. I expect it to be even better in production mode.

My test just used one extra thread with a webserver set up using std threads.
i did not change the CPU core. (Just the default stack size)
Led code was directly in the main thread.

Before this change the leds freaked out with this configuration.

@cat-in-136
Copy link
Owner

cat-in-136 commented Feb 24, 2025

@weber-software Thank you for great survey and PR.

This fix also corresponds to the contents of the following URL, so it is a good workaround.

But, the fundamental fix should be to be able to change mem_block_num. For example, there is a report on the latter forum post that says the issue was solved by setting mem_block_num = 8.

@weber-software
Copy link
Author

@cat-in-136 i agree that it would be a good idea to make the mem_block_num configurable. In which way would you prefere?

  • adding mem_block_num as a parameter to new
  • adding another method new_with_mem_block_num
  • adding a builder
  • a different solution that i don't see

@weber-software weber-software changed the title use two mem blocks for TxRmtDriver to mitigate flickering use multiple mem blocks for TxRmtDriver to mitigate flickering Feb 25, 2025
@cat-in-136
Copy link
Owner

@weber-software It would be appropriate to create a builder for Ws2812Esp32RmtDriver. I havenot investigated yet what to do for smartled and embeddedgraphics: passing driver as argument or create a builder for each?

(The existing new() function should be retained. These legacy functions are still useful for convenience.)

@weber-software weber-software force-pushed the fix-flickering-by-using-2-mem-blocks branch from 47f4577 to f5f70d6 Compare February 27, 2025 11:02
@weber-software
Copy link
Author

@cat-in-136 i scribbled around a bit and came to the conclusion that it could be useful to have a function that accepts a TxRmtDriver. That way we could keep complexity out of this library. What do you think?

@weber-software weber-software force-pushed the fix-flickering-by-using-2-mem-blocks branch from f5f70d6 to 6434316 Compare February 27, 2025 11:09
@cat-in-136 cat-in-136 added the enhancement New feature or request label Mar 1, 2025
Copy link
Owner

@cat-in-136 cat-in-136 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weber-software Could you please my review comment on lib_smart_leds.rs? Thank you.

@cat-in-136 cat-in-136 changed the title use multiple mem blocks for TxRmtDriver to mitigate flickering introduce new_with_rmt_driver() to be able to use multiple mem blocks for TxRmtDriver to mitigate flickering Mar 3, 2025
@cat-in-136 cat-in-136 merged commit 4824e56 into cat-in-136:main Mar 3, 2025
1 check passed
@cat-in-136
Copy link
Owner

Thanks a lot!

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

Successfully merging this pull request may close these issues.

4 participants