Skip to content

Meta: classic-ESP32 I2S parallel-out clockless driver dev — bring-up + unify + validate on IDF 4/5/6 #3516

Open

Description

@zackees

Umbrella tracker for classic-ESP32 I2S parallel-out clockless driver work

This meta rolls up every open sub-issue targeting the classic-ESP32 (WROOM / FL_IS_ESP_32DEV) I2S1 parallel-out clockless LED driver — the one exposed to users as FastLED.addLeds<WS2812, PIN, GRB>(leds, N) with -DFASTLED_ESP32_I2S=1.

The driver was restored to production in #3479 (Stage 5). Since then, work has fanned out across five separate open issues plus one closed one. This meta gives one place to see the whole picture and land the sub-tasks in the right order.

Current state (baseline)

  • Production working on IDF 4.x and IDF 5.x per #3479 WROOM COM11 validation. Real DMA descriptor chain + IRAM ISR + ping-pong buffer refill emit WS2812 timing on I2S1.
  • IDF 6+ compile-enabled via the i2s_periph_compat.h shim landed in #3511 and hardened in #3514. Uses i2s_ll_enable_bus_clock + i2s_ll_reset_register wrapped in PERIPH_RCC_ATOMIC(), verified against espressif/esp-idf@master:components/esp_hal_i2s/esp32/include/hal/i2s_ll.h. Runtime bench validation still pending (tracked in I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515).
  • Modern channel-driver architecture (ChannelEngineI2sEsp32Dev + I2sPeripheralEsp32DevEsp + mock) exists as scaffolding with 66 host tests. The real-hardware path in I2sPeripheralEsp32DevEsp::transmit() is still a Stage-4 synchronous-callback stub.
  • File-scope statics in i2s_esp32dev.cpp.hpp (gCallback, gCntBuffer, dmaBuffers[], gTX_semaphore, gI2S_intr_handle, ...) — 10+ globals allowlisted for the SingletonElisionChecker via a file-level FL_LINT_ALLOW_GLOBAL_FILE marker pending migration.

Sub-issues (in landing order)

Ratchet — validation infrastructure first

  • #3515 — Bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill

    • Phase A: ci/boards.py entry for IDF 6 via pioarduino/platform-espressif32#prep_IDF6; CI workflows for all three IDF versions
    • Phase B: examples/AutoResearch/AutoResearchI2s.h handlers + --i2s flag in ci/autoresearch/args.py
    • Phase C: ISR DMA refill invariant documented + host-side callback-cadence test
    • Phase D: WROOM bench validation on IDF 4.4 + 5.5 + 6.0 with byte-exact loopback + ≥200 FPS burst test

    This lands first — without CI + AutoResearch coverage, none of the below can be safely validated after landing.

Architecture — unify the two coexisting paths

Cleanup — global state elision

Long-tail user bugs — resolve as part of the driver rewrite

Milestone ordering (canonical)

  1. #3515 Phases A + B + C land — CI covers IDF 4.4/5.5/6.0, AutoResearch harness has --i2s, ISR-refill invariant documented + host test in place.
  2. #3515 Phase D — bench validation on all three IDF versions confirms the CURRENT Yves driver works. This is the "confirmed working" gate.
  3. #3512 Phase 2 — move DMA/ISR machinery into I2sPeripheralEsp32DevEsp. Rerun I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 Phase D on all three IDF versions to confirm no regression.
  4. #3512 Phases 4, 5 — rewire ClocklessI2S<> + unity-build re-include. Rerun I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 Phase D.
  5. #3512 Phase 6 — singleton migration. Closes #3489. Rerun I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 Phase D.
  6. #1165 + #1384 fixes during Phase 2 rewrite. Close both when I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 lands.
  7. #3512 Phase 8 — README.

Already landed (for reference)

  • #3509 (closed) — Phase 3 IDF 6+ enable umbrella
  • #3511 — i2s_periph_compat.h shim
  • #3514 — PERIPH_RCC_ATOMIC() correctness fix
  • #3479 — Stage 5 restore of Yves driver (production baseline)

Non-goals for this meta

Out of scope because they're different silicon / different peripheral:

  • #3180 — ESP32-S3 LCD/I80 clockless (LCD_CAM, not I2S1)
  • #3179 — ESP32 SPI wave8 streaming (different driver)
  • #2254 — ESP32-S3 I2S driver starving websockets (different peripheral)

Parallel-IO unified-engine rule (agents/docs/cpp-standards.md — "Parallel-IO Driver: Unified Clockless + SPI Engine") explicitly allows separate drivers per silicon block, not per mode. The above are correctly separate.

Blockers (whole-tracker)

Reference material

Activity

  1. added
    type: feature
    priority: high
    platform: esp32
    area: drivers
    on Jul 1, 2026
  2. zackees commented on Jul 1, 2026

    @zackees
    MemberAuthor

    Session progress — code-only phases landed, hardware-dependent phases deferred

    Landed this session:

    PR Phase Description
    #3518 #3515 A Add IDF 6.0 CI target via pioarduino prep_IDF6; remove FASTLED_ESP32_I2S selector (later partly reverted)
    #3519 #3515 C + fix New agent-doc rule: "Runtime driver selection is Bus::FLEX_IO — legacy chipset templates are not." Also restores FASTLED_ESP32_I2S opt-in that #3518 prematurely removed (Yves clockless isn't reachable via Bus::FLEX_IO, 0 yet).
    #3520 #3512 Phase 5 Re-include i2s_peripheral_esp32dev_esp.cpp.hpp in the unity build. UNITY_BUILD_EXCLUDE was over-conservative — the ADC:CONFLICT was driver/i2s.h in Stage 2, not driver/gpio.h in Stage 4.
    #3521 #3512 Phase 8 New src/platforms/esp/32/drivers/i2s/README.md documenting files, user binding, IDF 4/5/6 compat, ISR DMA refill invariant, known bugs, cross-links.

    Deferred — bench-hardware-dependent:

    Phase Blocker Why not attempted
    #3512 Phase 2 Real WROOM DMA + ISR migration Requires bench validation on WROOM to prove ISR-refill semantics survive the migration from file-scope globals to peripheral instance state. Speculative refactor without validation would violate "no cheating."
    #1165 Piggybacks on Phase 2 Can't fix I2S_DEVICE=1 bug without Phase 2 exposing port as config surface.
    #3512 Phase 4 Piggybacks on Phase 2 ClocklessI2S<> template rewiring depends on peripheral's transmit() actually driving DMA.
    #1384 Piggybacks on Phase 4 Async surface via modern channel API arrives with Phase 4.
    #3512 Phase 6 / #3489 Piggybacks on Phase 2 Global-state → Singleton<T> migration happens naturally once peripheral owns the state.
    #3515 Phase D Real WROOM COM11 bench Byte-exact loopback validation on IDF 4.4 + 5.5 + 6.0 requires hardware.
    #3515 Phase B Blocked on #3512 Phase 4 AutoResearch harness has to reach for Bus::FLEX_IO, 0 per the new agent-doc rule; that slot doesn't route to Yves clockless until Phase 4.

    Net driver state at session end:

    • IDF 4.x/5.x: unchanged production behavior on -DFASTLED_ESP32_I2S=1 addLeds path.
    • IDF 6.x: CI compile target exists and exercises the PERIPH_RCC_ATOMIC() LL-API path in i2s_periph_compat.h.
    • Documentation ratchet: new REQUIRED rule in agents/docs/cpp-standards.md prevents future agents from reaching for ClocklessI2S<> template directly in test harnesses. Driver README exists.
    • Unity build: modern peripheral impl (still Stage-4 stub) now part of the build.

    What the user needs to do next:

    1. Attach a WROOM COM11 with 4+ WS2812B strips to the bench.
    2. Run bash compile esp32dev_idf6 --examples Blink locally to smoke the IDF 6 CI target once (validates the pioarduino prep_IDF6 branch is still resolvable).
    3. When someone picks up I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 Phase 2, land the DMA/ISR migration with a bench run attached. That unblocks Phase 4, then Phase 6, then singleton: migrate i2s_esp32dev driver state — 19 hits, ISR pattern (Tier 2a) #3489 closes.
    4. Phase 7 bench validation from I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 attached to any Phase 2/4 PR.

    The meta is not closable this session — pending phases require bench + refactor that both need real hardware to land safely.

  3. zackees commented on Jul 1, 2026

    @zackees
    MemberAuthor

    New sub-issue — architecture directive

    #3526 — I2S modern driver: wave8/wave3 general clockless (like PARLIO) + SPI unified — do NOT delegate to Yves.

    Captures two user directives from the #3516 driver-work session:

    1. The modern I2S driver must be a general clockless driver in the same shape as PARLIO — using wave8 / wave3 encoding at a fixed pixel clock, NOT delegating to the Yves i2s_esp32dev.cpp.hpp per-chipset bit-pattern driver. Mirrors the pattern PARLIO / LCD_CAM / FlexIO use across every other parallel-IO peripheral.

    2. SPI compatibility on the same engine per the parallel-IO unified-engine rule (agents/docs/cpp-standards.md → "Parallel-IO Driver: Unified Clockless + SPI Engine"). Same peripheral, mode switch at show-time, Capabilities(true, true). The existing drivers/i2s_spi/ folds into the new unified engine.

    Five sub-phases:

    • 2a — wave8 encoder for classic-ESP32 I2S1 (reuse fl::Wave8BitExpansionLut / fl::Wave3BitExpansionLut, no duplication)
    • 2b — I2S1 peripheral: own DMA descriptor ring + own esp_intr_alloc ISR + own register setup — no calls into i2s_esp32dev.cpp.hpp
    • 2c — SPI mode on the same engine, mode switch at show-time
    • 2d — wire into BusTraits<Bus::FLEX_IO, 0> as the unified clockless+SPI engine; retire the separate addI2sSpiIfPossible
    • 2e — delete/deprecate Yves i2s_esp32dev.cpp.hpp + clockless_i2s_esp32.h + drivers/i2s_spi/ once bench validation confirms the new engine handles every chipset both did

    Supersedes my previous Phase 2 attempt this session which was going down the wrong architectural path (delegate-to-Yves). Reverted before commit — new work should follow #3526.

    #3526 depends on #3515 Phase D (bench access) and blocks #3512 Phase 4 (rewire ClocklessI2S<> — the whole ClocklessI2S<> template goes away once the modern engine is the clockless path).

  4. zackees commented on Jul 1, 2026

    @zackees
    MemberAuthor

    Updated #3526 — Phase 2e now specifies deletion is REQUIRED (not deprecation). Yves i2s_esp32dev + clockless_i2s_esp32 + drivers/i2s_spi/ all deleted at Phase 2e. -DFASTLED_ESP32_I2S flag removed; the modern engine on Bus::FLEX_IO, 0 becomes the only I2S path.

  5. zackees commented on Jul 1, 2026

    @zackees
    MemberAuthor

    Updated #3526 Phase 2a with the REQUIRED shared-code constraint: the I2S1 wave encoder MUST reuse fl::wave8Transpose_* kernels and fl::Wave8*ExpansionLut types from src/fl/channels/ — no duplicate transpose implementations, no private LUT builders. Same anti-drift rule the #3524 mirror-cheat post-mortem established. Applies to any future parallel-IO driver joining the roster too — all of them dispatch through the shared kernels.

  6. 1 remaining item

  7. zackees commented on Jul 1, 2026

    @zackees
    MemberAuthor

    Round complete — status updates posted on #1165 and #1384

    Both long-tail bugs get their fix via the Phase 2b-2e rewrite path (as documented in #3526). Fresh status comments posted:

    • #1165 — I2S_DEVICE=1 fix arrives via I2sPeripheralEsp32DevEsp::initialize() (Phase 2b) with per-port GPIO matrix routing as first-class config, validated by #3515 Phase D bench on both port 0 and port 1.
    • #1384 — async surface via IChannelDriver::poll() on the modern channel-manager once Phase 4 rewires ClocklessI2S.

    Neither issue is closable yet — the actual fix hasn't shipped, only the path is documented.

    Round PR list

    Six PRs merged this session, one architectural sub-issue filed, one facade issue filed:

    PR Phase
    #3518 #3515 A — IDF 6 CI target + FASTLED_ESP32_I2S selector removal
    #3519 #3515 C + fix — Bus::FLEX_IO agent-doc rule + restore Yves opt-in
    #3520 #3512 Phase 5 — unity build re-include
    #3521 #3512 Phase 8 — driver README
    #3525 #3515 B v1 — flexIoDeviceInfo RPC
    #3528 #3526 Phase 2a — wave8 encoder for I2S1 (shared code, byte-exact host tests)
    Issue Purpose
    #3524 AutoResearchParlioEncode mirror-cheat post-mortem
    #3526 I2S modern driver architecture: wave8/wave3 + SPI unified + delete Yves

    What definitively blocks meta close

    Every remaining phase has a hardware dependency the current session cannot satisfy:

    • Phase 2b (peripheral DMA/ISR) — writing this without WROOM bench = shipping ISR-critical code without validation. Would violate "no cheating."
    • Phase 2c (SPI mode in same engine) — depends on 2b.
    • Phase 2d (BusTraits<Bus::FLEX_IO, 0> binding) — depends on 2b + 2c.
    • Phase 2e (delete Yves + i2s_spi) — depends on 2d + bench validation that the new engine handles every chipset both old drivers did.
    • #3512 Phase 4 (rewire ClocklessI2S) — depends on 2d.
    • #3489 / Phase 6 (Singleton migration) — the Yves globals are being deleted via Phase 2e, and the modern peripheral is already instance-scoped, so this closes naturally when Phase 2e ships.
    • #3515 Phase D — physical WROOM COM11 required.

    The next honest step is bench access. When that arrives, Phase 2b is the first PR that lands, using the encoder from #3528 as its front end.

  8. zackees commented on Jul 1, 2026

    @zackees
    MemberAuthor

    Session final status (2026-07-01)

    13 PRs merged this session, bench-verified against attached WROOM COM11:

    Infrastructure + prep (7):

    Architectural + guardrails (3):

    Real hardware work (2):

    Genuinely blocked on future sessions

    Phase 2b-transmit (real DMA/ISR wave8 output), Phase 2c-SPI (unified engine SPI transmit path), Phase 2d (slot-0 swap), Phase 2e (Yves + i2s_spi deletion), #3489 (Singleton migration), #1165 (I2S_DEVICE=1 fix), #1384 (async surface), #3515 Phase D (WROOM autoresearch matrix).

    Each is genuinely a design + implement + flash + bench-iterate cycle. Specifically:

    • Phase 2c-SPI is not a code move — the existing ChannelDriverI2sSpi uses a completely different peripheral interface (II2sSpiPeripheral) with a different config type and a different transmit model (lane-interleaved buffer) than the modern engine (byte-concatenated buffer). Unifying them requires designing a new peripheral interface that spans both modes, or delegating from the modern engine to the existing I2sSpiPeripheralEsp singleton via an adapter. That decision + implementation + bench validation is one PR by itself.
    • Phase 2b-transmit requires wave8-format DMA descriptors + ISR install that don't reuse Yves's variable-pulses-per-bit DMA setup. That's fresh register + timing configuration that needs bench iteration.
    • Phase 2d is the slot-0 swap after 2c and 2b both work — simple mechanics, but predicated on both.
    • Phase 2e deletes Yves + I2S_SPI after the swap + Phase D bench validation confirms zero regressions.

    What's ready for the next agent / developer session

    The next session picks up where this one ended: design Phase 2c's peripheral-interface strategy, implement it, flash, iterate. Meta stays open.

  9. zackees commented on Jul 2, 2026

    @zackees
    MemberAuthor

    Program plan filed as #3576 — covers the I2S0 32-lane expansion, UART2, new RX capture backends (I2S-RX oversampling on classic to break the 10-LED capture ceiling; PARLIO-RX on C6/P4), the IDF 4/5/6 compile+bench matrix (overlapping this issue's Phase D scope), and the dual-device (WROOM+C6) WiFi-load robustness sweeps whose unfixable limitations will be reported back here per the plan.

  10. zackees commented on Aug 20, 2026

    @zackees
    MemberAuthor

    Deferred under the active bug-burn-down policy after final child audit.

    Child disposition:

    The meta's advertised IDF 4/5/6 validation is therefore not complete, and the required classic-ESP32 bench is not currently attached. A fresh scan finds no selectable WROOM/CP210x device.

    Restart when #3515 and #3526 have their required hardware/owners, then remove deferred from this meta only after both produce their terminal evidence. The meta remains open as the roll-up record and is excluded from the actionable queue while labeled deferred.

  11. added
    deferred
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: driversdeferredplatform: esp32priority: hightype: feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions