Atom Echo works for a while after restart, but then stops responding

Hi,

I just got an M5Stack Atom Echo and was suffering the same fate as reported here,
here, and in issue 122.

After digging into the problem I made several updates to address ring buffer overruns, watchdog timeouts, and data races. I now have, at least what appears on my end, a stable functional device that doesn’t freeze up and reboot on every response.

Before submitting a PR to ESPHome, I need some help testing.

Would those of you that have been in this thread [@e-raser, @Snowball, @omarahmed500, @Merc, @yalexau, @Rich37804, @eamonn] please test this? Also, if you have access to any other ESPHome voice assisant devices it would be ideal to have the code tested there as well.

The easiest way to test is to use external components by adding this to your ESPHome YAML configuration:

external_components:
  - source: github://cjb0001/esphome-dev@feature/mww-speaker-improvements
    components: [ micro_wake_word, i2s_audio, speaker ]
    refresh: 0s

I also suggest increasing the speaker buffer_duration from 60ms to 240ms.

speaker:
  - platform: i2s_audio
    id: echo_speaker
    i2s_dout_pin: GPIO22
    dac_type: external
    bits_per_sample: 16bit
    sample_rate: 16000
    channel: stereo
    buffer_duration: 240ms

What to Test

Basic functionality:

  • Wake word detection still works
  • Voice assistant responses play completely without reboots
  • Device remains stable after multiple interactions

Monitor logs (optional but helpful):

logger:
  level: DEBUG

Look for these log entries at startup:

[C][micro_wake_word:078]: microWakeWord:
[C][micro_wake_word:079]: Ring buffer duration: 240 ms

and these after using the voice assistant:

[D][ring_buffer:034][mww]: Created ring buffer with size 7680
[D][micro_wake_word:389][mww]: Registered mww task with watchdog

Stress testing:

  • Try multiple wake word detections in quick succession
  • Test long voice assistant responses
  • Leave running for extended periods

Expected Results

  • No more reboots during voice responses
  • Stable operation over time
  • Complete audio playback

Report if you are having

  • Still experiencing reboots
  • Watchdog timeout errors
  • Audio glitches or cutoffs
  • Increased memory issues

Reporting Results

Please report your testing results and include:

Device: M5 Atom Echo (specify if ESP32 or ESP32-S3 variant)
ESPHome version: (e.g., 2024.11.0)
Wake word model(s): (e.g., okay_nabu, hey_jarvis)
Result: Working / Still has issues
Logs: (if experiencing issues, include relevant log output)

Rollback
If you experience issues, remove the external_components section from your YAML and reflash to return to the stock ESPHome version. You may need to click “Clean Build Files”

Feedback
Post in this thread with your results or issues!