New LED hardware driver: WLED Pixel Bus#5704
Conversation
still not working
…dy to avoid multiple sendouts
|
This is great! Thanks so much! I built for then flashed OTA.
Bord sold as “TENSTAR ESP32-C3 Supermini Plus Development Board WiFi Bluetooth ESP32 C3 Super mini V2.0 Red Board” Not a power supply issue: reboots while LEDs are off, but can turn to 255/255 white for 5 min and it's fine & wasn't happening on glitchy firmware that used the same PSU. Happy to perform tests or get serial logs if you need? |
|
thanks for testing. Yes I am aware of this bug but I was not able to track it down, it's something to do with low level RMT stuff from espressif, maybe a buffer race condition or whatnot. If you use the SPI driver instead of RMT there should be no crashes. |
|
@willmmiles I made some progress and think this PR is coming along nicely. Still a lot of work left and I hit a bit of a road-bump on the C3: for some reason it crashes when using RMT. I tried to track it down and it all works up to the point where rmt_write_sample() is called in show(). Under heavy WiFi traffic I can easily get it to stall within a minute, everything freezes up for a few seconds, then reboots, similar to the issue with using the high priority driver but I am not using that on the C3. |
I certainly wouldn't rule it out. IIRC the signature to look for is a watchdog timeout in |
|
ok, I will leave it "as is" for now, it just was strange that it crashes quite soon (minutes) when stressing it and I can not get 16.0 to crash at all (have tried for hours under full load). Maybe it has also something to do with RMT init sequence, I did not check if its done the very same way as NPB. |
This is a major update adding WLED Pixel Bus written from scratch to replace NeoPixelBus and it packs a lot of useful features. From a user perspective the main improvements are less memory use and dynamic adjustment of LED timing to eliminate flickering by fine-tuning the timing from -30% to + 30% in 10% steps (dropdown menu).
The new hardware driver structure allows for fully dynamic updates of LED outputs and LED timings. It also adds glitch free parallel SPI output support on the C3 as well as parallel bit-banging on all platforms including ESP8266.
All parallel outputs (except bit-bang) use ping-pong DMA buffers instead of fully pre-filled buffers - memory usage is optimized and DMA buffers are independent of number of LEDs. Also the calculation from LED colors to DMA buffers is highly speed optimized, making the driver blazing fast - I saw 30% FPS improvements in some cases.
The fully dynamic nature of the driver allows for a "Custom digital bus" in the LED settings to support virtually any LED bus type out there - specify timing, number of color channels, invert any color channel or set any color channel combination. The driver also supports inverting the output signal on any pin (ESP32 only).
The LED config UI was updated to fully support the new driver options.
A lot more testing is required for all different kind of LEDs on all platforms. I am sure there is a ton of bugs and kinks to iron out.
I would like to take this opportunity to thank @Makuna for his outstanding work on NeoPixelBus which served me well as a reference on hardware configurations and special LED types.
ESP32 flash and RAM usage comparison (bit bang disabled)
using NeoPixelBus
RAM: [== ] 24.9% (used 81576 bytes from 327680 bytes)
Flash: [======== ] 83.1% (used 1306493 bytes from 1572864 bytes)
Free Heap: (6 outputs, 256 each): 79.8k
using WLEDpixelBus
RAM: [== ] 24.9% (used 81680 bytes from 327680 bytes)
Flash: [======== ] 83.0% (used 1306053 bytes from 1572864 bytes)
Free Heap: (6 outputs, 256 each): 92.8k
Summary by CodeRabbit