Skip to content

esp32c2: AudioFftParity fails — esp_dsp.h missing on ESP32-C2 toolchain #2623

Closed

Description

@zackees

Symptom

esp32c2 workflow on master fails compiling AudioFftParity:

lib/FastLED/fl/audio/fft/fft_backend.h:101:10:
  fatal error: esp_dsp.h: No such file or directory
  101 | #include "esp_dsp.h"
FAILED: AudioFftParity

Reproducible: gh run view 26697900743 --log-failed (or any recent esp32c2 run).

Root cause

examples/AudioFftParity/AudioFftParity.ino:26 deliberately enables the ESP-DSP backend for this single sketch:

#define FL_FFT_USE_ESP_DSP 1

fft_backend.h:99-107 gates the #include "esp_dsp.h" on FL_FFT_USE_ESP_DSP && defined(FL_IS_ESP32). Both conditions are true on any ESP32 board.

But the ESP-DSP library is not part of every ESP32 platform package. ESP32-C2 (RISC-V, low-end) doesn't ship esp_dsp.h in its PlatformIO toolchain bundle. The example has no @filter constraint, so it tries to compile on every ESP32 board and dies on C2 (and any other ESP32 variant where esp_dsp is unavailable).

The example's own header comment (lines 16-17) lists esp32s3 as the canonical target — suggesting the example was authored for a narrower set than "all ESP32" but never had that constraint encoded.

Fix

Add an @filter to AudioFftParity.ino that restricts to ESP32 boards that ship esp_dsp.h. The conservative initial set: the boards explicitly supported by ESP-DSP upstream — esp32, esp32s3, esp32c3, esp32c6, esp32p4, esp32wroom. Excludes esp32c2, esp32s2, esp32h2, esp32c5 until each is verified.

Existing audio examples already follow this pattern (examples/Audio/Audio.ino, AudioInput, AudioReactive use @filter (platform is teensy) or (platform is esp32)). This PR is the same shape, but narrower because esp_dsp's availability is per-board, not per-platform-family.

Related (not in scope of this issue)

The same workflow run also shows a separate RX (Remote) link failure:

undefined reference to `fl::GpioIsrRx::create(int)'

That's its own bug — RX device class instantiation isn't pulling in the GpioIsrRx implementation for esp32c2. Will file separately if it reappears after this fix lands.

Test plan

  • bash compile esp32c2 --examples AudioFftParity skips the example (filter excludes it).
  • bash compile esp32s3 --examples AudioFftParity still compiles (filter includes esp32s3).
  • CI esp32c2 workflow no longer hits the esp_dsp.h error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions