r/FastLED • u/kriegsman [Mark Kriegsman] • Sep 13 '23
Announcements Native RGBW driver work is finally starting, AVR first.
Hi, all. If there's one thing that we've wanted to add to FastLED for the longest time, it's been native support for RGBW LED strips in the low-level driver. Dan and I kicked that issue down the road for a few years, because re-writing our fancy AVR (classic Arduino) LED assembly language driver to handle RGBW was going to be a really annoying piece of work. And for these last four years, I've been kicking the issue down the road, without Dan, for basically the same reason.
So it is with some very very cautious optimism that I wanted to let the community know that I've finally started that long-avoided work: re-writing the AVR assembly driver code at the heart of FastLED so that it can natively drive four-channel (RGBW) LEDs as well as the classic three-channel LEDs (RGB). I have a new draft of the driver code up and running well enough to light up some RGBW pixels correctly, and so this seemed like a good point to let people know that I'm finally actually working on it.
I don't have a timeline to offer up yet, but I am actively working on this and, like weather, progress is happening.
I think that the order of things will be something like this:
- get the AVR (classic Arduino) driver up and running in its most basic form on RGBW pixels, so that people can start testing that
- Once I have the general shape of the AVR code pretty much determined, we can start 'porting' that structure over to the other microcontrollers: ARM, ESP, etc.
- In parallel with #2, we'll start expanding all the library 'color' functions and tools to be able to handle RGBW colors as well as RGB. FastLED has a lot of built-in color-related functionality, so this is probably going to be tackled in several separate chunks, e.g. Palettes, fill_ functions, colorspace conversions (HSV), etc.
As soon as there's code that's even a little bit worth sharing, I will definitely share it from a branch, and we can start taking code and bug-report contributions.
Usually when I make an 'announcement' there's some kind of code to try, or a new tool, or some new feature to play with, but not this time, not yet. But after all this time I did want to let everyone know that at long last, I am actively working on native RGBW support. Thank you so much for being such a great community of people, for helping each other through all kinds of problems, and for sharing and giving back so much; it means the world to me.
So: stay tuned, and wish me luck!
PS. Rather than posting incremental updates here, I'll be tracking progress on the RGBW driver code on this GitHub Issue: https://github.com/FastLED/FastLED/issues/1540 I'll post here on Reddit when there's something new for people to try out.
6
u/sutaburosu [stavros] Sep 13 '23
Thanks for this and the best of luck to you, Mark.
5
u/truetofiction Sep 13 '23
Thanks for trying to tackle this, Mark.
Is there any way we can contribute to the general RGBW function building?
5
u/[deleted] Sep 13 '23
I wish you luck! I can only imagine how much work this is. Thank you for doing that for the community! As always, I must add.
3
u/StefanPetrick Sep 14 '23 edited Sep 14 '23
That's an amazing announcement, Mark!It makes me very happy and I wish you the best of luck! Looking foreward!
As a sidenote: Considering that 10 years have gone by I wonder how many people are still using AVRs at all. The availability and the price drop for ARMs and ESPs makes me wonder if the FastLED userbase has more than 10-20% of people still using Arduinos and ATtinys. I'm just thinking out loud here, I've no data or deeper insight to proof my guess.
3
u/downtownwatts Sep 18 '23
❤️ Mark
just saw the issue on GitHub will be following closely. this timing couldn't be better, working on an ESP32 project right now and just realized how much better FastLED would be than Neopixel.
with regards to doing AVR first, I get that it might be nicer to do the AVR first cuz then it'll definitely work for ARM & ESP, but (I ask very selfishly) would it not potentially make sense to just get ARM/ESP done (in a less efficient yet functional manner), then figure out how to optimize that for AVR? get progress as quick as possible, test IRL, not let the most complex implementation hold you back.
have no clue what this type of development is like, but i've fallen into traps of tryign to solve the hardest problem first and it unnecessarily blocking everything else longer than needed; all the while i lose steam.
thanks again for everything you're doing! don't know enough to help (yet) but i'll be following along and chearing you on!
2
u/johnny5canuck Sep 13 '23
All the best with this effort. We're all rooting for you!
2
u/scubawankenobi Sep 14 '23
This is great news. Very excited about this. All the best with the work ahead. Look forward to testing out.
2
u/lit_amin Sep 14 '23
Thank you so much Mark, for this and everything you do for this community! <3
2
u/Zachrandir Sep 27 '23
Super great news to hear!
Edit: Nevermind should have read the GitHub page first. Will you be able to build in support for RGBY or chips with even more channels? (such as an RGB Warm White Cool White chip)
1
u/SnowConePeople Sep 14 '23
I just started an led project and really appreciate this update. Thank you.
1
u/ZachVorhies Zach Vorhies Sep 30 '23 edited Sep 30 '23
Hey Marks thanks for reviving this. Shawn silverman wants to do something similar. I’m excited to see the enthusiasm.
If you will allow me, I want to give a dissident opinion on this topic. And maybe there is something I’m missing and so what i say doesn’t make any sense.
Why not just convert RGB to RGBW on the fly?
RGB-24 is good enough for games. Why do we need the extra W component at the api level? That seems like a huge code change to modify CRGB since everything touches it.
Consider the APA102 5-bit brightness. There’s was a previous talk about how to support that in CRGB, I believe. But I realized it could be done it at the driver level for HD gamma.
Could RGBW be the same story? I have an algorithm for doing just this. RGB->RGBW. It’s in one of the pull requests. No API changes. Minimal code change.
I’ll try and find the link.
Update: here
https://github.com/FastLED/FastLED/pull/1501/commits/28bfc5cc04d09a9aed431158e83c99dff7199861
Anyway. Just wanted to put in my 2c. Thanks for the consideration.
0
u/techaaron Sep 13 '23
Out of curiosity, why is it much work? The spec seems super easy and surely the code to actually set the voltage is trivial and rather.tiny?