数字人 RTC 模式音频卡顿根因定位。通过 4 类 ESP_LOGW 埋点采集运行时 数据,对照表格判定根因,输出 Phase 9 实施分支决策。 埋点实现(main/application.cc,PHASE8_DIAG_ENABLE 宏开关,关闭后零开销): - DIAG-1 queue 深度:3 处(出队 + WebSocket 入队 + RTC 入队),50ms 节流 - DIAG-2 codec->OutputData 写入耗时:>15ms 阈值告警 - DIAG-3 WiFi RSSI:OnClockTimer 1Hz - DIAG-4 heap 快照 + 碎片率:OnClockTimer 1Hz 实测结论(见 DIAG_REPORT.md):用户感知卡顿 = 两个独立根因 - A. 开机播报阶段 ③' codec init 时序缺陷(ES7210 I2C 失败 + 126 次 write_slow 集中在 2-13s) - B. RTC 对话阶段 ⑤ Opus/WebSocket 应用层帧到达抖动 (queue 突发堆积 19 + queue=0 出现 58 次,但 codec 写入 0 次 slow) 完全排除:① CPU 争抢、② PSRAM 带宽、④ WiFi 丢包(RSSI -24~-33dBm 极强)、⑥ 内存碎片(heap 全程稳定) Phase 9 推荐分支 B'(双线修复,原 A/C 的 EAF 方案不适用): - 9.1 应用层 jitter buffer(fill-threshold + drain)—— 解 B - 9.2 开机 codec init 时序修复(ES7210 reset + ready 等待)—— 解 A - 估时 1 天 ROADMAP 同步:Phase 7 矫正为 battery_psm(实际状态)、Phase 8 新增 诊断、Phase 9 占位待 Phase 8 决策、原"集成测试"挪到 Phase 10。 新增 .planning/STATE.md 记录 roadmap evolution。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
XiaoZhi AI Chatbot
Introduction
👉 Build your AI chat companion with ESP32+SenseVoice+Qwen72B!【bilibili】
👉 Equipping XiaoZhi with DeepSeek's smart brain【bilibili】
👉 Build your own AI companion, a beginner's guide【bilibili】
Project Purpose
This is an open-source project released under the MIT license, allowing anyone to use it freely, including for commercial purposes.
Through this project, we aim to help more people get started with AI hardware development and understand how to implement rapidly evolving large language models in actual hardware devices. Whether you're a student interested in AI or a developer exploring new technologies, this project offers valuable learning experiences.
Everyone is welcome to participate in the project's development and improvement. If you have any ideas or suggestions, please feel free to raise an Issue or join the chat group.
Learning & Discussion QQ Group: 376893254
Implemented Features
- Wi-Fi / ML307 Cat.1 4G
- BOOT button wake-up and interruption, supporting both click and long-press triggers
- Offline voice wake-up ESP-SR
- Streaming voice dialogue (WebSocket or UDP protocol)
- Support for 5 languages: Mandarin, Cantonese, English, Japanese, Korean SenseVoice
- Voice print recognition to identify who's calling AI's name 3D Speaker
- Large model TTS (Volcano Engine or CosyVoice)
- Large Language Models (Qwen, DeepSeek, Doubao)
- Configurable prompts and voice tones (custom characters)
- Short-term memory, self-summarizing after each conversation round
- OLED / LCD display showing signal strength or conversation content
- Support for LCD image expressions
- Multi-language support (Chinese, English)
Hardware Section
Breadboard DIY Practice
See the Feishu document tutorial:
👉 XiaoZhi AI Chatbot Encyclopedia
Breadboard demonstration:
Supported Open Source Hardware
- LiChuang ESP32-S3 Development Board
- Espressif ESP32-S3-BOX3
- M5Stack CoreS3
- AtomS3R + Echo Base
- AtomMatrix + Echo Base
- Magic Button 2.4
- Waveshare ESP32-S3-Touch-AMOLED-1.8
- LILYGO T-Circle-S3
- XiaGe Mini C3
- Moji XiaoZhi AI Derivative Version
- CuiCan AI pendant
- WMnologo-Xingzhi-1.54TFT
- SenseCAP Watcher
Firmware Section
Flashing Without Development Environment
For beginners, it's recommended to first use the firmware that can be flashed without setting up a development environment.
The firmware connects to the official xiaozhi.me server by default. Currently, personal users can register an account to use the Qwen real-time model for free.
👉 Flash Firmware Guide (No IDF Environment)
Development Environment
- Cursor or VSCode
- Install ESP-IDF plugin, select SDK version 5.3 or above
- Linux is preferred over Windows for faster compilation and fewer driver issues
- Use Google C++ code style, ensure compliance when submitting code
Developer Documentation
- Board Customization Guide - Learn how to create custom board adaptations for XiaoZhi
- IoT Control Module - Understand how to control IoT devices through AI voice commands
AI Agent Configuration
If you already have a XiaoZhi AI chatbot device, you can configure it through the xiaozhi.me console.
👉 Backend Operation Tutorial (Old Interface)
Technical Principles and Private Deployment
👉 Detailed WebSocket Communication Protocol Documentation
For server deployment on personal computers, refer to another MIT-licensed project xiaozhi-esp32-server
