Feature/advanced biamp#187
Conversation
…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
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.
|
@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. |
No Problem, attached |
# Conflicts: # components/lightsnapcast/player.c
|
Ok, so I missed that one and now there are conflicts @craigmillard86 |
|
@CarlosDerSeher have removed all the merge conflicts |
There was a problem hiding this comment.
Pull request overview
This PR adds an “Advanced Bi-Amp” DSP configuration path for TAS5805M (active crossover + per-output PEQ + loudness), plus corresponding preset export/import/reset APIs and substantial web UI + HTTP server robustness improvements (mobile reliability, retries, socket cleanup).
Changes:
- Introduces advanced bi-amp DSP + persistence (NVS), loudness compensation, and preset export/import/reset plumbing.
- Extends EQ web UI to render the new Advanced Bi-Amp schema layout (sections/subgroups/radio) and adds mobile responsiveness + retry/debounce behavior.
- Improves HTTP server reliability (timeouts/backlog, large-response connection close) and tightens query parsing/CORS behavior.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| partitions.csv | Fixes missing partition index for ota_1. |
| docs/ADVANCED_BIAMP_USER_GUIDE.md | Adds end-user documentation for advanced bi-amp crossover/PEQ/loudness/presets. |
| components/ui_http_server/ui_http_server.c | Hardens URL decode + query parsing, modifies CORS handling, adds bi-amp preset/reset endpoints, adjusts HTTP server config/timeouts. |
| components/ui_http_server/html/styles.css | Adds mobile responsiveness improvements for shared styles. |
| components/ui_http_server/html/settings-ui.js | Adds radio controls, conditional visibility, and grouped renderers for bi-amp/loudness UI layouts. |
| components/ui_http_server/html/index.html | Adds responsive navigation styling for mobile. |
| components/ui_http_server/html/eq-settings.html | Adds bi-amp UI rendering, preset buttons, retry logic, and debounced setting updates. |
| components/ui_http_server/html/dac-settings.html | Adds retry logic and better error messaging if scripts aren’t loaded. |
| components/tas5805m_settings/tas5805m_settings.c | Adds advanced bi-amp + loudness settings persistence/apply, schema generation updates, and preset import/export/reset. |
| components/tas5805m_settings/tas5805m_biamp.c | New DSP/biquad coefficient generation and targeted apply helpers for advanced bi-amp. |
| components/tas5805m_settings/include/tas5805m_settings.h | Adds types/NVS keys/APIs for bi-amp, loudness, and presets; introduces new EQ UI mode. |
| components/tas5805m_settings/include/tas5805m_biamp.h | New public bi-amp DSP API and band allocation definitions. |
| components/tas5805m_settings/CMakeLists.txt | Adds tas5805m_biamp.c to the component build. |
| components/lightsnapcast/player.c | Minor formatting change. |
| components/custom_board/tas5805m/tas5805m.c | Adds I2C mutexing, fault task stack increase, loudness-on-volume-change hook, and biquad feedback sign convention adjustment. |
| components/custom_board/CMakeLists.txt | Adds dependency/include path wiring for tas5805m_settings when TAS5805M is enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Also please address Copilot comments where necessary |
…and cleanup fixes - Fix CORS origin validation: replace prefix matching with is_local_origin() that verifies next char is digit/terminator, validates 172.16-31 range - Add httpd_recv_all() helper to handle partial reads in all POST handlers - Add 32KB max body size check (413 Payload Too Large) to all POST handlers - Fix biquad read/write asymmetry: negate a1/a2 on read to match write convention - Remove mutex creation from portENTER_CRITICAL section in tas5805m_init() - Remove unused BW/LR filter type selector from UI (always Linkwitz-Riley) - Fix frontend URLs to use getBackendUrl() for preset export/import/reset/sendBeacon - Fix documentation treble frequency (~5 kHz -> ~4 kHz to match code) - Revert whitespace-only changes in player.c
All now updated. |
|
The commit is missing here. You pushed to a different branch. |
…and cleanup fixes - Fix CORS origin validation: replace prefix matching with is_local_origin() that verifies next char is digit/terminator, validates 172.16-31 range - Add httpd_recv_all() helper to handle partial reads in all POST handlers - Add 32KB max body size check (413 Payload Too Large) to all POST handlers - Fix biquad read/write asymmetry: negate a1/a2 on read to match write convention - Remove mutex creation from portENTER_CRITICAL section in tas5805m_init() - Remove unused BW/LR filter type selector from UI (always Linkwitz-Riley) - Fix frontend URLs to use getBackendUrl() for preset export/import/reset/sendBeacon - Fix documentation treble frequency (~5 kHz -> ~4 kHz to match code) - Revert whitespace-only changes in player.c
Replace Promise.all([schema, settings]) with staged sequential fetches (schema -> 300ms delay -> settings) in both the mode-change and auto-mode gain/preset reload paths, matching the pattern already used in loadSettings(). Prevents socket/memory issues on mobile clients.
Done, pushed to my repo instead of @anabolyc |
|
@CarlosDerSeher anything else needed on this branch? |
|
I don't think so. It had conflicts but other than that I think it is ok |
| static const char *TAG = "TAS5805M"; | ||
|
|
||
| /* Mutex for thread-safe I2C access */ | ||
| static SemaphoreHandle_t tas5805m_i2c_mutex = NULL; |
There was a problem hiding this comment.
I don't think we have this anywhere. Do we really need this?
| httpd_config_t config = HTTPD_DEFAULT_CONFIG(); | ||
| config.server_port = port; | ||
| config.max_open_sockets = 7; | ||
| config.max_open_sockets = 7; // Max allowed by LWIP_MAX_SOCKETS config |
There was a problem hiding this comment.
Shouldn't we use the config value here?


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