Skip to content

Conversation

@78
Copy link
Owner

@78 78 commented Sep 16, 2025

This pull request introduces several improvements and refactoring to the build system, audio service initialization, and board configurations, with a focus on simplifying wake word selection, improving maintainability, and updating default configurations. The most significant changes are grouped below:

Build System Improvements and Refactoring

  • Added a reusable CMake function find_component_by_pattern to dynamically locate components by pattern, replacing repeated code blocks for finding components such as esp_emote_gfx, espressif__esp-sr, and xiaozhi-fonts in main/CMakeLists.txt. This reduces redundancy and improves maintainability. [1] [2] [3]
  • Updated the project version from 2.0.1 to 2.0.2 in CMakeLists.txt.

Wake Word and Audio Service Refactoring

  • Refactored wake word selection logic in audio_service.cc to choose the appropriate wake word engine at runtime based on the platform and available models, instead of compile-time macros. This enables more flexible and correct wake word detection on different hardware. [1] [2] [3] [4] [5] [6]
  • Updated the logic for appending wake word source files in main/CMakeLists.txt to match the new runtime selection approach.

Board Configuration and Documentation Updates

  • Removed explicit flash size and partition table settings from multiple board config.json files and corresponding documentation, relying on improved defaults and reducing user configuration burden. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Changed the default partition table for ESP32 builds to partitions/v2/4m.csv in sdkconfig.defaults.esp32.

Font and Board Defaults

  • Updated default font assignments for several boards to use font_puhui_basic_14_1 instead of font_puhui_14_1 for improved consistency. [1] [2]

Other Minor Improvements

  • Increased the delay before displaying board information in WiFi config mode from 1 second to 1.5 seconds for better user experience.
  • Simplified power save timer initialization in several board classes by removing conditional logic based on wake word configuration. [1] [2] [3]

@78 78 merged commit f418c16 into main Sep 17, 2025
82 of 94 checks passed
@tyoh-love
Copy link

@78 thank you so much for your good work!!!

It is not clear, the step to enable custom wake word feature. could you give us example and guide doc to make it working?

@78
Copy link
Owner Author

78 commented Sep 18, 2025

@78 thank you so much for your good work!!!

It is not clear, the step to enable custom wake word feature. could you give us example and guide doc to make it working?

Try these steps in menuconfig:

  1. Select "Flash Default Assets"
  2. Disable "Wake Word Detection (AFE)"
  3. Enable "Custom Wake Word Detection"
  4. Fill in these forms:
截图 2025-09-19 00-45-29
  1. Deselect all default wake words in "Load Multiple Wake Words"
  2. Select a "Chinese Speech Commands Model" or "English Speech Commands Model", typically "mn7_cn" or "mn7_en"

Build and Flash.

Check the serial logs if the multinet model has been initialized successfully.

Wvirgil123 added a commit to Wvirgil123/xiaozhi-esp32 that referenced this pull request Sep 30, 2025
* main: (43 commits)
  OTTO 左右腿反了 (78#1239)
  Bump to 2.0.3 (78#1241)
  fix emote display errors (78#1240)
  fix:小智云聊some bugfix (78#1238)
  ci: support multiple variants per board (78#1036)
  添加太极派双声道配置 (78#1235)
  fix multiple wakenet words and custom wake word (78#1226)
  添加 Waveshare ESP32-S3-Touch-LCD-3.49 (78#1227)
  New Waveshare ESP32-S3-Touch-LCD-4B third party board, 86 box form. (78#1199)
  feat: add emote style for v2 (78#1217)
  ESP32 Wifi And 4G Merge In All (78#1219)
  fix: Add function to handle local asset file paths
  Detect wake word model from index.json (78#1211)
  fix: Corrected the inverted touch screen parameter configuration of lichuang_S3_dev, which caused touch offset. (78#1209)
  fix multinet model for v2 (78#1208)
  fix: ESP-HI audio sampling problem (78#1207)
  feat: build default assets instead of downloading and v2 tables for esp-hi, echoear (78#1203)
  regenerate jpeg encoder (78#1198)
  Bump to 2.0.1
  feat: add snapshot mcp tool (78#1196)
  ...
Cmdmac pushed a commit to Cmdmac/xiaozhi-esp32 that referenced this pull request Oct 14, 2025
* detect wake word model from index.json

* update wait time before entering wifi configure mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants