-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
LED Output glitches on C3 #4382
Comments
Hi @DedeHai yes this glitching is really a hard-to-solve problem. I've made lots of attempts, even tried a ton of snake oil, but I still have a setup with esp32 and 2 outputs (512 and 256 leds) where the second output regularly flickers especially when reloading the UI. Below is what I've learned so far. Some observations:
The snake oil section:
These ideas did not work:
|
WLED forces the web server to run on the same core as |
Thank you for the explanation and sharing your experience. The proper fix would be to promote RMT interrupts to highest priority over any others, but I don't know if that is even possible and it probably requires changes to the IDF config, which of course we cannot change using the Arduino framework. @Makuna do you know why enabling wifi-sleep on a C3 causes glitches in LED data sendout and is there a fix or workaround that could be used in WLED? |
Thanks for that hint: enable wifi sleep on C3, run any FX so i checkd the checkbox to disable wifi sleep on all my devices and not mostly all glitches are away. on my esp32 c3/s2 minis work now nicely without them |
Note that RMT API I am using is being depreciated. The Core3 branch of my library uses the new RMT APIs which may solve this issue in the long term. But... In "NeoEsp32RmtMethod.h", you will find the following code...
The flag values are defined in "esp_intr_alloc.h" as
I would try adding the ESP_INTR_FLAG_IRAM back first and see the results
If that doesn't solve it, then change to only accept level 3 or level 2.
|
Also note, the C3 (all the C chips?) is a single core. This is problematic with any routines that have long ISRs or long "high priority" level. And due to RMT have a very small, dedicated DMA memory bank, you will be limited to size of the strip if you don't use a "translate and fill" ISR. This is the ISR priority that is mentioned in my last post; and it can't be higher that LEVEL 3. I haven't confirmed the C3 has the same limitations on RMT DMA memory as previous version, but the API should have buffered NPB from the problem, but they deprecated the API and I believe thus didn't update it. AND, you can't really put any ISRs at a higher level that WiFi or it will cause problems with connections and data transfers. I tried this with the bitbang method and they just aren't compatible and its why I do not recommend the use of bitbang as it can't be set at a high enough priority to be consistent. Note, the I2S Parallel doesn't have this limitation. I have always suggested for most platforms (NPB is multiplatform, not just ESP) that when you have such routines, that you pause the NPB output completely (don't call show) while they are active. Not always a workable solution. |
thank you for the in-depth explanation, appreciate it. |
What happened?
I would like to understand and possibly try to fix the glitching issues on the C3.
This bug is well known, so nothing new. There are two flavours of it I think: one is related to wifi-sleep, random glitching every few seconds if wifi-sleep is enabled. The second one may be related to file access and / or wifi resource conflicting with LED output.
Does anyone know more about this or whether it can be fixed with the currently used core libraries?
To Reproduce Bug
Expected Behavior
Install Method
Self-Compiled
What version of WLED?
0.15 (but maybe also in 0.14, did not check)
Which microcontroller/board are you seeing the problem on?
ESP32-C3
Relevant log/trace output
No response
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: