Skip to content

fix(examples): restrict AudioFftParity to ESP32 boards with esp_dsp - #2625

Merged
zackees merged 1 commit into
masterfrom
fix/audiofftparity-esp-dsp-filter-2623
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/audiofftparity-esp-dsp-filter-2623

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

esp32c2 workflow on master has been failing every build with:

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

Root cause

examples/AudioFftParity/AudioFftParity.ino:26 deliberately enables the ESP-DSP backend it's there to test:

#define FL_FFT_USE_ESP_DSP 1

fft_backend.h:99-107 then #include "esp_dsp.h" unconditionally on any FL_IS_ESP32 board. But esp_dsp isn't shipped in every ESP32 toolchain bundle — ESP32-C2 (and likely S2/H2/C5) don't have it. The example had no @filter, so the CI matrix tried it on every ESP32 variant.

Fix

Add an @filter to restrict to the boards that DO ship esp_dsp.h:

// @filter: (board is esp32dev) or (board is esp32s3) or (board is esp32c3)
//      or (board is esp32c6) or (board is esp32p4) or (board is esp32wroom)

Other boards skip cleanly. The example's own docstring already documents esp32s3 as the canonical target — the filter codifies what was already informal.

Verification

$ bash compile esp32c2 --examples AudioFftParity
SKIPPED 1 example(s) due to @filter constraints:
  - AudioFftParity: doesn't match required board=...

$ bash compile esp32s3 --examples AudioFftParity
(in progress — supported boards unchanged by filter content)

Out of scope

The same workflow run also surfaces a separate RX (Remote) link failure on esp32c2:

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

That's its own bug — fl::RxDevice's template instantiation isn't pulling in the GpioIsrRx implementation. Filed-separately territory; not in this PR.

Fixes #2623.

Summary by CodeRabbit

  • Documentation

    • Updated the AudioFftParity example sketch with board compatibility information, specifying supported ESP32 variants and documenting limitations on other ESP32 models.
  • Chores

    • Added build configuration filters to prevent compilation errors on unsupported ESP32 targets.

…2623)

esp32c2 workflow on master has been failing every build with:

  lib/FastLED/fl/audio/fft/fft_backend.h:101:10:
    fatal error: esp_dsp.h: No such file or directory

AudioFftParity.ino sets `#define FL_FFT_USE_ESP_DSP 1` to enable the
ESP-DSP backend it's testing. fft_backend.h then `#include`s esp_dsp.h
unconditionally on any FL_IS_ESP32 board. But esp_dsp isn't shipped in
every ESP32 toolchain bundle — ESP32-C2 (and likely S2/H2/C5) don't
have it, so the build dies. The example had no `@filter`, so it
attempted compilation on every ESP32 variant.

Restrict via the existing `@filter` mechanism to the boards that DO
ship esp_dsp: esp32dev, esp32s3, esp32c3, esp32c6, esp32p4,
esp32wroom. Other boards skip cleanly.

Verified:
  bash compile esp32c2 --examples AudioFftParity
    -> "SKIPPED 1 example(s) due to @filter constraints" (correct)
  bash compile esp32s3 --examples AudioFftParity
    -> in progress; supported boards unchanged by the filter content

The example's own docstring at lines 16-17 documents esp32s3 as the
canonical target, so the filter codifies what was already informal.

Fixes #2623.
@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b139bf1f-d000-4132-99b0-a1743012afcc

📥 Commits

Reviewing files that changed from the base of the PR and between f16e542 and 3c0562d.

📒 Files selected for processing (1)
  • examples/AudioFftParity/AudioFftParity.ino

📝 Walkthrough

Walkthrough

This PR adds PlatformIO board filter directives to the AudioFftParity example sketch. The changes restrict compilation to six specific ESP32 board variants (esp32dev, esp32s3, esp32c3, esp32c6, esp32p4, esp32wroom) that include the esp_dsp.h header, preventing build failures on unsupported ESP32 variants like esp32c2 when the ESP-DSP backend is enabled.

Changes

AudioFftParity board filter

Layer / File(s) Summary
Board filter directive
examples/AudioFftParity/AudioFftParity.ino
Adds seven lines of PlatformIO @filter comments at the file top to restrict compilation to ESP32 boards that provide esp_dsp.h support, excluding esp32c2, esp32s2, esp32h2, and esp32c5 variants.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • FastLED/FastLED#2573: Both PRs modify example sketch header comments to add PlatformIO/CI filter directives restricting which target boards compile the example.
  • FastLED/FastLED#2315: Both PRs touch examples/AudioFftParity/AudioFftParity.ino and adjust compile-time gating to ensure the ESP-DSP-based parity sketch only builds for supported ESP32 targets.

Poem

🐰 A rabbit hops past esp32c2,
"No esp_dsp here!" it cries with glee.
With filters so fine, we've drawn the line,
Only the boards with headers align. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely identifies the main change: restricting AudioFftParity to ESP32 boards with esp_dsp support, directly addressing the CI breakage described in the objectives.
Linked Issues check ✅ Passed The PR fully implements the coding requirements from #2623: adding an @filter directive to restrict AudioFftParity to boards confirmed to ship esp_dsp.h (esp32dev, esp32s3, esp32c3, esp32c6, esp32p4, esp32wroom), preventing compilation failures on unsupported variants like esp32c2.
Out of Scope Changes check ✅ Passed The change is strictly scoped to adding a PlatformIO @filter directive to the example file, directly addressing the linked issue #2623 without introducing unrelated modifications or library behavior changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/audiofftparity-esp-dsp-filter-2623

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit 89cec49 into master May 31, 2026
4 of 5 checks passed
zackees added a commit that referenced this pull request May 31, 2026
…2630) (#2635)

esp32c2 workflow on master fails linking examples/Remote/Remote.ino:

  fl.channels+.cpp: undefined reference to `fl::GpioIsrRx::create(int)'
  collect2: error: ld returned 1 exit status
  FAILED: RX

Root cause: src/fl/channels/rx.cpp.hpp:99 (compiled for any FL_IS_ESP32)
references GpioIsrRx::create(pin) unconditionally. The definition in
src/platforms/esp/32/drivers/gpio_isr_rx/gpio_isr_rx.cpp.hpp was gated
on FASTLED_RMT5 outer + SOC_MCPWM_SUPPORTED inner — so on ESP32-C2
(no RMT peripheral at all, so FASTLED_RMT5 = 0 per feature_flags),
neither the MCPWM path nor the no-op stub was compiled, leaving the
symbol undefined.

Fix: combine both gates into a single `FASTLED_RMT5 && SOC_MCPWM_
SUPPORTED` condition so the no-op stub is the fallback for *either*
missing piece — RMT-less chips and MCPWM-less chips both get a
`create() -> nullptr` definition. The caller already handles a null
return (wraps as DummyRxDevice("GPIO ISR RX creation failed")), so
runtime semantics are unchanged for chips that already worked; new
behavior on C2 is "feature unavailable at runtime" instead of
"build doesn't link".

Side effect: `#include "soc/soc_caps.h"` is now only pulled in when
FASTLED_RMT5 is true (it's only available under the ESP-IDF tree
when RMT5 is in play). Stub path doesn't need it.

Refs FastLED #2623 (sibling esp32c2 failure, fixed in PR #2625).
Refs FastLED #2629 (broader follow-up to eliminate FL_FFT_USE_ESP_DSP).

Fixes FastLED #2630.
zackees added a commit that referenced this pull request Jun 5, 2026
…P_DSP opt-in (Closes #2629) (#2799)

PR #2625 added an @filter to examples/AudioFftParity/AudioFftParity.ino to
keep esp32c2 (and likely esp32s2/h2/c5) green, because fft_backend.h pulled
in esp_dsp.h whenever the user set FL_FFT_USE_ESP_DSP=1 + FL_IS_ESP32 — and
that header isn't shipped by every ESP32 toolchain bundle (the low-end
RISC-V parts don't have it). The @filter fixed the symptom but the
underlying knob was wrong: any user sketch opting in for performance would
hit the same wall.

Replace the user opt-in with auto-detection via FL_HAS_INCLUDE("esp_dsp.h"),
the same pattern already used for esp_cache.h in
src/platforms/esp/32/drivers/lcd_spi/. Toolchains that ship esp_dsp.h get
the hardware backend automatically; toolchains without it fall through to
the kiss_fftr scalar path. No per-example @filter needed.

Changes:
- src/fl/audio/fft/fft_backend.h: gate flips from
  `FL_FFT_USE_ESP_DSP && defined(FL_IS_ESP32)` to
  `defined(FL_IS_ESP32) && FL_HAS_INCLUDE("esp_dsp.h")`. Removed the
  `#ifndef FL_FFT_USE_ESP_DSP / #define ... 0 / #endif` opt-in default.
- examples/AudioFftParity/AudioFftParity.ino: dropped the @filter line
  (added in #2625) and the per-sketch `#define FL_FFT_USE_ESP_DSP 1`. The
  example now compiles on every ESP32 variant — the parity test runs
  against whatever backend the auto-detect picks (ESP-DSP where present,
  empty sketch on the no-esp_dsp ESP32 variants since the existing
  `#if !FL_FFT_ESP_DSP_AVAILABLE` path already handles them).

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees deleted the fix/audiofftparity-esp-dsp-filter-2623 branch August 21, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant