Skip to content

Audioreactive bugfix: auto-suspend in all realtime modes, but stay active when "Use main segment only"#5599

Open
softhack007 wants to merge 3 commits into
mainfrom
AR_realtimemodes_update
Open

Audioreactive bugfix: auto-suspend in all realtime modes, but stay active when "Use main segment only"#5599
softhack007 wants to merge 3 commits into
mainfrom
AR_realtimemodes_update

Conversation

@softhack007
Copy link
Copy Markdown
Member

@softhack007 softhack007 commented May 11, 2026

  • fixes a minor problem with newer realtime modes (DDP, TPM2NET and DMX) not causing auto-suspend of sound processing (thanks @blazoncek for the hint).
  • ensure that AR audio stays active when "Use main segment only" (other segments are still controlled locally)
  • small update for better compatibility with V5 builds

NB: the impact on users is minimal, especially on esp32 and esp32-s3 - audioreactive FFT does not use much CPU time on these boards (less than 20%). Any way the fix can be applied to 16.0.0, 17.0.0 and 0.15.5 in the same way.

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility with different ESP-IDF framework versions for audio processing.
    • Enhanced UDP buffer handling when discarding invalid packets and flushing unread input.
    • Simplified realtime-mode gating to reliably suspend/resume local audio FFT processing.
    • More consistent audio processing pause/resume behavior.

Review Change Stack

* Modernize auto-suspend condition - DDP, DMX and TPM2NET were missing (thanks @blazoncek for the hint)
@softhack007 softhack007 requested a review from DedeHai May 11, 2026 15:48
@softhack007

This comment was marked as duplicate.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Walkthrough

Updated audio_reactive.cpp audioreactive usermod to add ESP-IDF version-conditional UDP buffer handling using flush() versus clear() in packet discard and receive-mode loops, and simplified realtime mode processing suspension logic into a single predicate condition.

Changes

Audioreactive UDP Buffer Management and Realtime Mode Gating

Layer / File(s) Summary
Realtime Mode Gating Logic
usermods/audioreactive/audio_reactive.cpp
loop() realtime mode suspension condition simplified from explicit per-REALTIME_MODE_* checks to realtimeMode && !realtimeOverride && !useMainSegmentOnly, with comment noting useMainSegmentOnly exception.
UDP Buffer Version-Specific Handling
usermods/audioreactive/audio_reactive.cpp
receiveAudioData() and loop() receive-mode UDP buffer cleanup now conditional on ESP_IDF_VERSION_MAJOR < 5: calls fftUdp.flush() for older frameworks and fftUdp.clear() for ESP-IDF v5+, preventing receive-mode hickups across framework versions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • wled/WLED#5357: Also modifies ESP32 audioreactive-related code and adjusts ESP-IDF version guards in audio-related headers.

Suggested labels

bug, usermod

Suggested reviewers

  • DedeHai
  • netmindz
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: fixing auto-suspend in realtime modes while keeping it active for 'Use main segment only', which matches the core bugfix described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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


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.

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as resolved.

@softhack007 softhack007 changed the title Audioreactive bugfix: auto-suspend in all realtime modes Audioreactive bugfix: auto-suspend in all realtime modes, but stay active when "Use main segment only" May 11, 2026
@softhack007

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

@coderabbitai coderabbitai Bot added bug usermod usermod related labels May 11, 2026
@softhack007 softhack007 added this to the 16.0.0 release + bugfixes milestone May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug usermod usermod related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant