Repository navigation
Description
The expanded ESP32 support is amazing -- using the I2S bus has completely eliminated any glitching that my projects have had even with wifi/bluetooth integration. I'm having one issue though where if I #define I2S_DEVICE 1, there doesn't seem to be any output to my WS2812B leds. I2S_DEVICE 0 works fine. One of my custom boards has an SGLT5000 running on I2S 0 so I can't change that (since master clock is running on GPIO 0), so that's why I'm looking to use I2S device 1. I posted a similar issue a while back on @bbulkow's FastLED-idf thinking maybe this issue was unique to his fork, but I'm seeing the same behavior on the latest FastLED master.
I'm using the esp-idf v4.0 build environment with arduino-esp32 built as a component. I've never used the Arduino IDE or build environment for any FastLED/esp32 projects. I imagine this issue would be present in both build environments? I can get the Arduino build environment up and running if anyone would like me to try to reproduce this issue there. I've so far been able to reproduce this using esp-idf v3.3, v4.0, and v4.2, as well as when using the FastLED-idf fork so I think it should be relatively simple to reproduce in different environments.
Are there any GPIO pin considerations I may have overlooked? I assumed no because I see this note about routing from the default I2S pin to whichever pin you're using in clockless_i2s_esp32.h:
// -- Set up the pin We have to do two things: configure the
// actual GPIO pin, and route the output from the default
// pin (determined by the I2S device) to the pin we
// want. We compute the default pin using the index of this
// controller in the array. This order is crucial because
// the bits must go into the DMA buffer in the same order.
mPin = gpio_num_t(DATA_PIN);
...
Steps to reproduce:
- Configure machine for esp-idf release/v4.0, run
menuconfigwith default settings, etc. There are no special sdk configurations needed to reproduce and I don't have auto-start arduino enabled. But like I said above, this should likely be reproducible in other environments/configurations. - Compile and flash this simple example project and ensure the rainbow animation runs correctly
- Comment back in
#define I2S_DEVICE 1towards the top of main.cpp - Compile and flash again and note that the rainbow animation no longer displays
Versions:
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
samguyer commentedon Jan 15, 2021
@drewandre I had a brief discussion with the developer who originally wrote the I2S code for FastLED, and he says that I2S device 1 has different properties and cannot support more than 8-way parallelism. He's going to look into it more, though.
drewandre commentedon Jan 26, 2021
@samguyer thanks for the info. I'll stick to i2s port 0 for now. just out of curiosity do you know how specifically the properties differ? I don't see anything about the two ports having unique properties in the espressif i2s docs.
drewandre commentedon Feb 16, 2021
Actually, I do see here in the espressif I2S docs that "PDM and built-in DAC functions are only supported on I2S0 for current ESP32 chip". That's the only difference between I2S 0 and I2S 1 that I can find.
Spencatro commentedon Dec 2, 2021
I believe I found what they meant, in the technical reference manual--page 303, section 12.1, note 1: "... (note that I2S1 does not support 24-bit width)."
Bummer!
StefanRvO commentedon Dec 5, 2021
I guess that mean that it should be possible to get I2S1 working, just with fewer parallel channels.
I currently have a board that uses I2S0 for an audio ADC, so i can't use that either.
I really just need maximum 2 LED channels, so it seems like it should in theory be fine with I2S1, "just" need to adjust the code a bit. I'm not really familiar with the code at all, but i might attempt to give it a try over Christmas and see if i can get it working.
@samguyer if you have any hints on what is needed it would be appreciated, but i guess it would mostly be stuff in i2sInit() to set it to use 16 or 8 bit mode instead of 24, and maybe a bit of mapping the pixels into the buffers.
zackees commentedon Jul 1, 2026
Rolled up under meta #3516 — classic-ESP32 I2S parallel-out driver dev umbrella. Will be fixed as part of #3512 Phase 2's peripheral rewrite: the port-number will move into the peripheral config surface () with explicit per-port pin-matrix routing, fixing the I2S_DEVICE=1 regression on classic ESP32. #3515 Phase B will add an reproducer.
zackees commentedon Jul 1, 2026
Correcting my prior comment which was mangled by shell escaping — restored inline formatting:
Rolled up under meta #3516 — classic-ESP32 I2S parallel-out driver dev umbrella.
Will be fixed as part of #3512 Phase 2's peripheral rewrite: the port number will move into the peripheral config surface (
I2sEsp32DevPeripheralConfig::mI2sPort) with explicit per-port pin-matrix routing, fixing theI2S_DEVICE=1regression on classic ESP32.#3515 Phase B will add an
i2sFrameOnce(..., i2s_port=1)reproducer to catch this at the AutoResearch level.docs(i2s): add classic-ESP32 I2S driver README (#3512 Phase 8) (#3521)
zackees commentedon Jul 1, 2026
Status (2026-07-01) — fix path is the modern driver rewrite
The Yves parallel-out I2S driver where this bug lives (
src/platforms/esp/32/drivers/i2s/i2s_esp32dev.cpp.hpp) is being deleted per #3526 Phase 2e. Any patch to the currenti2s_setup_pin/i2s_initGPIO matrix routing (theI2S1O_DATA_OUT0_IDXpath where port 1 goes silent) will be removed alongside the rest of the Yves file.The fix lands as part of the modern I2S peripheral rewrite (#3526 tracks the architecture; FastLED#3516 is the umbrella meta):
I2sEsp32DevPeripheralConfig::mI2sPort(already exists — the interface is in place).I2sPeripheralEsp32DevEsp::initialize()(Phase 2b) will do per-port GPIO matrix routing correctly, without the file-scopei2s_base_pin_indexglobal that carries port-1 semantics implicitly.Once Phase 2b lands and #3515 Phase D validates both ports on WROOM, this issue closes. Tracking under FastLED#3516 rollup so anyone bench-touching the driver knows to test port 1 explicitly.
docs(i2s): rewrite README for modern engine (#3526 Phase 8 / #3512 Ph…
zackees commentedon Jul 1, 2026
Closed by #3526 Phase 2b step C (PR #3558)
This 2020 bug was rooted in Yves's
i2s_init()hardcoding the I2S1DATA_OUT0_IDXmatrix-routing signal even whenI2S_DEVICE=1was requested — thei2s_base_pin_indexvariable was set correctly for the port choice, but subsequentgpio_matrix_out(pin, i2s_base_pin_index + i, ...)calls used the wrong base index for I2S0 vs I2S1 in some code paths.Fix: the entire Yves driver was replaced at #3526 Phase 2e (2026-07-01) with the modern engine. Port + pin routing is now explicit:
I2sEsp32DevPeripheralConfig::mI2sPort— no compile-timeI2S_DEVICEguessing.II2sPeripheralEsp32Dev::routeLanePin(lane, gpio_pin)(added at PR feat(i2s): Phase 2b step C — GPIO mux routing for I2S1 lanes (#3526) #3558). The real impl picks the correct base signal per port:esp_rom_gpio_connect_out_signal(gpio_pin, base_signal + lane, invert, false)routes correctly for whichever port was configured.esp_rom_gpio_pad_select_gpio) is called beforegpio_set_direction()so pins booting in an alternate function (SD_CMD on GPIO11, etc.) get switched to plain GPIO before matrix routing takes effect — this was a separate silent failure mode in the Yves code that this issue's users may have hit too.Verification:
Modern I2S peripheral: routeLanePin records mock mappingcovers both ports + full 24-lane range.pong, uptimeMs: 2066.The API-level fix: users who previously set
-DI2S_DEVICE=1should migrate to:or use the
Channel::create<>()async surface if they want to specify pins explicitly.feat(i2s): wire wave8 encoding into engine + routeLanePin call (#3526) (
docs(i2s): document open bench debug on tx_bits_mod (#3526 / #3515) (#…
fix(i2s,rmt-rx): 32-bit sample encoding + classic-ESP32 capture fixes (…