Repository navigation
fix(examples): restrict AudioFftParity to ESP32 boards with esp_dsp - #2625
Conversation
…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.
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis 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. ChangesAudioFftParity board filter
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…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.
…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]>
Summary
esp32c2workflow on master has been failing every build with:Root cause
examples/AudioFftParity/AudioFftParity.ino:26deliberately enables the ESP-DSP backend it's there to test:fft_backend.h:99-107then#include "esp_dsp.h"unconditionally on anyFL_IS_ESP32board. 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
@filterto restrict to the boards that DO shipesp_dsp.h:Other boards skip cleanly. The example's own docstring already documents
esp32s3as the canonical target — the filter codifies what was already informal.Verification
Out of scope
The same workflow run also surfaces a separate
RX(Remote) link failure on esp32c2: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
Chores