Add internet radio streaming with runtime API, modernize web UI, remove auto-tune/beep at boot

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>
This commit is contained in:
2026-08-08 21:15:22 +02:00
co-authored by Claude Sonnet 5
parent 8a8523515d
commit 6f7b6dd12c
131 changed files with 20309 additions and 1702 deletions
@@ -130,6 +130,20 @@ public:
[[nodiscard]] std::expected<void, core::StoreError> setMasterVolume(
core::GainDb left, core::GainDb right, bool persist);
/**
* @brief applyRadioFirstMix — route Si4684 to output, mute ESP32 path.
*
* @dname applyRadioFirstMix
* @param persist When true and store is set, write NVS.
* @return Ok on success, or StoreError.
* @pubstate updates profile_.mixer and master; safeloads ADAU1701.
*
* @author Michele Bigi
* @date 2026-08-05
*/
[[nodiscard]] std::expected<void, core::StoreError> applyRadioFirstMix(
bool persist);
/**
* @brief setEqBand — update one PEQ band and apply live.
*
@@ -179,6 +193,21 @@ public:
[[nodiscard]] std::expected<void, core::StoreError> setBassEnhance(
core::EnhanceLevel level, bool persist);
/**
* @brief setBeepEnabled — toggle the ADAU1701 Beep1 tone generator.
*
* @dname setBeepEnabled
* @param enabled true unmutes Beep1, false mutes it.
* @return Ok on success, or DspError.
* @pubstate live-only: not part of AudioProfile, never persisted, does
* not touch profile_.
*
* @author Michele Bigi
* @date 2026-08-07
*/
[[nodiscard]] std::expected<void, core::DspError> setBeepEnabled(
bool enabled);
private:
[[nodiscard]] std::expected<void, core::StoreError> persistProfile() const;
@@ -134,6 +134,25 @@ std::expected<void, core::StoreError> AudioService::setMasterVolume(
return {};
}
std::expected<void, core::StoreError> AudioService::applyRadioFirstMix(
bool persist)
{
const core::GainDb unity = core::GainDb::zero();
profile_.mixer = core::MixerState::radioFirst();
profile_.masterLeft = unity;
profile_.masterRight = unity;
if (auto applied = dsp_.applyMixer(profile_.mixer); !applied) {
return std::unexpected(core::StoreError::IoFailed);
}
if (auto master = dsp_.setMasterVolume(unity, unity); !master) {
return std::unexpected(core::StoreError::IoFailed);
}
if (persist) {
return persistProfile();
}
return {};
}
std::expected<void, core::StoreError> AudioService::setEqBand(
core::EqBandIndex band, core::GainDb gain, core::FrequencyHz center, float q,
bool persist)
@@ -160,4 +179,9 @@ std::expected<void, core::StoreError> AudioService::setBassEnhance(
return applyEffectiveEq(persist);
}
std::expected<void, core::DspError> AudioService::setBeepEnabled(bool enabled)
{
return dsp_.setBeepEnabled(enabled);
}
} // namespace audio