Repository navigation
Description
Problem
The current ESP32 alternate clockless channel drivers do not consistently honor each chipset's configured reset/latch interval (ChipsetTimingConfig::reset_us). That can make consecutive frames invalid for chipsets whose required low interval exceeds the driver's fixed or implicit tail.
This was found while reviewing #1049's claim that every backend enforces its chipset latch time. I searched open FastLED issues and PRs for reset_us RMT4 I2S; no existing tracker covers this gap.
Current source evidence
ESP-IDF 4 RMT backend
ClocklessIdf4<..., WAIT_TIME>accepts the legacy reset-time template argument, but only constructsChannelDatafrommakeTimingConfig<TIMING>();WAIT_TIMEis otherwise unused (src/platforms/esp/32/drivers/rmt/rmt_4/idf4_clockless_rmt_esp32.h).ChannelEngineRMT4Impl::ChannelStateretains only the zero/one bit symbols, nottiming.reset_us(channel_driver_rmt4.h).- Once pixel bytes are exhausted,
fillNextBuffer()writesrmt_item32_t::val = 0, which is an end marker rather than a duration derived from the chipset reset interval (channel_driver_rmt4.h, around the refill loop). - The TX-done ISR sets
transmissionComplete;poll()then clearsChannelData::inUse, releases the channel, and can returnREADYimmediately (channel_driver_rmt4.cpp.hpp).
ESP32-S3 LCD_CAM/I2S backend
ChipsetGroupretainsmTiming, includingreset_us, but Wave8 buffer sizing uses a fixedreset_words = 64with the comment~50us reset at typical clock(src/platforms/esp/32/drivers/i2s/channel_driver_i2s.cpp.hpp).- The default pixel clock is 2.4 MHz, so the encoded low tail is fixed by clock/buffer math rather than by
mTiming.reset_us(channel_driver_i2s.h). - The buffer tail is zero-filled, and
poll()reportsREADYwhen DMA completes. Chipsets in the timing traits currently include reset intervals up to 300 us, so a fixed approximately-50-us tail is not a general implementation of the timing contract.
Impact
Back-to-back FastLED.show() calls can begin before the chipset's required low reset/latch interval has elapsed on these selectable backends. Symptoms can include ignored frames, partial updates, wrong pixels, or a user-observed need for an arbitrary FastLED.delay() between frames. The behavior depends on backend and chipset despite the common channel timing API.
Proposed fix
- Preserve the effective reset interval in each active transmission/channel state.
- For RMT4, emit or otherwise enforce a continuous LOW interval of at least
reset_usafter the final data bit before the channel becomes reusable/READY. - For LCD_CAM/I2S, calculate the zero-tail word count from
reset_usand the actual peripheral clock, including rounding up, instead of using a fixed 64 words. - Define how the legacy
WAIT_TIMEtemplate parameter combines with timing traits (for example, use the larger effective value) so compatibility arguments are not silently ignored.
Acceptance criteria
- RMT4 does not report READY or permit the next frame until the effective chipset reset interval has elapsed LOW.
- ESP32-S3 LCD_CAM/I2S derives its LOW tail from
ChipsetTimingConfig::reset_usand the configured pixel clock. - Focused tests cover at least two reset intervals, including one greater than 50 us, and verify rounding never shortens the requested interval.
- Tests cover the legacy
WAIT_TIMEinteraction or document/remove it explicitly without an API break. - Relevant ESP32 RMT4 and ESP32-S3 I2S configurations compile.
Decisions made while filing
- Treat this as one issue because both failures violate the same channel timing contract and the shared regression coverage should specify identical READY semantics.
- Treat exact timing as a driver responsibility rather than recommending an application-level fixed delay.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity