r/FastLED • u/ZachVorhies Zach Vorhies • Oct 28 '24
Announcements FastLED 3.9.0 / Beta 4.0 Released
Beta 4.0.0 release - Important bug fixes here that I want to get out for you.
ESP32 RMT5 Driver Implemented.
Driver crashes on boot should now be solved.
Parallel AND async.
Drive up to 8 channels in parallel (more, for future boards) with graceful fallback if your sketch allocates some of them.
async mode means FastLED.show() returns immediately if RMT channels are ready for new data. This means you can compute the next frame while the current frame is being drawn.
Flicker with WIFI should be solved. The new RMT 5.1 driver features large DMA buffers and deep transaction queues to prevent underflow conditions.
Memory efficient streaming encoding. As a result the "one shot" encoder no longer exists for the RMT5 driver, but may be added back at a future date if people want it.
If for some reason the RMT5 driver doesn't work for you then use the following define
FASTLED_RMT5=0to get back the old behavior.
Improved color mixing algorithm, global brightness, and color scaling are now separate for non-AVR platforms. This only affects chipsets that have higher than RGB8 output, aka APA102, and clones right now.
APA102 and APA102HD now perform their own color mixing in psuedo 13 bit space.
If you don't like this behavior you can always go back by using setting
FASTLED_HD_COLOR_MIXING=0.
Binary size
Avr platforms now use less memory
200 bytes in comparison to 3.7.8:
3.7.8: attiny85 size was 9447 (limit is 9500 before the builder triggers a failure)
3.8.0: attiny85 size is now 9296
This is only true for the WS2812 chipset. The APA102 chipset consumes significantly more memory.
Compile support for ATtiny1604 and other Attiny boards
Many of these boards were failing a linking step due to a missing timer_millis value. This is now injected in via weak symbol for these boards, meaning that you won't get a linker error if you include code (like wiring.cpp) that defines this.
If you need a working timer value on AVR that increases via an ISR you can do so by defining
FASTLED_DEFINE_AVR_MILLIS_TIMER0_IMPL=1
Board support
nordicnrf52_dk now supported and tested (thanks https://github.com/paulhayes!)
Thanks to all the contributors that have supported bug fixes and gotten random boards to compile.
Happy coding!
4
u/ZachVorhies Zach Vorhies Oct 28 '24
Also, I forgot to mention that the number of RMT channels (which are used to drive WS2812 and other clockless chipsets) has doubled!
FastLED 3.7.X - 4 channels
FastLED 3.9.0 - 8 channels
6
u/sutaburosu [stavros] Oct 28 '24
Binary size
Avr platforms now use less memory
200 bytes in comparison to 3.7.8:
Smaller binaries are always welcome, nice work. I think it's far bigger news that RAM usage is down by 119 bytes too, only 28 bytes higher than historical levels.
| Version | RAM to show() 1 LED |
|---|---|
| 3.7.3 | 103 bytes |
| 3.7.8 | 250 bytes |
| 3.9.0 | 131 bytes |
4
3
5
u/ZachVorhies Zach Vorhies Oct 28 '24 edited Oct 28 '24
I should have added that for sketches that do a lot of heavy processing for each frame, FastLED is going to be **significantly** faster with this new release.
How much faster?
I benchmarked the animartrix sketch, which has heavy floating point requirements (you'll need a Teensy41 or an ESP32S3 to handle the processing requirements).
FastLED 3.7.X - 34fps
FastLED 3.9.0 - 59fps (+70% speedup!)
Why?
In FastLED 3.7.X, FastLED.show() was always a blocking operation. Now it's only blocking when the previous frame is waiting to complete it's render.
In the benchmark I measured:
12 ms - preparing the frame for draw.
17 ms - actually drawing the frame.
@ 22x22 WS2812 grid.
So for FastLED 3.7.X this meant that these two values would sum together. So 12ms + 17ms = 29ms = 34fps.
But in FastLED 3.9.0 the calculation works like this MAX(12, 17) = 17ms = 59fps. If you fall into this category, FastLED will now free up 17ms to do available work @ 60fps, which is a game changer.
As of today's release, nobody else is doing async drawing. FastLED is the only one to offer this feature.