* Initial plan
* Fix crash when adjusting volume via button while audio device is disabled
When both input and output are disabled, UpdateDeviceState() sets dev_ to
nullptr. Pressing a volume button calls SetOutputVolume() which previously
called esp_codec_dev_set_out_vol(dev_, volume) without null-checking dev_,
causing a crash via ESP_ERROR_CHECK.
Fix: Add null guard for dev_ and mutex lock for thread safety. The volume
is still saved via AudioCodec::SetOutputVolume() and will be applied when
the device is reopened by UpdateDeviceState().
Agent-Logs-Url: https://github.com/78/xiaozhi-esp32/sessions/945c653a-ed16-49af-aefe-5cfb473402c6
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
* Enhance Otto Robot camera support by adding configuration for OV3660. Updated config.h to define camera types and GPIO settings, modified config.json to include new camera options, and refactored otto_robot.cc for improved camera detection and initialization logic.
* fix: 移除 OttoEmojiDisplay 构造函数中的 SetTheme 调用以修复 LoadProhibited 崩溃
Made-with: Cursor
* refactor: improve audio service error handling and codec timeout management
- Updated AudioService to prevent input task termination on read timeout, introducing a delay instead.
- Enhanced NoAudioCodec to implement a read timeout for I2S channel reads.
- Adjusted WebSocketControlServer to set a control port for improved socket management.
- Added manufacturer information to the config.json for waveshare ESP32-Touch-LCD-3.5.
* chore: Update esp-wifi-connect version in idf_component.yml and refactor event callback in WifiBoard class
- Bumped esp-wifi-connect version from ~3.0.2 to ~3.1.1 in idf_component.yml.
- Refactored the event callback in WifiBoard to use a string parameter for SSID data, improving clarity and consistency in network event handling.
* refactor: Change logging level for OpusHead and OpusTags detection in OggDemuxer
- Updated log statements from ESP_LOGI to ESP_LOGD for OpusHead and OpusTags found events, improving log verbosity control.
* add: Moji 2 has built-in ESP32-C5 dual band Wi-Fi
* feat: PowerSaveTimer 160 >> 240
* fix(audio): add frame buffering to NoAudioProcessor
On chips where CONFIG_USE_AUDIO_PROCESSOR is unavailable (e.g., ESP32-C5,
which is excluded by Kconfig despite having PSRAM), NoAudioProcessor is used.
The original implementation passed through 160-sample chunks directly, but
the Opus encoder expects 960 samples (60ms @ 16kHz), resulting in frame size
mismatch errors, high CPU usage, and watchdog resets.
Added output_buffer_ to accumulate audio samples until reaching
frame_samples_ (960) before outputting, matching AfeAudioProcessor behavior.
other:
Turn off sleep mode (PowerSaveTimer)
* refactor: Remove hardcoded loop delay for GIF playback in LcdDisplay class
* chore: Update esp-ml307 and uart-eth-modem component versions in idf_component.yml
- Bump esp-ml307 version from ~3.6.3 to ~3.6.4
- Update uart-eth-modem version from ~0.3.1 to ~0.3.2
* feat: Add PrintPmLocks method to SystemInfo class
- Introduced PrintPmLocks method to display power management locks using esp_pm_dump_locks.
- Updated system_info.h to declare the new method.
* refactor: Streamline audio codec initialization and enablement
- Removed redundant channel enable checks from AudioCodec::Start.
- Added channel enablement in CreateDuplexChannels for various audio codecs.
- Implemented EnableInput and EnableOutput methods in NoAudioCodec for better control over input/output states.
* refactor: Delay audio success sound playback until after activation completion
- Moved the success sound playback to a scheduled task to ensure it occurs after the activation process is complete.
- This change improves the responsiveness of the application during activation events.
* refactor: Update camera integration from EspVideo to Esp32Camera
- Replaced EspVideo with Esp32Camera for improved camera configuration and initialization.
- Streamlined camera setup by utilizing a new configuration structure for better clarity and maintainability.
- Updated README.md to remove outdated camera sensor configuration instructions.
* refactor: Update audio demuxing process in AudioService
- Replaced the existing demuxer instance with a local unique pointer in the PlaySound method for better memory management.
- Moved the OnDemuxerFinished callback setup into the PlaySound method to ensure it is correctly associated with the new demuxer instance.
- Removed the member variable demuxer_ from AudioService to streamline the class structure.
* Enhance audio processing and wake word detection
- Set task priority in Application::Run to improve responsiveness.
- Log detected wake words with their state in HandleWakeWordDetectedEvent.
- Streamline audio feeding in AudioService to handle both wake word and audio processor events.
- Implement input buffering in AfeAudioProcessor, AfeWakeWord, CustomWakeWord, and EspWakeWord to manage audio data more efficiently.
- Clear input buffers on stop to prevent residual data issues.
* Refactor audio processing to enhance thread safety and state management
- Implement early return checks in Feed methods of AfeAudioProcessor, AfeWakeWord, CustomWakeWord, and EspWakeWord to prevent processing when not running.
- Introduce std::atomic for running state in CustomWakeWord and EspWakeWord to ensure thread-safe access.
- Consolidate input buffer management with mutex locks to avoid race conditions during Stop and Feed operations.
* Refactor listening mode handling and wake word detection configuration
- Replace direct mode setting logic with a new GetDefaultListeningMode method for improved clarity and maintainability.
- Update HandleToggleChatEvent, HandleWakeWordDetectedEvent, and ContinueWakeWordInvoke to utilize the new method for determining listening mode.
- Introduce Kconfig option WAKE_WORD_DETECTION_IN_LISTENING to enable or disable wake word detection during listening mode, enhancing configurability.
* feat: add support for ESP32-P4-Function-EV-Board with configuration and display handling
* detect wake word model from index.json
* update wait time before entering wifi configure mode
* feat: Enhance ESP32-P4 Function EV Board support with LCD and touch initialization
* feat: Update ESP32-P4 Function EV Board configuration for improved touch and SD card support
* feat: add touch I2C configuration and improve initialization structure
* Remove ESP hosted configuration from defaults
Removed ESP hosted configuration options.
* chore: update documentation for improved clarity
* refactor: remove obsolete files for ESP32-P4-Function-EV-Board and add updated configurations
* refactor: reintroduce ESP32-P4-Function-EV-Board implementation with updated configurations
* refactor: restore esp32_p4_function_ev_board dependency with updated version
---------
Co-authored-by: n2flowjs-bot <n2flowjs@gmail.com>
Co-authored-by: Terrence <terrence@tenclass.com>
* update v2 partition table readme
* feat: Add user only tool
* Add image cache
* smaller cache and buffer, more heap
* use MAIN_EVENT_CLOCK_TICK to avoid audio glitches
* fix: esp_psram_get_size not found in c3
* Bump to 1.9.0
* fix: resolve crash when closing codec dev on esp-hi
* fix: fix incorrect status display in non-zh-CN languages
* fix: reduce noise when not in Speaking state