You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I2SClockBasedLedDriver (third party / Yves) causes compile warnings and linker errors #2247
This is a 16 way spi driver using the LCD_CAM (esp32s3) and I2S peripherals (esp32dev). This driver hasn't been migrated yet but now's a good time to start on this.
I am not a real specialist in driver code. I work together with @hpwit to leave his code as untouched as possible, but add better management around it.
So I think best is to work 'async' on this. Also because I don't have the time to really dive in.
So could you do one thing on the third party Yves driver: guard all its files (.h/.cpp) with #ifdef . So if you use FastLED but not using third party / Yves driver there are no warnings or (in yesterdays master) link errors.
My migration willl have async processing with ISR buffer refills. Hpwit didn't put that in as far as I know.
You are more than welcome to take our driver and wrap it in standalone form without attribution. But attribution is appreciated.
Hello could you please explain what you have in mind exactly? The buffer refill is currently done In ISR.
More than happy to integrate your idea in the buffer.
did not know the ISR was doing buffer re-fill. The big thing is that channel driver for fastled4 has a interface and the I2SClock driver does not fullfill it so it can't cooperate with the rest of the system. FastLED's system is a little bit more complex because it inserts padding on the fly and handles groups of identical chipsets.
The channel driver has to cooperatively allow pending main thread tasks (wifi coroutines, audio processing) to run until the last group has finished or entered into a draining state, in which case the FastLED.show() completely yeilds back to the main thread to compute the next frame or handle other tasks.
If I were to just have the driver wrapped then it would be a blocking call.
did not know the ISR was doing buffer re-fill. The big thing is that channel driver for fastled4 has a interface and the I2SClock driver does not fullfill it so it can't cooperate with the rest of the system. FastLED's system is a little bit more complex because it inserts padding on the fly and handles groups of identical chipsets.
The channel driver has to cooperatively allow pending main thread tasks (wifi coroutines, audio processing) to run until the last group has finished or entered into a draining state, in which case the FastLED.show() completely yeilds back to the main thread to compute the next frame or handle other tasks.
If I were to just have the driver wrapped then it would be a blocking call.
Hello
By adding padding you mean being able to handle several types of led at the same time or something else ?
When you execute a show in the I2s driver it is in blocking function unless you ask it to give you back the control using the NO_WAIT option. I am using a semaphore for that. It's explained in the documentation.
If you can give me a specific example of what you wanna do.
Regards
@zackees , can I convince you to include this repo and branch and pull request any changes you would like to add on this repo, so we have one consistent codebase instead of 2?
I promise you this is good code, as I set up linting as you learned me and will add unit tests as well the coming day, so you should be familiar with it ;-)
Can I convince you to include this repo and branch and submit pull requests for any changes you would like to add, so we maintain one consistent codebase instead of two?
TL;DR: I'm happy to backport, yes also I think the I2S repo's need to re-write their driver using my "autoresearch" agent. See below.
First, I want to acknowledge that @hpwit is a stronger driver developer than I am. That is clear from the quality and depth of his driver work, and I have a lot of respect for what he built.
What I Built
Since around November, I’ve been building an automated research and validation system for driver development. This is a framework that allows drivers to be developed, tested, and validated in an automated way using real hardware, unit tests, and a JSON-RPC control layer between a host machine and the device.
It's easier to show the innovation if we just dive into code immediately:
#!/usr/bin/env bash
PROMPT="Use the auto research framework to implement I2S driver for esp32devon the attached device. Don't stop until it works."# solder pin 1 to pin 2 on esp32dev, then attach it to the computer through the USB port.
git clone https://github.com/fastled/fastled
cd fastled
claude --dangerously-skip-permissions -m "$PROMPT"# now get a cup of coffee and come back in an hour
Autoresearch is a borrowed term from Andrej Karpathy's AI centered research but the change here in FastLED is that we aren't training models, we are doing driver/feature development that requires a physical chip to validate. Auto research has a way to edit and evaluation function to score the output, FastLED uses an RX device to evaluate how close the LED signal matches expected timings.
The key architectural change that made this work was splitting drivers into two layers:
Platform-neutral Channel Driver
Waveform generation
Buffering
Transposition
Scheduling
Platform-specific Peripheral Layer
ESP implementation
Mock peripheral used for unit tests
This separation turned out to be extremely important. It moved most of the complex logic into a platform-neutral layer that can be unit tested and reasoned about automatically, while keeping the ESP-specific code very small and isolated.
Once I made that split, the automated system became dramatically more effective at debugging and optimizing drivers, because the really complex logic was now testable in isolation and the hardware-specific layer was small enough to reason about at the datasheet level.
This refactor alone exposed a large number of bugs in the PARLIO driver and made optimization much easier.
For example:
The driver can automatically switch between Wave3 and Wave8 encoding depending on chipset timing.
This optimization exists entirely in the platform-neutral layer.
The ESP peripheral layer does not need to know about any of this.
It just transmits the bitstream.
The mock peripheral reports what was transmitted.
Unit tests validate whether the correct encoding path was chosen.
Development Time Impact
The impact on development time has been pretty significant.
Before the automated research system
I2S: ~1–2 years
RMT: ~1–2 months
With the automated research system
PARLIO early prototype: ~2 weeks
PARLIO rewrite: 2 days
UART: 2 days
I2S: 1 day
Clocked I2S: ~4 hours
Possible Paths Forward
I see a few possible paths forward:
Option 1
Automated research maintains the I2S, LCD, and PARLIO drivers inside FastLED and they are machine validated.
Other driver interfaces could wrap these drivers so we reduce long term maintenance and avoid having multiple independent low level implementations to maintain.
Option 2
FastLED makes a special exception and treats some drivers as third party drivers, and development on those continues manually outside the main driver framework.
Option 3
The drivers remain separate, but features and bug fixes are translated and backported between them, potentially with automated tooling helping with the translation work.
My Position
Based on development speed and long term maintenance, I think Option 1 or Option 3 gives the strongest long term outcome, but I am open to discussion because this affects more than just me.
To be clear:
I am not trying to replace or diminish the manual driver work.
I did not port that code.
The manual implementation solved the problem and established the ground truth for what a correct driver needs to do.
What I built is a framework around development, testing, and validation so that future driver work and IDF migrations do not require that level of manual effort again.
The goal is to turn what used to be a multi-year effort into something repeatable, testable, and maintainable.
Going Forward
This auto-research tool that I've developed is the first open source implementation of the concept for embedded. This thread represents the first public disclosure of this framework, and you are both the first to know about it's capabilities, though I have hinted about it in other threads.
If there are features that have been on the wishlist but were too time consuming to implement manually, this system is very good at tackling exactly those kinds of problems.
So the real question I am trying to answer is this:
How do we best align driver development so that everyone benefits from this tooling and we do not duplicate effort going forward?
And zooming out a bit, I think this is also where things are heading in general. The tools for automated research, testing, and code generation are getting better very quickly. Driver development is probably not going to get more manual over time, it is going to get less manual.
So how about this: I'll do a backport when all of this is done
If I understand correctly , above means that FastLED parallel drivers / engines are what is currently exposed in the channels API isn't it ?
So third party / Yves is than legacy what is going to be removed? So you have one driver system as I2S is already supported. Maybe lcd_cam not , will that be added?
But ultimately third party / yves will be redundant ?
So hpwit and I will maintain i2s clockless driver. But as an alternative to the FastLED engines. Maybe some day it will disappear , we will see
#!/usr/bin/env bash
PROMPT="Use the auto research framework to implement I2S driver for esp32devon the attached device. Don't stop until it works."# solder pin 1 to pin 2 on esp32dev, then attach it to the computer through the USB port.
git clone https://github.com/fastled/fastled
cd fastled
claude --dangerously-skip-permissions -m "$PROMPT"
If I understand correctly , above means that FastLED parallel drivers / engines are what is currently exposed in the channels API isn't it ? So third party / Yves is than legacy what is going to be removed? So you have one driver system as I2S is already supported. Maybe lcd_cam not , will that be added?
But ultimately third party / yves will be redundant ?
So hpwit and I will maintain i2s clockless driver. But as an alternative to the FastLED engines. Maybe some day it will disappear , we will see
LCD_CAM and LCD_RGB (the other esp32p4 16-way driver) are both implemented via the auto research tool yes.
If I understand correctly , above means that FastLED parallel drivers / engines are what is currently exposed in the channels API isn't it ? So third party / Yves is than legacy what is going to be removed?
This script will do it, run it in a cloned fastled repo:
#!/usr/bin/env bash
PROMPT="Use the auto research framework to implement esp-script for esp32s3on the attached device. Don't stop until it works in a unit test. Then deploy to theattached esp32dev device and validate that all esp script functions work. Fix all errors.Migrate this repo: https://github.com/hpwit/ESPLiveScriptInto src/third_party/yves/esplivescript and write proper unit tests in the correct location.run the unit tests in debug mode to catch errors using address sanitizer.Use `bash autoresearch --script` command arg to invoke the auto researchesp script test on the live device"
claude --dangerously-skip-permissions -m "$PROMPT"# now get a cup of coffee and come back in an hour
Replace the repo link with your dev branch
Then when it's done copy the code back into your repo. Sending us a PR is optional but appreciated.
Activity
zackees commentedon Apr 4, 2026
This is a 16 way spi driver using the LCD_CAM (esp32s3) and I2S peripherals (esp32dev). This driver hasn't been migrated yet but now's a good time to start on this.
ewowi commentedon Apr 4, 2026
I know as I work with @hpwit on it, see hpwit/I2SClocklessLedDriver#48 and hpwit/I2SClocklessLedDriver#51
In which I work towards a new release. Best thing is wait for the new release as that will be an easy to lib_dep library (esp-idf 5.5 compatible )
Also fully compatible with FastLED Channel API as it will have runtime creation, config and destruction
Actually latest dev commit is what I use in MoonLight as alternative to the FastLED Channels API.
So let's discuss priority and timeline , this dev commit can already be integrated with FastLED, only thing is it is tuned for esp-idf 5.5
The old version which is now in third party / Yves has bugs (not only compile and link but also runtime)
zackees commentedon Apr 5, 2026
My migration willl have async processing with ISR buffer refills. Hpwit didn't put that in as far as I know.
You are more than welcome to take our driver and wrap it in standalone form without attribution. But attribution is appreciated.
ewowi commentedon Apr 5, 2026
I am not a real specialist in driver code. I work together with @hpwit to leave his code as untouched as possible, but add better management around it.
So I think best is to work 'async' on this. Also because I don't have the time to really dive in.
So could you do one thing on the third party Yves driver: guard all its files (.h/.cpp) with #ifdef . So if you use FastLED but not using third party / Yves driver there are no warnings or (in yesterdays master) link errors.
hpwit commentedon Apr 5, 2026
Hello could you please explain what you have in mind exactly? The buffer refill is currently done In ISR.
More than happy to integrate your idea in the buffer.
zackees commentedon Apr 6, 2026
did not know the ISR was doing buffer re-fill. The big thing is that channel driver for fastled4 has a interface and the I2SClock driver does not fullfill it so it can't cooperate with the rest of the system. FastLED's system is a little bit more complex because it inserts padding on the fly and handles groups of identical chipsets.
The channel driver has to cooperatively allow pending main thread tasks (wifi coroutines, audio processing) to run until the last group has finished or entered into a draining state, in which case the FastLED.show() completely yeilds back to the main thread to compute the next frame or handle other tasks.
If I were to just have the driver wrapped then it would be a blocking call.
hpwit commentedon Apr 6, 2026
Hello
By adding padding you mean being able to handle several types of led at the same time or something else ?
When you execute a show in the I2s driver it is in blocking function unless you ask it to give you back the control using the NO_WAIT option. I am using a semaphore for that. It's explained in the documentation.
If you can give me a specific example of what you wanna do.
Regards
ewowi commentedon Apr 6, 2026
Above discussion triggered me to finally finish 2 years of dev, making it ready for merge into main, merge it and publishing a new release: see https://github.com/hpwit/I2SClocklessLedDriver/releases/tag/1.4 🥳
ewowi commentedon Apr 6, 2026
@zackees , can I convince you to include this repo and branch and pull request any changes you would like to add on this repo, so we have one consistent codebase instead of 2?
I promise you this is good code, as I set up linting as you learned me and will add unit tests as well the coming day, so you should be familiar with it ;-)
zackees commentedon Apr 6, 2026
TL;DR: I'm happy to backport, yes also I think the I2S repo's need to re-write their driver using my "autoresearch" agent. See below.
First, I want to acknowledge that @hpwit is a stronger driver developer than I am. That is clear from the quality and depth of his driver work, and I have a lot of respect for what he built.
What I Built
Since around November, I’ve been building an automated research and validation system for driver development. This is a framework that allows drivers to be developed, tested, and validated in an automated way using real hardware, unit tests, and a JSON-RPC control layer between a host machine and the device.
It's easier to show the innovation if we just dive into code immediately:
Autoresearch is a borrowed term from Andrej Karpathy's AI centered research but the change here in FastLED is that we aren't training models, we are doing driver/feature development that requires a physical chip to validate. Auto research has a way to edit and evaluation function to score the output, FastLED uses an RX device to evaluate how close the LED signal matches expected timings.
The key architectural change that made this work was splitting drivers into two layers:
Platform-neutral Channel Driver
Platform-specific Peripheral Layer
This separation turned out to be extremely important. It moved most of the complex logic into a platform-neutral layer that can be unit tested and reasoned about automatically, while keeping the ESP-specific code very small and isolated.
Once I made that split, the automated system became dramatically more effective at debugging and optimizing drivers, because the really complex logic was now testable in isolation and the hardware-specific layer was small enough to reason about at the datasheet level.
This refactor alone exposed a large number of bugs in the PARLIO driver and made optimization much easier.
For example:
Development Time Impact
The impact on development time has been pretty significant.
Before the automated research system
With the automated research system
Possible Paths Forward
I see a few possible paths forward:
Option 1
Automated research maintains the I2S, LCD, and PARLIO drivers inside FastLED and they are machine validated.
Other driver interfaces could wrap these drivers so we reduce long term maintenance and avoid having multiple independent low level implementations to maintain.
Option 2
FastLED makes a special exception and treats some drivers as third party drivers, and development on those continues manually outside the main driver framework.
Option 3
The drivers remain separate, but features and bug fixes are translated and backported between them, potentially with automated tooling helping with the translation work.
My Position
Based on development speed and long term maintenance, I think Option 1 or Option 3 gives the strongest long term outcome, but I am open to discussion because this affects more than just me.
To be clear:
What I built is a framework around development, testing, and validation so that future driver work and IDF migrations do not require that level of manual effort again.
The goal is to turn what used to be a multi-year effort into something repeatable, testable, and maintainable.
Going Forward
This auto-research tool that I've developed is the first open source implementation of the concept for embedded. This thread represents the first public disclosure of this framework, and you are both the first to know about it's capabilities, though I have hinted about it in other threads.
If there are features that have been on the wishlist but were too time consuming to implement manually, this system is very good at tackling exactly those kinds of problems.
So the real question I am trying to answer is this:
And zooming out a bit, I think this is also where things are heading in general. The tools for automated research, testing, and code generation are getting better very quickly. Driver development is probably not going to get more manual over time, it is going to get less manual.
So how about this: I'll do a backport when all of this is done
hpwit commentedon Apr 6, 2026
this comment was accidentally deleted by zackees
ewowi commentedon Apr 6, 2026
If I understand correctly , above means that FastLED parallel drivers / engines are what is currently exposed in the channels API isn't it ?
So third party / Yves is than legacy what is going to be removed? So you have one driver system as I2S is already supported. Maybe lcd_cam not , will that be added?
But ultimately third party / yves will be redundant ?
So hpwit and I will maintain i2s clockless driver. But as an alternative to the FastLED engines. Maybe some day it will disappear , we will see
zackees commentedon Apr 6, 2026
Can you run this for fun?
zackees commentedon Apr 6, 2026
LCD_CAM and LCD_RGB (the other esp32p4 16-way driver) are both implemented via the auto research tool yes.
zackees commentedon Apr 6, 2026
Correct.
zackees commentedon Apr 6, 2026
@hpwit What if the auto research tool was applied to your esp script?
hpwit commentedon Apr 6, 2026
Why not I am currently working a new version of the compiler maybe on this new one.
zackees commentedon Apr 6, 2026
This script will do it, run it in a cloned fastled repo:
Replace the repo link with your dev branch
Then when it's done copy the code back into your repo. Sending us a PR is optional but appreciated.
zackees commentedon Apr 7, 2026
I'm out of AI credits but we did manage to get the lcd-spi working with multi lane support < 300 leds. I'll continue where i left off on friday.
ewowi commentedon Apr 10, 2026
#2203 (comment) addresses the same issue and if implemented also solves this issue
fix(esp32): add noinline to IRAM_ATTR functions in RMT4 header (#2247)
fix(esp32): add noinline to IRAM_ATTR functions in RMT4 header (#2247) (
refactor(rmt4): extract IRMT4Peripheral lifecycle wrapper (#3458) (#3461