Prepare Audio Subsystem for IDF5/Arduino 3.0, Harden S3 Support, add simulated beat. #801
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prepare Audio Subsystem for IDF5/Arduino 3.0, Harden S3 Support
It's my goal to land this before we switch, but to have the code in the
tree. It needs to be exercided on more hardware than I have right now
(it's fine on the analog mic of Mesmerizer) but it deserves widespread
testing.
I'm going to mar this as "pending" WIP, but go ahead and get it on
the group's repo so that those of us that care about such things will
have a centralized place for going so.
Gemini help me wrangle this code to "prove" it's right, so
I'll let it bigger rest of this.)
Summary
Refactoring the audio subsystem to break free from legacy technical debt,
preparing for the inevitable migration to ESP-IDF 5 and Arduino 3.0.
It tackles the brittleness of our audio input handling by properly
adhering to the "Five Modes" of input (M5Stack, Modern I2S, Legacy I2S,
Modern ADC, Legacy ADC) and ensuring that newer hardware (ESP32-S3)
doesn't panic when faced with older configuration patterns.
Key Changes:
iModernization & Future-Proofing:
IDF 5 Readiness*: explicitly guards legacy ADC logic (which
disappears in IDF 5) and prepares the "Modern" paths to be
the primary citizens. Old paths will be deleted later.`
Refactored Initialization*:
Cleans up the InitAudioInput logic to respect hardware
capability (SOC_I2S_SUPPORTS_ADC) rather than just checking board
defines, preventing invalid driver installs on S3. (Like the ones I use...)
Hardware Stability (The "Five Modes"):
SampleAudio (_We should probably make THAT default in globals.h>
to prevent LoadProhibited panics on devices that skip hardware
init. This allows a device to exist in a "Simulated Audio Only"
state without crashing the kernel.
Feature: Runtime SimBeat:
Effects" from "Physical Audio Hardware," empowering developers
to test reactive effects on the couch without a microphone or an audio source.
Context:
We are clearing the path to adopt standard ESP-IDF 5 practices while
maintaining support for our legacy fleet. This PR ensures that i2s_config_t
and adc_pattern usage remains safe as struct definitions evolve in newer
SDKs, moving us away from "hope-based compilation" to robust, capability-checked
configuration.
Description
Contributing requirements
mainas the target branch.