Repository navigation
Description
Bug
The modern classic-ESP32 I2S engine (ChannelEngineI2sEsp32Dev) — bound at runtime to Bus::FLEX_IO, 0 per #3526 Phase 2d — dispatches through end-to-end but emits zero wire edges during FastLED.show() on real hardware.
Bench evidence
Live-hardware ESP32-WROOM COM11 (IDF 5.5.2, bash autoresearch esp32dev):
RPC: {"method":"runSingleTest","params":[{"driver":"I2S","laneSizes":[10],"pinTx":18,"pinRx":19,"pattern":"ALL_ONES"}]}
Response:
{
"driver": "I2S",
"success": true,
"passed": false,
"patterns": [{
"captureFailed": true,
"capturedBytes": 0,
"mismatchedLeds": 10,
"mismatchedBytes": 30,
"rawEdgesAfterWait": 0
}]
}- Modern engine bound (
driverName: "I2S"viaflexIoDeviceInfoRPC). FastLED.show()returns without crash; device stays alive.- RMT RX capture on GPIO19 sees NO edges from TX GPIO18 across a jumper wire.
- Every register write in
initialize()is bit-identical to Yves's known-workingi2s_init()in the deletedi2s_esp32dev.cpp.hpp.
Root-cause hypothesis (needs scope to confirm)
Wave8's encoded output layout does not match the I2S1 FIFO's sample-word format that Yves's register config expects.
Wave8 output (16-lane, 8 pulses/bit)
wave8Transpose_16_bf1 writes 128 bytes per WS2812 input byte:
byte offset | contents
-----------+------------------------
0 | symbol 0, pulse 0, lanes 0-7 (col_lo)
1 | symbol 0, pulse 0, lanes 8-15 (col_hi)
2 | symbol 0, pulse 1, lanes 0-7
3 | symbol 0, pulse 1, lanes 8-15
...
15 | symbol 0, pulse 7, lanes 8-15
16 | symbol 1, pulse 0, lanes 0-7
...
127 | symbol 7, pulse 7, lanes 8-15
So each pulse is a 16-bit-wide parallel sample: [col_lo | col_hi] = 16 lanes.
Current I2S1 register config
src/platforms/esp/32/drivers/i2s/i2s_peripheral_esp32dev_esp.cpp.hpp:246-292:
i2s->sample_rate_conf.tx_bits_mod = 32;
i2s->fifo_conf.tx_fifo_mod = 3;
i2s->conf2.lcd_en = 1;
i2s->conf.tx_msb_right = 1;
i2s->conf.tx_right_first = 1;With tx_bits_mod = 32, the FIFO emits 4 bytes per output tick — combining [pulse0_lo, pulse0_hi, pulse1_lo, pulse1_hi] into ONE 32-bit sample. That halves the effective wire rate to 4 MHz and mangles pulse ordering.
Bench-tested workaround (also failed)
Setting tx_bits_mod = 16 to match wave8's 16-bit-per-pulse layout also produced zero edges. Currently reverted to = 32 with debug notes — see PR #3567.
Debug plan (needs oscilloscope on the target GPIO)
Candidates ordered by likelihood:
1. tx_bits_mod + tx_fifo_mod inconsistency
The tx_bits_mod = 16 bench attempt kept tx_fifo_mod = 3 (32-bit single-channel). The pair must match. Try:
tx_bits_mod = 16paired withtx_fifo_mod = 1(16-bit single-channel)- Or
tx_bits_mod = 8withtx_fifo_modset for 8-bit single-channel (see ESP32 TRM chapter 16)
2. Byte order — tx_msb_shift / tx_right_first
Yves used tx_msb_right = 1, tx_right_first = 1 for his 32-lane bit-transpose. With wave8's byte-major output, this may reverse the intended lane order or swap col_lo/col_hi per pulse. Bench-test with tx_msb_right = 0 and/or tx_right_first = 0.
3. Register-write order in transmit()
Delta between current impl and Yves's proven i2s_start():
Current:
reset -> BURST -> int_clr -> out_link.addr -> out_link.start -> int_ena -> tx_start
Yves:
reset -> BURST -> out_link.addr -> out_link.start -> int_clr -> int_ena -> tx_start
Yves clears int flags AFTER out_link.start = 1. If setting out_link.start raises int_raw bits (descriptor validation errors?), our pre-clear may miss them. Reorder to match Yves exactly.
4. GPIO matrix signal index
routeLanePin(0, 18) routes I2S1O_DATA_OUT0_IDX + 0 = 166 to GPIO18. Confirm with scope:
- GPIO18 has actual toggling when the FIFO drains
- If not, try
+1,+2— the DATA_OUT signal carrying the LSB may not be_OUT0_IDXin 16-bit mode
5. Clock divider correctness
solveI2sClockDivider(8_000_000) returns N=10, A=1, B=0. Verify on scope: LCD clock shows 8 MHz square wave when transmit active. If missing, clka_en may need to be 1 (currently 0, matching Yves).
6. Missing lcd_ws_idx GPIO routing
conf2.lcd_en = 1 puts the peripheral in LCD-parallel mode. LCD outputs sample clock on lcd_ws_idx. If we don't route WS anywhere, the LCD state machine may refuse to advance. (Long shot — Yves also did not route WS explicitly.)
Acceptance
- Scope confirms which register combination produces edges on the routed GPIO
- Update
I2sPeripheralEsp32DevEsp::initialize()andtransmit()with the working values - Update host tests (
tests/platforms/esp/32/drivers/i2s/channel_engine_i2s_esp32dev.cpp) if wave8 encoder output shape needs to change - Re-run
runSingleTeston WROOM COM11 —captureFailed: false, rawEdgesAfterWait: >0, mismatchedBytes: 0 - Extend to 4-strip parallel + APA102 SPI matrix per I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 Phase D full acceptance
- Close I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 as done
Related
- Meta: Meta: classic-ESP32 I2S parallel-out clockless driver dev — bring-up + unify + validate on IDF 4/5/6 #3516 (classic-ESP32 I2S driver dev umbrella)
- Architecture: I2S modern driver: wave8/wave3 general clockless (like PARLIO) + SPI unified — do NOT delegate to Yves #3526 (wave8/wave3 modern driver, Phases 2a-2e all merged)
- Bench matrix: I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 (Phase D is this bug's acceptance)
- Debug-note commit: PR docs(i2s): document open bench debug on tx_bits_mod (#3526 / #3515) #3567
Reference
- Wave8 encoder:
src/platforms/esp/32/drivers/i2s/wave8_encoder_i2s1.h - Kernel:
fl::wave8Transpose_16_bf1insrc/fl/channels/wave8.h - Peripheral impl:
src/platforms/esp/32/drivers/i2s/i2s_peripheral_esp32dev_esp.cpp.hpp - Yves reference (deleted at Phase 2e, visible in git history before
master@0422e72b0f):src/platforms/esp/32/drivers/i2s/i2s_esp32dev.cpp.hpp:i2s_init,:i2s_start - AutoResearch test:
runSingleTestRPC inexamples/AutoResearch/AutoResearchRemoteRunSingleTest.cpp - ESP32 TRM chapter 16 (I2S peripheral): https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jul 2, 2026
Root cause found and fixed in PR #3570 — full analysis at #3569 (comment). TL;DR: the bench RX pin (GPIO19) is physically disconnected from GPIO18 (proven electrically via esptool GPIO register pokes), so no capture could ever see edges from ANY TX driver; on top of that the RMT RX backend was broken on classic ESP32 (en_partial_rx + use_dma unsupported — the
rmt_receive(368): partial receive not supportederrors in this issue's logs were the capture dying), and the I2S encoder had the lane-mapping (DATA_OUT(n) = sample bit n+8) and 2-pulses-per-sample bugs this issue hypothesized about — both fixed with byte-exact host tests. Reseat the jumper, merge #3570, and re-run the loopback matrix.zackees commentedon Jul 2, 2026
Resolved by #3570 + #3571 — see the full closure analysis on #3569 (comment). The modern I2S engine now passes byte-exact 10-LED loopback on the WROOM bench (4/4 patterns). Key wire-level facts that supersede this issue's hypotheses: I2S1 in tx_bits_mod=32 mono LCD mode emits only the HIGH half-word (DATA_OUT(n) = memory bit 16+n), and the pixel clock must derive from the chipset timing (6.4 MHz for WS2812, not 8 MHz). Closing.
zackees commentedon Jul 2, 2026
Fixed and wire-verified via #3570/#3571.