Bass Boost1/SPhat1 enhancement blocks
Replaces the 74-parameter ADAU1701 program with the new 224-parameter
SigmaStudio export. The new netlist has no mixer -- MX1 is an
exclusive selector (DC1) passing through exactly one of three stereo
pairs (radio/bluetooth/beep) instead of blending them with independent
gains. core::MixSource/MixerState are gone; core::ActiveSource plus
IDsp::selectSource() replace applyMixer()/setInputVolume() throughout
the driver/service/API stack. AudioProfile.mixer -> activeSource;
the HTTP "mixer" JSON object -> a single "active_source" string.
DC1 turned out to need a raw 32-bit integer (0/1/2), not the 5.23
fixpoint its compiled TYPE_DC1 macro implies -- confirmed live by
writing both encodings and listening for which one actually switched
sources. Documented in Adau1701Driver::selectSource() and
adau1701::paramSourceIndex().
Bass Boost1 and SPhat1 are real ADI algorithm blocks in this revision,
so core::applyEnhancementsToEq() (the old EQ-band-overwrite hack for
bass/stereo enhancement) is deleted; IDsp::setBassBoostLevel()/
setStereoSpreadLevel() scale each block's compiled coefficients toward
identity/unity instead. Confirmed live: Bass Boost audible on real
program content (not a static test tone -- the algorithm is dynamics-
based), Stereo Spread audible but subtle. The EQ "locked" flag from
2026-08-24 (enhancements silently overwriting manually-set bands) no
longer applies to bands 1-5.
A full sweep of all 223 non-DC1 named parameters (writing each back to
its own compiled default) completed with zero failures, confirming the
whole new address space is reachable.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Root cause of FM/DAB "stonata" audio: xtalCtun=31/nominal XTAL_FREQ
defaults were never measured against this board's actual crystal
(Abracon ABM8-19.200MHZ-10-1-U-T, CL=10pF, two external 15pF load
caps). Fixed via CTUN trim by ear (31->0) plus a new live calibration
loop that reads the Si4684's own FM_RSQ FREQOFF field (broadcast
carriers are GPS-locked, so it's a free precision frequency reference)
to trim XTAL_FREQ with no lab equipment. Converged to CTUN=0,
XTAL_FREQ=19199750 Hz, residual -3/-4 ppm cross-checked on two
stations.
New tools/infrastructure (kept, not one-off):
- Si4684Driver::recalibrateXtal() + POST /api/tuner/xtal-calibrate:
live crystal re-trim without an ESP32 reflash.
- FM_RSQ FREQOFF exposed as "freqoff_ppm" in GET /api/tuner/status.
- tools/si4684_xtal_calibration.py: automates the trim loop.
- tools/si4684_antenna_calibration.py: AN851 Appendix A ANTCAP/VARM/VARB
sweep tool (same session, separate calibration).
- CONFIG_ESP32_I2S_TEST_TONE (off by default): isolates Si4684-specific
audio issues from shared-downstream ones by writing a tone directly
over the I2S bus the Si4684 also uses.
- SIGMA_WRITE_REGISTER_BLOCK/sigma_safeload_block now retry on NACK and
verify via read-back instead of firing I2C writes blind.
- FM de-emphasis set to European 50us (was left at the US 75us default).
- DAB_ACF_ENABLE restored to its previous 0x0000 with a citation
explaining why (tested the datasheet default of 0x0003, made things
audibly worse).
See docs/si4684-rf-investigation-report.md's 2026-08-23 entry for the
full elimination chain and docs/TODO.md for follow-up work (persisting
calibration results to EEPROM instead of requiring a firmware edit).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Streaming (main feature this session):
- New WebRadioConfig/WebRadioJson core types, ISecureStore-backed persistence
- New webradio::WebRadioService (thread-safe live config) + GET/POST /api/streaming
- web_radio_stream task now runtime-toggleable (no reboot), no hardcoded URL
- Content-Type diagnostic: warns clearly when a URL is a webpage, not an audio stream
Boot cleanup:
- Removed boot-time auto FM/DAB tune, auto-beep, and the (now-concluded) Si4684
crystal IBIAS/CTUN empirical sweep from main.cpp — tuning/beep are on-demand
via the existing REST API only
Web UI:
- Modernized styling (cards, gradients, toggle switches, light/dark theme)
- New Stream tab wired to /api/streaming
Fixes found via real idf.py build (not just clangd):
- Restored wrongly-removed si4684/Si4684Tuner.hpp include in main.cpp
- Fixed MP3Decode() argument types in web_radio_stream.cpp (unsigned char**/int*)
Quality-gate fixes:
- Host-test stub headers (esp_log.h, freertos/*) so TunerService.cpp's
scanForStation logging/pacing compiles for station_service_test /
integration_service_test instead of running stale binaries
- Added WifiScanner and WebRadioService manual sections; filled in missing
Doxygen docs on BluetoothService, i2s_sdata_probe, test_firmware, Bt1035At
- Ignore clangd's .cache/ index directory
Also includes prior uncommitted work carried in the tree: Wi-Fi/Bluetooth
device scan REST API and UI (WifiScanner, BT scan), SigmaStudio TCP bridge,
and the current ADAU1701 SigmaStudio DSP program export.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Decouple the SigmaStudio RAM download from compiled-in adau1701_program.c:
DRAD v1 blobs in the dsp partition with embedded fallback, POST /api/dsp/program,
and host-tested blob parse/serialize helpers.
Co-authored-by: Cursor <cursoragent@cursor.com>
Align root, Software, and Firmware READMEs with security, CI, web UI, blob policy, and six-band EQ details.
Co-authored-by: Cursor <cursoragent@cursor.com>
Safeload mixer/EQ/master on the ADAU1701, persist AudioProfile in NVS,
expose /api/audio routes and web UI controls, with host tests and manual sync.
Co-authored-by: Cursor <cursoragent@cursor.com>