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
fix(rmt5): report DRAINING once every strip is on the wire so show() returns async (#2994) - #5350
ChannelEngineRMT::poll() returned BUSY for the entire RMT transmission. ChannelManager::onEndFrame() ends every FastLED.show() with waitForReadyOrDraining(), so show() blocked for the full wire time plus the reset latch on every frame. In 3.10.3, led_strip_refresh_async returned immediately. This affects the legacy addLeds<WS2812B, PIN> path on every RMT5 target, including the reporter's ESP32-S3. The PARLIO, I2S-SPI, LCD, UART and RMT4 drivers already report DRAINING.
Fix
poll() now returns:
BUSY while strips are still waiting for a hardware channel (mPendingChannels non-empty)
DRAINING once every strip has been submitted and the hardware is still sending
READY when idle
The state mapping lives in a small transmissionState() helper.
This is safe because strip bytes are copied into the driver's pool buffer (writeWithPadding) before transmit, and ChannelData in-use flags still clear only at READY. Every path that reuses a buffer or the hardware still waits for READY: ChannelManager::onBeginFrame, SlimBridgeController::showPixels, Channel::waitForInUseBuffer, the driver's own show(), and the destructor.
Behaviour note:FastLED.show() on RMT5 now returns while the frame is still on the wire, as in 3.10.3 and with the other drivers. Code that cuts LED power or sleeps the chip immediately after show() must wait for the frame to finish.
Evidence
Host (RED → GREEN):tests/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp now expects DRAINING after a single-strip show(), and in the channel-limit case after the queued strip starts; it still expects BUSY while a strip is pending. Master fails 3 cases; the fix passes 15/15 under --debug (ASAN/UBSAN).
Hardware: ESP32-C6 with AutoResearch timingDriftTest replaying the reporter's sketch (35 LEDs, 5 ms show cadence). The build used --legacy --rmt, because the C6's legacy default is PARLIO and the S3 uses RMT5.
show() mean
sequence time (theory 2495 ms)
master
1687 µs (1386 µs inside waitForReadyOrDraining)
2500–2507 ms
this PR
369 µs
2495 ms on every sequence
The legacy-RMT RX loopback test (bash autoresearch esp32c6 --legacy --rmt, 100 LEDs, MSB_LSB_A) passes 4/4 with the fix, so the pixel data stays correct.
Not verified on an ESP32-S3: none is attached to the bench. The C6 run exercises the same RMT5 driver and SlimBridgeController path the S3 uses.
Out of scope: the C6's default PARLIO legacy path has its own ~2.3 ms per-frame cost, with time spent in both onBeginFrame and the driver's show(). That is tracked separately.
Summary by CodeRabbit
Bug Fixes
RMT5 polling now distinguishes between queued work (BUSY), transmissions still finishing (DRAINING), and completed activity (READY). This provides clearer status while LED strips are submitted to hardware channels and their transmissions complete.
Updated usage guidance to continue polling until the driver reports READY, including when polling reports DRAINING.
…returns async (#2994)
ChannelEngineRMT::poll() reported BUSY for the whole transmission, so
ChannelManager::onEndFrame()'s waitForReadyOrDraining() blocked every
FastLED.show() for the full wire time plus the reset latch. On the legacy
addLeds<WS2812B> path (ESP32-S3 and other RMT5 targets) that made a 35-LED
show() take ~1.7 ms instead of returning asynchronously as 3.10.3 did, and
the reporter's 5 ms-cadence sketch drifted every sequence.
Strip bytes are copied into the driver's pool buffer before transmit, and
ChannelData in-use flags still clear only at READY, so callers that reuse
buffers or hardware keep waiting for READY. BUSY now means a strip is still
waiting for a hardware channel; DRAINING means all strips are submitted.
Measured on ESP32-C6 forced onto the RMT5 legacy path (AutoResearch
timingDriftTest, 35 LEDs):
master: show() 1687 us mean, sequences 2500-2507 ms (+5..+12)
fix: show() 369 us mean, sequences 2495 ms (+0, matches 3.10.3)
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
Parsing warnings: 1
Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
No actionable comments were generated in the recent review.
Walkthrough
RMT5 polling now distinguishes pending strips from active transmissions. It reports BUSY while strips remain pending, DRAINING when transmissions remain active but no strips are pending, and READY when no transmission is active. The example and tests reflect this state progression.
Changes: RMT5 poll states
Layer / File(s)
Summary
Track pending work and select poll state src/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp.hpp
poll() tracks pending work separately from active transmissions. It reports BUSY when work is pending, DRAINING when transmissions remain active with no pending work, and READY when nothing is active.
Update polling example and state tests src/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.h, tests/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp, tests/data/esp32s3_bloat_baseline.txt
The example polls until READY. Tests expect DRAINING after strips are submitted and no work remains pending. The ESP32-S3 bloat baseline increases by 4 B; its budget ceilings remain unchanged.
FastLED/FastLED#5014: Shares the READY/DRAINING wait behavior and changes PARLIO sorting at call sites that use these waits.
Merge Risk: Minimal · up to 0eed8
RMT5 polling now reports a DRAINING state so show() can return while the frame is still on the wire. Callers that cut LED power right after show() must now poll until READY. No concrete merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: RMT5 now reports DRAINING once every strip is on the wire, so FastLED.show() returns asynchronously. The raw summary confirms poll() now returns DRAINING when transmis…
Linked Issues check
Issue #2994 reports that FastLED master blocks in show() for the full wire time and reset latch on ESP32-S3. This makes the sequence time 2563-2752 ms, against 2495 ms on 3.10.3. The whole-PR diff aga…
Out of Scope Changes check
The whole-PR diff touches the RMT5 driver source (poll() and the new transmissionState() helper, with the associated comment), the RMT5 driver header usage comment (poll until READY), the RMT5 host te…
Full details: Title check
Explanation
The title names the main change: RMT5 now reports DRAINING once every strip is on the wire, so FastLED.show() returns asynchronously. The raw summary confirms poll() now returns DRAINING when transmissions remain active but none are pending, and the PR objectives state the same goal. The title's issue reference (#2994) matches the linked issue, and the title's wording is specific and not vague.
Full details: Linked Issues check
Explanation
Issue #2994 reports that FastLED master blocks in show() for the full wire time and reset latch on ESP32-S3. This makes the sequence time 2563-2752 ms, against 2495 ms on 3.10.3. The whole-PR diff against the merge base changes ChannelEngineRMTImpl::poll() in channel_driver_rmt.cpp.hpp. The new transmissionState() helper returns BUSY only when mPendingChannels is non-empty, DRAINING when all strips are submitted but still transmitting, and READY when idle. ChannelManager::onEndFrame() returns on DRAINING, so show() no longer waits for the wire time. The tests in tests/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp expect DRAINING after a single-strip show() and after a queued strip starts, and BUSY while a strip is pending. The author reports a mean show() time of 369 us (previously 1687 us) and a 2495 ms sequence time on ESP32-C6 with forced RMT5. The C6 run uses the same RMT5 driver path as the S3, but the S3 was not tested. The changes since the previous review are the poll() diff as shown and the bloat baseline update; the poll() diff is consistent with the PR description. I did not directly re-inspect the READY-waiting callers in this review. The prior review also did not inspect them, so the claim that they still wait for READY rests on the PR description. This verdict is PASS, with the S3 verification gap noted.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff touches the RMT5 driver source (poll() and the new transmissionState() helper, with the associated comment), the RMT5 driver header usage comment (poll until READY), the RMT5 host test file, and the ESP32-S3 bloat baseline. The baseline change records the 4 B increase from the new state mapping, so it supports the code change. The PR description places the C6 default PARLIO per-frame cost outside this change, and the inspected diff contains no PARLIO changes. No unrelated changes were found.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
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.
Reviewing files that changed from the base of the PR and between 3c04f6b and 0eed8cc.
Files selected for processing: 1
tests/data/esp32s3_bloat_baseline.txt
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.
github-actionsBot
added
sanitized
Title, body and conversation screened; review text requires separate screening.
and removed
sanitized
Title, body and conversation screened; review text requires separate screening.
labels
Nov 21, 2026
Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).
github-actionsBot
added
sanitized
Title, body and conversation screened; review text requires separate screening.
and removed
sanitized
Title, body and conversation screened; review text requires separate screening.
labels
Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2994
Root cause
ChannelEngineRMT::poll()returnedBUSYfor the entire RMT transmission.ChannelManager::onEndFrame()ends everyFastLED.show()withwaitForReadyOrDraining(), soshow()blocked for the full wire time plus the reset latch on every frame. In 3.10.3,led_strip_refresh_asyncreturned immediately. This affects the legacyaddLeds<WS2812B, PIN>path on every RMT5 target, including the reporter's ESP32-S3. The PARLIO, I2S-SPI, LCD, UART and RMT4 drivers already reportDRAINING.Fix
poll()now returns:BUSYwhile strips are still waiting for a hardware channel (mPendingChannelsnon-empty)DRAININGonce every strip has been submitted and the hardware is still sendingREADYwhen idleThe state mapping lives in a small
transmissionState()helper.This is safe because strip bytes are copied into the driver's pool buffer (
writeWithPadding) before transmit, andChannelDatain-use flags still clear only atREADY. Every path that reuses a buffer or the hardware still waits forREADY:ChannelManager::onBeginFrame,SlimBridgeController::showPixels,Channel::waitForInUseBuffer, the driver's ownshow(), and the destructor.Behaviour note:
FastLED.show()on RMT5 now returns while the frame is still on the wire, as in 3.10.3 and with the other drivers. Code that cuts LED power or sleeps the chip immediately aftershow()must wait for the frame to finish.Evidence
Host (RED → GREEN):
tests/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cppnow expectsDRAININGafter a single-stripshow(), and in the channel-limit case after the queued strip starts; it still expectsBUSYwhile a strip is pending. Master fails 3 cases; the fix passes 15/15 under--debug(ASAN/UBSAN).Hardware: ESP32-C6 with AutoResearch
timingDriftTestreplaying the reporter's sketch (35 LEDs, 5 ms show cadence). The build used--legacy --rmt, because the C6's legacy default is PARLIO and the S3 uses RMT5.show()meanwaitForReadyOrDraining)The legacy-RMT RX loopback test (
bash autoresearch esp32c6 --legacy --rmt, 100 LEDs,MSB_LSB_A) passes 4/4 with the fix, so the pixel data stays correct.Not verified on an ESP32-S3: none is attached to the bench. The C6 run exercises the same RMT5 driver and
SlimBridgeControllerpath the S3 uses.Out of scope: the C6's default PARLIO legacy path has its own ~2.3 ms per-frame cost, with time spent in both
onBeginFrameand the driver'sshow(). That is tracked separately.Summary by CodeRabbit
BUSY), transmissions still finishing (DRAINING), and completed activity (READY). This provides clearer status while LED strips are submitted to hardware channels and their transmissions complete.READY, including when polling reportsDRAINING.