Skip to content

perf(esp32): reduce legacy RMT4 channel overhead - #4881

Merged
zackees merged 1 commit into
fix/esp32-legacy-rmt-selectionfrom
perf/esp32-legacy-slim-rmt4
Oct 22, 2026
Merged

zackees merged 1 commit into
fix/esp32-legacy-rmt-selectionfrom
perf/esp32-legacy-slim-rmt4

Conversation

@zackees

@zackees zackees commented Oct 21, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #4877. Reduce the restored ESP32 RMT4 footprint specifically for legacy FastLED.addLeds<>() sketches; FastLED.add() keeps its Channel API path.

Reuse SlimBridgeController direct mode, flushing from endShowLeds() after all legacy strips enqueue. Wait for completion so asynchronous RMT polling releases frame ownership, honors latch time and advances queued strips. Select the RMT4 default through a template while honoring FL_SLIM_BRIDGE_DIRECT_SHOW=0 independently of include order. Other backends keep their existing defaults.

Measured result

Matched 96-RGB-LED reporter, Lolin D32, espressif32 6.13.0 / Arduino 2.0.17 / IDF 4.4.7:

Build Flash Physical static RAM
#4877 at b8ae6a3 295,670 B 23,844 B
Slim legacy RMT4 289,426 B 23,636 B
Saving 6,244 B 208 B

bash bloat finds no executable ChannelManager symbols in the default legacy reporter. The new managed override builds at 295,686 B flash / 23,844 B static RAM. Heap allocations for the existing SDK translator and pixel data remain.

Compatibility

  • Keep the same RMT4 implementation, translator, memory allocator, reset timing and timeout handling.
  • Batch strips before the first end hook, retaining parallel transmission where hardware capacity permits.
  • Preserve standalone controller.showLeds(), dither restoration and legacy controller.setEnabled().
  • Direct legacy controllers bypass channel-registry enable/disable, exclusive selection and enumeration. Use FL_SLIM_BRIDGE_DIRECT_SHOW=0 when legacy controllers need those controls.
  • Mixed sketches retain the manager when they use Channel APIs.

Validation

  • RED: two regression cases fail on the previous immediate direct flush: batching sees only one queued strip and completion is never polled.
  • GREEN: targeted sanitizer tests pass after moving the flush; additional coverage checks asynchronous polling, dither restoration and disabled controllers.
  • bash lint passes.
  • Physical ESP32 GPIO4 same-pin byte loopback passes with the optimized legacy API for one and two LEDs across three frames.
  • Clean UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 bash test --cpp --debug --clean: 322/322 unit targets and 95/95 examples pass.
  • Physical Channel API control: one/two LED byte loopback also passes.
  • Physical 35-LED refill smoke: 553 shows, successful post-test RPC ping and no watchdog reset.
  • Read-only review caught an LPC SCT batching incompatibility; batching is now a separate RMT4-only template policy, with an immediate-mode regression test. Final review has no remaining blockers.

The first incremental full run was rejected by the stale-artifact guard; the clean acceptance run above passes.

Physical byte validation is limited to the short legacy RX capacity; this does not establish long-strip waveform, Wi-Fi or flash-cache stress parity.

@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2469e9df-98b8-4ee3-a49d-cc5cea643df2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 21, 2026
@zackees
zackees merged commit 362c07d into fix/esp32-legacy-rmt-selection Oct 22, 2026
3 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run the complete release-equivalent CI matrix on this PR SHA

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant