Feature/advanced biamp#187
Open
craigmillard86 wants to merge 57 commits intoCarlosDerSeher:developfrom
Open
Conversation
added 30 commits
January 6, 2026 18:43
…DAC state tracking. Added debug logging.
…mponent to apply stored settings at startup and expose settings structure to http component, Updated html for the UI
…l_settings component architecture. Fully data-driven front-end
…log gain to tas5805m_settings
…equency, analog gain. Added support for readonly parameters
DSP init ordering (main.c) - Fixed dsp_processor_init() being called after dsp_settings_init(), which caused NULL semaphore access NULL semaphore safety (dsp_processor.c) - Added NULL checks before xSemaphoreGive(paramsChangedSemaphoreHandle) mDNS NULL address (main.c:611) - Added NULL check for re->addr before dereferencing in the mDNS result loop Player NULL chunk (player.c:1436) - Added NULL check for chnk after xQueueReceive timeout before accessing chnk->fragment
…s persistence and logging.
Multiple RESYNCING HARD events triggered a player restart During player restart, the DSP worker function was called paramsChangedSemaphoreHandle was NULL (either not yet created or already deleted) Calling xSemaphoreTake(NULL, ...) caused the LoadProhibited crash The fix ensures we check if the semaphore handle exists before trying to take it.
…es on reboot of device.
The EQ schema and settings JSON were only reading from the driver state, which is uninitialized (all 0s) before tas5805m_settings_apply_delayed() runs when music starts. Now falls back to NVS to show persisted values. Fixed locations: - Channel gains in EQ schema (cur_ch_l/cur_ch_r) - Per-band EQ gains in EQ schema (left and right channels) - Channel gains in settings JSON - Per-band EQ gains in settings JSON
… improvements - Add bi-amp crossover module with Butterworth/Linkwitz-Riley filters (12/24/48 dB/oct) - Implement per-output gain, phase invert, subsonic HPF, and 3-band PEQ - Add loudness compensation with bass/treble shelf filters optimized for bi-amp mode - Restructure EQ settings UI with output-channel layout and PEQ subgroups - Add radio button support for binary phase controls - Hide Channel Gain group in Advanced Bi-Amp mode (uses per-output gains instead) - Support NVS persistence for all bi-amp settings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add tas5805m_biamp_preset_export() and tas5805m_biamp_preset_import() functions - Add GET/POST /api/biamp/preset HTTP endpoints for download/upload - Add Export Preset and Import Preset buttons to Advanced Bi-Amp UI - JSON preset includes crossover, gains, phase, PEQ, and loudness settings - Enables distributing speaker-specific settings with 3D speaker models
- Fix division by zero crash in player.c when reconnecting (chkInFrames=0) - Add 300ms debouncing to EQ settings sliders to prevent flooding device - Change frequency sliders to 1 Hz increments (crossover, PEQ) - Change gain sliders to 0.5 dB increments using x2 fixed-point storage - Remove debug biquad logging from tas5805m.c and tas5805m_biamp.c - Update preset export/import to handle new gain format - Increase HTTP server stack size for bi-amp schema generation
- Increase PEQ bands from 3 to 6 per channel (12 total) - Update biquad allocation: bands 6-11 for PEQ, band 12 spare - Reorganize loudness UI to group parameters by zone - Each zone shows volume range, threshold, bass, and treble together - Add renderLoudnessZone() function and CSS for grouped layout
Bug fixes: - Fix loudness not applying (static cache never initialized from NVS) - Fix loudness always on when disabled (now resets bands to passthrough) - Fix phase/crossover not working (missing ADVANCED_BIAMP case in EQ mode switch) - Fix I2C mutex race condition with spinlock for initialization - Fix baffle placement showing as slider instead of dropdown Security hardening: - Fix buffer overflow in find_key_value() with size parameter - Add URL decode hex digit validation - Restrict CORS to localhost and private IP ranges - Add gain overflow validation and Q5.27 range clamping - Add crossover frequency bounds validation (20-20000 Hz) Documentation: - Add comprehensive doxygen-style documentation to tas5805m_biamp.h - Add comprehensive doxygen-style documentation to tas5805m_biamp.c - Add ADVANCED_BIAMP_USER_GUIDE.md with full feature documentation
Mobile UI improvements: - Add responsive navigation that stacks vertically on mobile - Add responsive styles for EQ settings (PEQ, radio buttons, presets) - Enhance shared styles.css with mobile breakpoints - Improve touch targets and prevent iOS zoom on input focus Bug fix: - Add defer attribute to all script tags to prevent "settingsUI is not defined" race condition on fast page loads
The function uses tas5805m_write_biquad_coefficients which is only available when EQ support is enabled. Wrap the implementation in a preprocessor conditional to avoid implicit declaration errors when building without EQ support.
- Remove defer from script tags to ensure scripts load before DOMContentLoaded - Add automatic retry with 500ms delay for transient failures - Add 100ms delay between EQ schema/settings requests to reduce ESP32 memory pressure - Show actual error messages and add Retry button for user recovery - Add check for getRequest function availability on DAC page
- Keep max_open_sockets at 7 (LWIP_MAX_SOCKETS limit) - Add recv/send timeouts (5s) to cleanup idle connections faster - Increase backlog_conn to 10 for pending connection queue - Add Connection: close header to large schema responses (DAC/EQ) to free sockets immediately after 36KB/64KB transfers
- Add missing Connection: close header to EQ settings handler (16KB response) - Increase delay between EQ schema and settings requests from 100ms to 300ms - Allows ESP32 memory recovery after 64KB schema response before 16KB settings
The fault monitoring task was crashing with stack overflow when faults were detected. The tas5805m_decode_faults() function can make up to 12 ESP_LOGW calls with formatted strings, each consuming 200-400 bytes of stack for vsnprintf operations. Combined with I2C operations and task overhead, this exceeded the 2048 byte allocation. Increased stack from 2048 to 4096 bytes to provide adequate headroom.
Contributor
|
@craigmillard86 can you include screeshot here for reference as well. I'm porting some of that into Raspberry Pi kernel driver, looking which options can be of use in Bi-Amp setup. |
Author
No Problem, attached |
craigmillard86
added a commit
to anabolyc/esp32-snapclient
that referenced
this pull request
Jan 25, 2026
# Conflicts: # components/lightsnapcast/player.c
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


PR: Advanced TAS58505 Bi-Amp Crossover with PEQ, Loudness Compensation, and UI Improvements
Summary
This PR introduces a comprehensive advanced bi-amp crossover system with parametric EQ, loudness compensation, and significant improvements to the web UI and HTTP server reliability.
Key Features
Bug Fixes