Confirmed live tonight that the Si4684's automatic front-end tuning (FE_VARM/VARB properties) is measurably suboptimal on this board: a 129-value ANTCAP sweep (0-128, AN851 Appendix A) at four different FM frequencies found antcap=102 beats auto-tune by +6 to +11 dB RSSI and +3 to +11 dB SNR everywhere tested, consistent with the front-end network component mismatch already logged in docs/si4684-rf-investigation-report.md — the board's actual matching network differs from the AN851 reference network those auto-tune constants were derived from, so a fixed empirical override compensates for a gap the chip's own algorithm can't see. Wiring, bottom to top: - Si4684Driver::tuneFm() already took an antCap byte; threaded it through core::ITuner::tuneFm() and si4684::Si4684Tuner::tuneFm() as a new parameter (default 0 = auto, unchanged behaviour for every existing caller). - TunerService::tuneFm() takes an optional override instead: omitted, it falls back to a new defaultFmAntCap_ member so every ordinary FM tune (seek, scan, station recall, live UI) benefits automatically once calibrated, not just calls that pass antcap explicitly. - POST /api/tuner/tune gained an optional "antcap" field for sweeping live without touching the saved calibration. - POST /api/tuner/calibrate-antenna commits a sweep result: writes it to the 24AA025E48 EEPROM's user-writable region (word address 0x00, separate from the factory-locked EUI-48 at 0xFA-0xFF) via a new Eeprom24aa::writeFmAntCap()/readFmAntCap() pair, and immediately updates the live TunerService default — no reboot needed to take effect, though HardwareBootstrap::boot() also loads it at every boot so it survives power cycles. Same net::AntennaCalibration function-pointer bridge pattern as PhoneStreamSink/BleProvisioning, so components/net stays free of eeprom24aa headers. Verified end to end on hardware: swept and found 102, saved it via the new endpoint, confirmed the live default changed immediately, then power-cycled and confirmed the boot log reports "FM ANTCAP calibration loaded: 102" and a subsequent default tune reflects it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178rASQ6ZETPMUamvpoR2KR
19 lines
654 B
CMake
19 lines
654 B
CMake
idf_component_register(
|
|
SRCS
|
|
"main.cpp"
|
|
"hardware_bootstrap.cpp"
|
|
"web_radio_stream.cpp"
|
|
"esp32_i2s_sink.cpp"
|
|
"phone_stream.cpp"
|
|
"antenna_calibration.cpp"
|
|
"$<$<BOOL:${CONFIG_TEST_FIRMWARE}>:test_firmware.cpp>"
|
|
"$<$<BOOL:${CONFIG_I2S_SDATA_PROBE}>:i2s_sdata_probe.cpp>"
|
|
INCLUDE_DIRS "."
|
|
REQUIRES core net secure_store adau1701 si4684 tuner audio bt1035 bluetooth station integration ota eeprom24aa webradio driver
|
|
PRIV_REQUIRES esp_timer esp_http_client
|
|
)
|
|
|
|
if(CONFIG_TEST_FIRMWARE)
|
|
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
endif()
|