Skip to content

exp(esp32): legacy RMT5 addLeds off fl::Channel, still bridged via ChannelManager (-22 KB Blink) - #4576

Closed
zackees wants to merge 2 commits into
masterfrom
exp/esp32-legacy-split
Closed

zackees wants to merge 2 commits into
masterfrom
exp/esp32-legacy-split

Conversation

@zackees

@zackees zackees commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Draft / experiment, not for merge yet.

Change

ClocklessIdf5 (ESP32 RMT5) is no longer an fl::Channel. It is a plain CPixelLEDController that still bridges through ChannelManager:

  • The constructor registers the RMT5 driver with ChannelManager (BusTraits<Bus::RMT>::registerWithManager(), idempotent).
  • The manager stays the single back-end entry point for legacy and Channel API strips. It owns the begin-frame wait, the end-frame show() and the async drain.
  • showPixels encodes into one owned ChannelData and enqueues it on the RMT5 driver, the same submit step fl::Channel used. The buffer is cleared and refilled each frame, so it allocates nothing after the first frame.

Removed from a legacy sketch's build:

  • the fl::Channel object, including its runtime RGB reorder pipeline;
  • channel events;
  • dynamic driver resolution.

Bloat: ESP32-S3 Blink, same base (2ea73441fe) and toolchain

"Full split" is the earlier revision of this PR, which also dropped ChannelManager. It is shown for comparison only.

master Bridged (this PR) Full split
firmware.bin 424,880 B 402,352 B (−22,528) 394,656 B (−30,224)
Flash (symbols) 374,060 B 354,382 B (−19,678) 347,568 B (−26,492)
RAM 41,339 B 41,294 B 41,301 B

Where the bytes went (symbol flash vs master)

Category Bridged Full split
fl::Channel object −7,963 −7,963
Logging / formatting −3,029 −3,308
Controller ctor / static init −2,198 −3,556
Channel events + callback lists −2,039 −2,039
Pixel iterator type erasure / RGB pipeline −1,181 −1,181
Containers −1,125 −1,204
ChannelManager −620 −4,593
Semaphores / threading −247 −1,381
Colour profile hooks, other −1,276 −1,375
RMT5 engine + frame hook 0 +108
Total −19,678 −26,492

Keeping the bridge costs about 6.8 KB relative to the full split. That is ChannelManager plus the semaphore it uses for its poll signal. The largest cut, the fl::Channel object, holds in both variants.

Hardware validation: ESP32-C6, AutoResearch

Pin discovery found a TX GPIO 0 → RX GPIO 1 loopback.

Command Path exercised Result
bash autoresearch esp32c6 --rmt --legacy --chipset ws2818 --strip-sizes 1,2,3,4,100 Legacy addLeds → this ClocklessIdf5 → ChannelManager → RMT5. FL_ESP32_LEGACY_CLOCKLESS_USE_RMT=1 is injected. PASS: 6 tests; 1, 2, 3, 4 and 100 LEDs, 4/4 checks each
bash autoresearch esp32c6 --rmt --strip-sizes 1,2,3,4,100 Channels API → ChannelManager → RMT5 PASS: 6 tests, all sizes
bash autoresearch esp32c6 --rmt --legacy --chipset ws2814 ... Legacy RGBW FAIL malformed_response ("WS2814 response requires a non-empty patterns list"). Also fails identically on master 2ea73441fe, so it is pre-existing and filed as #4578.

The plain --rmt --legacy run (WS2812) cannot select RMT on the C6: AutoResearch only injects the RMT override for WS2814/WS2818, so the firmware reports LegacyDriverMismatch (PARLIO-bound). That is why WS2818 is the legacy RMT evidence.

Compile checks (ESP32-S3, this revision)

Blink, BlinkParallel, RGBW, RGBWW, Sailboat and ElPanelReactive all compile. RGBWW, Sailboat and ElPanelReactive use the channels API.

One BlinkParallel run failed once and passed on two re-runs. The error output was not captured, so the cause is unknown.

Not yet

  • The host test suite was not run. This header is ESP32-only and does not compile on the stub platform.
  • ESP32-S3 hardware was not tested; only an ESP32-C6 was attached.

Trade-off

Legacy addLeds on RMT5 drops, as RMT4 already does:

  • colour-management profiles;
  • 5-channel RGBWW;
  • channel events;
  • dynamic driver fallback.

All of these stay available through FastLED.add(Channel).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…cy RMT5

The legacy controller stays a plain CPixelLEDController (not an fl::Channel)
but registers the RMT5 driver with ChannelManager, which owns the frame
flush and async drain. Drops the custom frame hook.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees zackees changed the title exp(esp32): split legacy RMT5 addLeds controller off the channels API (-30 KB Blink) exp(esp32): legacy RMT5 addLeds off fl::Channel, still bridged via ChannelManager (-22 KB Blink) Sep 24, 2026
@zackees

zackees commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Tracked by #4582, under meta issue #4580.

@zackees

zackees commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Superseded by #4603, which landed the RMT5 slim bridge on the shared fl::SlimBridgeController (#4581/#4602) and closed #4582.

@zackees zackees closed this Sep 25, 2026
@zackees
zackees deleted the exp/esp32-legacy-split branch September 25, 2026 03:03
@fastled-project-sync fastled-project-sync Bot moved this from In Progress to Done in FastLED Tracker Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant