Files
desklock/firmware/sdkconfig.defaults
T
jpmschweitzerandClaude Fable 5 b462dff082
Test, Build and Push / test-gateway (push) Successful in 10s
Test, Build and Push / release (push) Skipped
Test, Build and Push / build-gateway (push) Skipped
Phase 5: hands-free "Computer" wake word (esp-sr WakeNet + AFE VAD)
Say "Computer" -> chime + listening -> speak -> AFE VAD detects you
stopped -> auto-sends. No taps. Touch still works as a manual override.

- esp-sr 2.4.6 added; wn9_computer_tts model packed into a new "model"
  flash partition (MODEL_IN_FLASH). App moved to 8M, model 4M.
- audio.c: replaced the on-demand capture_task with an AFE pipeline —
  feed_task is the SOLE mic reader (-> afe->feed); detect_task fetches,
  watches wakeup_state for the wake word and vad_state for end of
  speech, and forwards AFE-cleaned audio upstream during an utterance.
  One mic reader ever.
- short rising chime acknowledges the wake audibly.

Fixes from adversarial review before trusting it:
1. utterance framing (blocking WS sends) moved OFF the AFE fetch thread
   onto an app_task event queue (EV_TOUCH/EV_WAKE/EV_SPEECH_END) — a
   1.5s send could stall fetch and drop the first ~1.5s of speech.
2. app_task is now the single serializer of start/end -> no TOCTOU
   double-start (was: two utterance_start on a tap during wake).
3. VAD accounting resets on every streaming (re)start (wake OR tap),
   not just wake -> a tapped utterance can no longer end instantly on
   stale silence.
4. chime/reply set s_playing (+DMA tail hold) and detect_task skips the
   mic while s_playing -> our own audio no longer streams into STT or
   false-triggers the wake at a playback boundary (no AEC yet).
5. NULL-checked AFE create + feed buffer; tasks only start if AFE is up.

Verified on hardware: model loads, AFE inits with the Computer word,
boots and connects clean, no crash/wedge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 10:52:41 +02:00

70 lines
2.4 KiB
Plaintext

# Target: Waveshare ESP32-P4-WIFI6-Touch-LCD-3.4C
CONFIG_IDF_TARGET="esp32p4"
# 32 MB NOR flash
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
# PSRAM at 200 MHz — REQUIRED for the 800x800 MIPI-DSI framebuffer.
# 200 MHz is gated behind IDF_EXPERIMENTAL_FEATURES; without it the build
# silently falls back to 20 MHz and the DSI underruns (mirrors the official
# 08_lvgl_demo_v9 example config).
CONFIG_SPIRAM=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
CONFIG_SPIRAM_SPEED_200M=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_CACHE_L2_CACHE_256KB=y
CONFIG_CACHE_L2_CACHE_LINE_128B=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_FREERTOS_HZ=1000
# LVGL font for the bring-up placeholder face
CONFIG_LV_FONT_MONTSERRAT_48=y
# LVGL font for status/elapsed/clock chrome
CONFIG_LV_FONT_MONTSERRAT_28=y
# ESP-Hosted C6 radio
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y
# custom fonts are uncompressed, but enable the decoder as belt-and-braces
CONFIG_LV_USE_FONT_COMPRESSED=y
# ESP-Hosted board variant + wifi-remote data-path tuning (from factory brookesia config;
# without these the RPC control path works but data frames never flow)
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_CP_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64
CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y
CONFIG_WIFI_RMT_TX_BA_WIN=32
CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y
CONFIG_WIFI_RMT_RX_BA_WIN=16
# hosted task stacks MUST stay in internal RAM (PSRAM stacks assert on P4)
CONFIG_ESP_HOSTED_DFLT_TASK_FROM_SPIRAM=n
# hosted 2.x: keep internal RAM for task stacks; buffers go to PSRAM
CONFIG_ESP_HOSTED_MEMPOOL_PREFER_SPIRAM=y
# conservative SDIO clock for first data-path proof (raise after verification)
CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=20000
# headroom for diag event handlers that touch LVGL
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
# 1-bit SDIO: fixes the "Unrecoverable host sdio state" wedge family
# (esp-hosted-mcu #167/#148); 2.5MB/s is ~80x what voice needs
CONFIG_ESP_HOSTED_SDIO_1_BIT_BUS=y
# absorb the mic-audio upstream burst without stalling the SDIO write
CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE=32
CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE=32
# esp-sr wake word: "Computer" (wn9_computer_tts), models in the flash "model" partition
CONFIG_MODEL_IN_FLASH=y
CONFIG_SR_WN_WN9_COMPUTER_TTS=y