Repository navigation
Description
Goal
Confirm the classic-ESP32 I2S parallel-out clockless driver actually drives WS2812 output on real WROOM hardware across all three supported ESP-IDF release lines:
- ESP-IDF v4.4 (arduino-esp32 2.x)
- ESP-IDF v5.5.x (arduino-esp32 3.3.x)
- ESP-IDF v6.0.x (arduino-esp32 4.0.0-alpha1)
Validation mechanism: bash autoresearch --i2s loopback on WROOM COM11 — TX 4+ parallel WS2812B strips → captured on RX pin via rmt_rx_4 (landed in #3467) → decoded → byte-level comparison against sent pattern. Success = every strip's decoded bytes match the sent pattern on all three IDF versions.
The driver mechanism to preserve/prove: streaming ISR DMA refill — the ping-pong pattern where a DMA-EOF interrupt refills the just-emptied buffer while the next one continues DMAing. This is the machinery that makes the driver keep up with 24-strip parallel output; if it regresses, the whole point of I2S parallel mode is gone.
What already exists
Landed via #3511 + #3514 (closed #3509 Phase 3)
src/platforms/esp/32/drivers/i2s/i2s_periph_compat.h— IDF-version-aware peripheral enable/reset. Usesperiph_module_enableon IDF 4/5,i2s_ll_enable_bus_clock+i2s_ll_reset_registerwrapped inPERIPH_RCC_ATOMIC()on IDF 6+. Signatures source-verified againstespressif/esp-idf@master:components/esp_hal_i2s/esp32/include/hal/i2s_ll.h.feature_flags/enabled.h+platforms/esp/clockless.h— no longer exclude IDF 6.
Landed via #3479 (Stage 5 restore, production baseline)
i2s_esp32dev.cpp.hpp:145—interruptHandler()— FL_IRAM-resident, hooked toI2S_OUT_EOF_INTviaesp_intr_alloc(). This IS the ISR DMA refill pattern: on every buffer-EOF interrupt, if!gDoneFilling, calls the registeredgCallback()(→ClocklessI2S::fillBuffer()atclockless_i2s_esp32.h:227) to encode the next 8-pixel row directly into the just-emptied DMA buffer while the other continues driving.- DMA descriptor ring:
qe.stqe_nextlinks N buffers into a circular chain ati2s_esp32dev.cpp.hpp:436-438. - Kick:
i2s->out_link.addr = &dmaBuffers[0]->descriptor; i2s->out_link.start = 1;at line 477.
Missing infrastructure (this issue's scope)
- No
--i2sflag inci/autoresearch/args.py. - No
examples/AutoResearch/AutoResearchI2s.hdevice-side RPC handler for exercising the driver via the harness. - No
ci/boards.pyentry for IDF 6 platform. - No CI workflow for compile-smoking the driver on all three IDF versions.
Scope of this issue
Phase A — Add IDF 6 platform binding + confirm compile on all three IDF versions
A.1 In ci/boards.py, add:
ESP32_IDF_6_PIOARDUINO = (
"https://github.com/pioarduino/platform-espressif32.git#prep_IDF6"
)This is the prep_IDF6 branch (commit 98230ad4aa, 2026-05-25) whose platform.json pins framework-arduinoespressif32 to arduino-esp32/archive/master.zip — the arduino-esp32 master that's built on ESP-IDF v6.0.1+.
A.2 Add ESP32DEV_IDF6 board:
ESP32DEV_IDF6 = Board(
board_name="esp32dev_idf6",
real_board_name="esp32dev",
platform=ESP32_IDF_6_PIOARDUINO,
defines=["FASTLED_ESP32_I2S=1"],
)A.3 Add .github/workflows/build_esp32dev_idf6.yml mirroring build_esp32_i2s_ws2812.yml shape — compile smoke test against SpecialDrivers/ESP/DriverTest and AutoResearch.
A.4 Ensure the existing IDF 4.4 (ESP32DEV_IDF33 / ESP32DEV_IDF44) and IDF 5.x (ESP32DEV_I2S) workflows continue to pass. No regression on the currently-working paths.
Acceptance for Phase A: three green CI jobs — one per IDF version — compiling FastLED with -DFASTLED_ESP32_I2S=1 against the AutoResearch example. If IDF 6 CI catches a symbol mismatch or a missing PERIPH_RCC_ATOMIC() include, that surfaces as a real compile failure and gets fixed in this issue.
Phase B — AutoResearch I2S handler + --i2s CLI flag
B.1 New file examples/AutoResearch/AutoResearchI2s.h following the shape of AutoResearchParlioStream.h (namespace autoresearch { namespace i2s { … } }). Register three RPC handlers on remote:
i2sFrameOnce(led_count, color_rgb, data_pin, num_lanes)— allocatenum_lanes×CRGB[led_count]buffers filled withcolor_rgb, hand toFastLED.addLeds<WS2812, PIN + n, GRB>()for each lane, drive oneFastLED.show(), return{started_us, done_us, cpu_busy_during_tx}.i2sFrameBurst(led_count, color_rgb, n_frames, data_pin, num_lanes)— driven_framesback-to-back frames, report measured FPS. This is the ISR-refill-under-load test — if the ISR misses a refill deadline, the wire goes silent between frames and the RX decoder will see gaps.i2sCaptureSelf(led_count, color_rgb, data_pin, rx_pin, num_lanes, capture_ms)— drive one frame AND capture the wire onrx_pinviaLpcRmtRxChannel/RmtRxChannel4. Returns the decoded byte sequence for host-side byte-for-byte comparison.
B.2 Wire bind(remote) from AutoResearch.ino under #if defined(FL_IS_ESP_32DEV) && FASTLED_ESP32_HAS_I2S.
B.3 In ci/autoresearch/args.py, add --i2s flag mirroring the --parlio treatment. Set the appropriate probe/device selection for classic-ESP32 with I2S enabled.
B.4 In ci/autoresearch/phases.py, ensure the --parallel combo path accepts --i2s alongside other clockless drivers when the driver-matrix mode fires.
Acceptance for Phase B: bash autoresearch --i2s --help works, three handlers registered, harness reaches the "connected" state on WROOM COM11.
Phase C — Preserve ISR DMA refill semantics (no regression)
The classic Yves driver already implements the ISR DMA refill pattern. This phase is a compile-time + runtime invariant check that the compat shim + any future refactor doesn't accidentally strip it.
C.1 Add a code-review checklist item to agents/docs/cpp-standards.md: "I2S ESP32-dev clockless driver — interruptHandler must remain IRAM-resident, must call gCallback() on every buffer-EOF while !gDoneFilling, and must give the completion semaphore only when all buffers have drained (gCntBuffer == 0 in the multi-buffer case)."
C.2 Add a host-side unit test in tests/platforms/esp/32/drivers/i2s/ that exercises the ClocklessI2S::fillBuffer() callback shape via the mock peripheral — proves that per-buffer refill is called in the right cadence and stops when the caller sets gDoneFilling = true. This is a structural test; real ISR-refill is device-only, but the callback cadence CAN be exercised on host.
C.3 Document in the driver's header comment the invariant that no future change may replace the ISR-refill pattern with a "load whole frame, transmit, wait" pattern — the whole reason to use I2S parallel mode is the streaming refill. If a future refactor wants to move the DMA machinery into I2sPeripheralEsp32DevEsp (per #3512 Phase 2), it must preserve the streaming callback semantics.
Acceptance for Phase C: documentation lands, host test lands, no runtime behavior change on the working driver.
Phase D — WROOM bench validation on all three IDF versions
D.1 Bench setup — same as PR #3479's validation:
- WROOM COM11 attached
- 4+ WS2812B strips soldered to GPIO pins per
AutoResearchPlatform.h::defaultTxPin()(classic ESP32: GPIO 18/19) - RX capture pin jumpered per convention
- Build the AutoResearch example against each of the three IDF versions:
- IDF 4.4:
bash compile esp32dev_idf44 --examples AutoResearch --defines FASTLED_ESP32_I2S=1 - IDF 5.5:
bash compile esp32dev --examples AutoResearch --defines FASTLED_ESP32_I2S=1 - IDF 6.0:
bash compile esp32dev_idf6 --examples AutoResearch --defines FASTLED_ESP32_I2S=1
- IDF 4.4:
- Flash each and run
bash autoresearch --i2s.
D.2 Assert on each version:
- Clean boot (no
ADC: CONFLICT!, no panic, no restart loop). RESULT: {"type":"ready", ...}in <2s.i2sFrameOnce(...)returns non-zeroduration_us.i2sFrameBurst(60, 0xFF0000, 100, 18, 4)reports FPS ≥ 200 (proves ISR refill keeps up under 100-frame burst load).i2sCaptureSelf(60, 0xFF0000, 18, 19, 4, 100)returns decoded bytes matching{0x00 0xFF 0x00, 0x00 0xFF 0x00, …}× 60 for lane 0 (GRB order).
D.3 Post results as a comment on this issue with RESULT: lines from each IDF version. No IDF version passes unless its i2sCaptureSelf byte comparison is bit-exact.
Acceptance criteria (full issue close)
- Phase A — Three green CI compile jobs (IDF 4.4, 5.5, 6.0) with
-DFASTLED_ESP32_I2S=1. - Phase B —
AutoResearchI2s.hhandler +--i2sflag land. - Phase C — ISR DMA refill invariant documented + host test.
- Phase D — WROOM COM11 bench pass on all three IDF versions:
-
i2sCaptureSelfbyte-exact match on IDF 4.4 -
i2sCaptureSelfbyte-exact match on IDF 5.5 -
i2sCaptureSelfbyte-exact match on IDF 6.0 -
i2sFrameBurstsustains ≥200 FPS on each version (proves streaming ISR refill)
-
Non-goals
- Not refactoring
I2sPeripheralEsp32DevEspto be the real hardware path — that's I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 Phase 2. This issue validates the WORKING Yves driver on all three IDF versions. - Not moving
i2s_esp32dev.cpp.hppfile-scope globals intoSingleton<T>— that's singleton: migrate i2s_esp32dev driver state — 19 hits, ISR pattern (Tier 2a) #3489. - Not ESP32-S3 LCD_CAM I2S — different peripheral, out of scope.
- Not ESP32-P4/C6/H2/C5 — those use PARLIO as the clockless default.
Reference material
- Preceding work: I2S classic-ESP32: unify Yves + modern paths and add IDF 6+ (LL API) support #3509 (closed, Phase 3 landed), feat(i2s-esp32dev): enable IDF 6+ via i2s_ll_* compat shim (#3509 Phase 3) #3511 (IDF 6 enable), fix(i2s-esp32dev): wrap IDF 6 LL calls in PERIPH_RCC_ATOMIC critical section #3514 (RCC_ATOMIC fix)
- Follow-up unified path: I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 (Phase 2 architectural refactor, out of scope here)
- Singleton migration: singleton: migrate i2s_esp32dev driver state — 19 hits, ISR pattern (Tier 2a) #3489
- Working DMA/ISR reference:
i2s_esp32dev.cpp.hpp:145(ISR handler),:436(DMA ring),:477(kick) - Streaming refill pattern:
clockless_i2s_esp32.h:227(fillBuffercallback body) - RX capture: feat(rmt_rx): backport RmtRxChannel to IDF 4.x (#3465) #3467 (
rmt_rx_4— landed) - AutoResearch shape reference:
examples/AutoResearch/AutoResearchParlioStream.h - pioarduino IDF 6 branch: https://github.com/pioarduino/platform-espressif32/tree/prep_IDF6
- ESP-IDF v6.0 release notes: https://docs.espressif.com/projects/esp-idf/en/v6.0/esp32/migration-guides/release-6.x/
Blockers
- Requires physical WROOM COM11 hardware for Phase D bench validation (no substitute).
bash compile esp32dev_idf6requires that the pioarduinoprep_IDF6branch is still resolvable when this issue is worked — checkgit rev-parse HEADon the branch before starting Phase A.- Windows fbuild spec-file backslash regression may block local
bash compile esp32dev(per I2S esp32dev Stage 2 — real-hardware impl + BusTraits switch + delete Yves code #3474 body); Linux CI is the alternative if hit.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Jul 1, 2026
Rolled up under meta #3516 — classic-ESP32 I2S parallel-out driver dev umbrella. Per meta ordering, this issue lands FIRST (its CI + AutoResearch fence is the validation gate that all downstream refactor work uses to prove no regression).
feat(i2s): remove FASTLED_ESP32_I2S selector, add IDF6 CI target (#3515…
docs+fix: Bus::FLEX_IO runtime-selection guardrail + restore Yves opt…
feat(autoresearch): add flexIoDeviceInfo RPC — Bus::FLEX_IO introspec…
zackees commentedon Jul 1, 2026
Status update after #3526 Phases 2a-2e
Substantial forward progress on the Phases this issue tracks:
Phase A (IDF 6 CI target) —
ci/boards.pyESP32DEV_IDF6entry +.github/workflows/build_esp32dev_idf6.ymlworkflow landed in prior session (referenced in I2S modern driver: wave8/wave3 general clockless (like PARLIO) + SPI unified — do NOT delegate to Yves #3526 initial state). Compiles clean on IDF 4/5/6.Phase B (AutoResearch harness) —
flexIoDeviceInfoRPC handler landed via feat(autoresearch): add flexIoDeviceInfo RPC — Bus::FLEX_IO introspection (#3515 Phase B) #3525 in the prior session;AutoResearchFlexIo.hgives peripheral-agnostic introspection.--i2sflag on the autoresearch args is a Phase B follow-up that hasn't landed yet — the modern engine's runtime binding is already visible via the generic--flex-iopath.Phase C (ISR-refill invariant + host-side callback-cadence test) — real ISR install shipped in feat(i2s): Phase 2b step B — DMA descriptor + esp_intr_alloc ISR (#3526) #3557 (
esp_intr_alloc(ETS_I2S1_INTR_SOURCE, ESP_INTR_FLAG_IRAM, &i2s_dma_isr_trampoline, this, &mIsrHandle)). The refill invariant is documented insrc/platforms/esp/32/drivers/i2s/README.md→ "Streaming ISR DMA refill invariant (REQUIRED)". Current impl is single-descriptor, which means the "streaming refill" cadence isn't exercised yet — that arrives with Phase 2b step D (streaming multi-descriptor DMA ring, tracked here).Phase D (WROOM bench validation matrix) — still blocked on the physical bench harness. The device is confirmed booting and RPC-responsive after every merge (
pong, uptimeMs: 2066), but the byte-exact 4+strip clockless + APA102 SPI loopback viarmt_rx_4requires actual LED strips + jumper harness that only a human can wire up.Remaining Phase 2b step D scope (unblocks Phase D bench):
lldesc_tdescriptor ring (currentlymDescriptoris a single alloc — extend toNUM_DMA_BUFFERSchained viaqe.stqe_next).II2sPeripheralEsp32Dev::registerBufferRefillCallback(interface already added in a prior session).Everything else in this meta is done. The bench blocker is real; recommend closing this issue once Phase D physical validation happens or moving it to a
#test-benchlabel.See closed #3512 for the architectural pivot from "wrap Yves" to "delete Yves + fresh implementation" that shaped #3526's scope.
zackees commentedon Jul 2, 2026
Phase D live bench result (partial — honest failure)
Ran the modern I2S engine end-to-end on ESP32-WROOM COM11 via the AutoResearch harness:
Request:
{"method":"runSingleTest","params":[{"driver":"I2S","laneSizes":[10],"pinTx":18,"pinRx":19,"pattern":"ALL_ONES","iterations":1}],"id":77}Result:
{ "driver": "I2S", "passed": false, "pattern": "ALL_ONES", "success": true, "patterns": [{ "decodeOk": -1, "runNumber": 1, "totalLeds": 10, "captureFailed": true, "capturedBytes": 0, "mismatchedLeds": 10, "mismatchedBytes": 30, "rawEdgesAfterWait": 0 }] }What the bench proves (working)
ChannelEngineI2sEsp32Dev,driverName: "I2S") selected at runtime viaautoResearchSetExclusiveDriverByName.success: true— no firmware crash, no timeout.FastLED.show()— status heartbeats continue (uptimeMs: 35085 → 60090).show()→ peripheraltransmit()→ ISR → completion → back to caller).What the bench exposes (real gap — not previously visible)
captureFailed: true+rawEdgesAfterWait: 0— the RX pin (GPIO19, wired to TX GPIO18) saw no signal edges from the driver.Root cause (from static analysis): the modern engine's clockless path is not yet wired to wave8 encoding.
packScratchBuffer()currently does linear byte concatenation (reverted from an earlier wave8-in-engine attempt that broke mock tests).transmit()in the real peripheral impl DMAs whatever bytes the engine hands it at 8 MHz.What Phase D still needs to close
Wire wave8 encoding into the modern engine's data path. Two viable spots:
packScratchBuffer()runsencodeChannelWave8_i2s1()before handing to peripheral. Requires mock-test updates to check wave8 output instead of raw bytes.transmit()runs wave8 encoding of the incoming byte stream before DMA. Keeps mock as raw-byte capture but requires the peripheral to know chipset timing (not currently inI2sEsp32DevPeripheralConfig).Either fix + re-run this same RPC test on the bench, and
captureFailedshould flip tofalsewithmismatchedBytes: 0.IDF matrix status
success: true, engine reachable, wave8 wiring gap identified.build_esp32dev_idf6.ymlworkflow exists, compiles clean. Bench run pending.This bench evidence supersedes my earlier "fully complete" claim. The engine works end-to-end at the state-machine level but the actual WS2812 waveform emission needs the wave8 wiring closure. Filing that as the next-up follow-up in #3526.
feat(i2s): wire wave8 encoding into engine + routeLanePin call (#3526) (
docs(i2s): document open bench debug on tx_bits_mod (#3526 / #3515) (#…
zackees commentedon Jul 2, 2026
Filed #3568 with the full register-config debug plan derived from bench evidence. That issue is what unblocks this Phase D matrix — it enumerates 6 candidate register/order fixes ranked by likelihood, all scope-verifiable. Once #3568 closes the 'zero wire edges' gap, Phase D bench matrix on IDF 4/5/6 can proceed to close this issue.
fix(i2s,rmt-rx): 32-bit sample encoding + classic-ESP32 capture fixes (…
zackees commentedon Jul 2, 2026
Phase D progress: the modern I2S engine now passes byte-exact 10-LED loopback (4/4 patterns) on ESP32-WROOM COM11 under IDF 5.5.2 — first wire-verified green for this driver. PRs #3570 + #3571; closure analysis on #3569. Bench pins are GPIO33→34 (sketch defaults updated). Remaining for the full Phase D matrix: other IDF versions, multi-lane, and >10-LED captures (classic RMT RX one-shot depth is 256 symbols — longer captures need chunked re-arm or a different RX backend).
zackees commentedon Aug 20, 2026
Deferred under the active bug-burn-down policy after reconciling the issue's original Yves-driver plan with the modern engine that replaced it.
Completed evidence:
lldesc_tchain, removing the old 4,092-byte single-descriptor ceiling.Still unmet:
Restart criteria:
deferredonly when that matrix can be executed.The issue remains open and is excluded from the actionable queue while labeled
deferred.