-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix incomplete support for Audio Source - Network only - 8266 Audio Reactive #5514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+24
−9
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2b32918
Enhance audio reactive logic with improved input validation and new "…
netmindz ac96ee7
Add audioreactive custom_usermod to multiple ESP8266 environments in …
netmindz 2481aab
Clean up redundant preprocessor directive in audio_reactive.cpp
netmindz 012fbdd
Fix network-only dmType handling and debug diagnostics
Copilot 8aa4bee
Refactor AR init debug logging for network-only sentinel
Copilot aaf76cc
Merge branch 'main' into ar-network-only
netmindz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,7 +140,6 @@ static uint8_t binNum = 8; // Used to select the bin for FFT based bea | |
| #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) | ||
| #define UM_AUDIOREACTIVE_USE_INTEGER_FFT // always use integer FFT on ESP32-S2 and ESP32-C3 | ||
| #endif | ||
| #endif | ||
|
|
||
| #if !defined(UM_AUDIOREACTIVE_USE_INTEGER_FFT) | ||
| using FFTsampleType = float; | ||
|
|
@@ -164,6 +163,7 @@ static FFTsampleType* windowFFT = nullptr; | |
| #include "audio_source.h" | ||
| constexpr i2s_port_t I2S_PORT = I2S_NUM_0; // I2S port to use (do not change !) | ||
| constexpr int BLOCK_SIZE = 128; // I2S buffer size (samples) | ||
| #endif // ARDUINO_ARCH_ESP32 | ||
|
|
||
| // globals | ||
| static uint8_t inputLevel = 128; // UI slider value | ||
|
|
@@ -1462,13 +1462,17 @@ class AudioReactive : public Usermod { | |
|
|
||
|
|
||
| #ifdef ARDUINO_ARCH_ESP32 | ||
| if (FFT_Task == nullptr) enabled = false; // FFT task creation failed | ||
| if (audioSource && FFT_Task == nullptr) enabled = false; // FFT task creation failed | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good to me, this is indeed needed otherwise the usermod would self-disable in network only mode 👍 |
||
| if((!audioSource) || (!audioSource->isInitialized())) { // audio source failed to initialize. Still stay "enabled", as there might be input arriving via UDP Sound Sync | ||
| #ifdef WLED_DEBUG | ||
| DEBUG_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); | ||
| #else | ||
| DEBUGSR_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); | ||
| #endif | ||
| if (dmType < 254) { | ||
| #ifdef WLED_DEBUG | ||
| DEBUG_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); | ||
| #else | ||
| DEBUGSR_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings.")); | ||
| #endif | ||
| } else { | ||
| DEBUG_PRINTLN(F("AR: No sound input driver configured - network receive only.")); | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| disableSoundProcessing = true; | ||
| } | ||
| #endif | ||
|
|
@@ -2123,6 +2127,7 @@ class AudioReactive : public Usermod { | |
| uiScript.print(F("addOption(dd,'Generic PDM',5);")); | ||
| #endif | ||
| uiScript.print(F("addOption(dd,'ES8388',6);")); | ||
| uiScript.print(F("addOption(dd,'None - network receive only',254);")); | ||
|
|
||
| uiScript.print(F("dd=addDropdown(ux,'config:AGC');")); | ||
| uiScript.print(F("addOption(dd,'Off',0);")); | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.