esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

HA Crash during compile. 2024.7.0b2 with micro word. #6042

Closed karllinder closed 2 months ago

karllinder commented 4 months ago

The problem

During compiling phase the complete HA crash. This is related to the micro word, when removing micro_wake_word and voice assistant yaml the compiling is done without any issues. Usually it´s crash during the TensorFlow compile. Same issue was with Beta1.

Archiving .pioenvs/audio1/esp-idf/efuse/libefuse.a
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/flatbuffer_utils.o
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/memory_helpers.o
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/micro_allocation_info.o

Which version of ESPHome has the issue?

2024.7.0b2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.7.2

What platform are you using?

ESP32-IDF

Board

ESP32Dev

Component causing the issue

microwakeword

Example YAML snippet

i2s_audio:
  id: audio_in
  i2s_lrclk_pin: GPIO32 #WSEL - WS pin
  i2s_bclk_pin: GPIO25 #BCLK - SCK pin

microphone:
  - platform: i2s_audio
    id: mic_1
    pdm: false
    channel: right
    i2s_audio_id: audio_in
    adc_type: external
    i2s_din_pin: GPIO26 #SD

micro_wake_word:
  models:
    - model: github://esphome/micro-wake-word-models/models/v2/hey_jarvis.json@main
#  vad:
 #  - model: github://esphome/micro-wake-word-models/models/v2/vad.json@main
  on_wake_word_detected:
    then:
      - voice_assistant.start:
          wake_word: !lambda return wake_word;

voice_assistant:
  microphone: mic_1
  use_wake_word: true

Anything in the logs that might be useful for us?

running HAOS 12.4 on a x86 platform (Intel Celeron, 4GB ram)

Additional information

INFO ESPHome 2024.7.0b2
INFO Reading configuration /config/esphome/audio1.yaml...
INFO Detected timezone 'Europe/Stockholm'
INFO Generating C++ source...
INFO Updating https://github.com/espressif/esp-tflite-micro@v1.3.1
INFO Compiling app...
Processing audio1 (board: esp32dev; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
Library Manager: Installing kahrendt/ESPMicroSpeechFeatures @ 1.0.0
INFO Installing kahrendt/ESPMicroSpeechFeatures @ 1.0.0
Unpacking  [####################################]  100%
Library Manager: ESPMicroSpeechFeatures@1.0.0 has been installed!
INFO ESPMicroSpeechFeatures@1.0.0 has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40407.240606 (4.4.7) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Creating a new virtual environment for IDF Python dependencies
Installing ESP-IDF's Python dependencies
Collecting urllib3<2
  Downloading urllib3-1.26.19-py2.py3-none-any.whl (143 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.9/143.9 kB 4.1 MB/s eta 0:00:00
Collecting cryptography<35.0.0,>=2.1.4
  Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_24_x86_64.whl (3.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 11.3 MB/s eta 0:00:00
Collecting future>=0.18.3
  Downloading future-1.0.0-py3-none-any.whl (491 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 491.3/491.3 kB 12.6 MB/s eta 0:00:00
Collecting pyparsing<2.4.0,>=2.0.3
  Downloading pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.8/61.8 kB 27.3 MB/s eta 0:00:00
Collecting kconfiglib~=13.7.1
  Downloading kconfiglib-13.7.1-py2.py3-none-any.whl (145 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.7/145.7 kB 13.1 MB/s eta 0:00:00
Collecting idf-component-manager~=1.0
  Downloading idf_component_manager-1.5.3-py2.py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.3/161.3 kB 14.0 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (464 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 464.8/464.8 kB 12.6 MB/s eta 0:00:00
Collecting packaging
  Downloading packaging-24.1-py3-none-any.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.0/54.0 kB 44.3 MB/s eta 0:00:00
Collecting requests<3
  Downloading requests-2.32.3-py3-none-any.whl (64 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 26.1 MB/s eta 0:00:00
Collecting requests-file<2
  Downloading requests_file-1.5.1-py2.py3-none-any.whl (3.7 kB)
Collecting requests-toolbelt
  Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.5/54.5 kB 33.3 MB/s eta 0:00:00
Collecting schema<=0.7.5
  Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting tqdm<5
  Downloading tqdm-4.66.4-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 17.5 MB/s eta 0:00:00
Collecting colorama
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting pyyaml>5.2
  Downloading PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.7/757.7 kB 12.0 MB/s eta 0:00:00
Collecting cachecontrol[filecache]>0.12.6
  Downloading cachecontrol-0.14.0-py3-none-any.whl (22 kB)
Collecting contextlib2>0.6.0
  Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Collecting click
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 17.0 MB/s eta 0:00:00
Collecting msgpack<2.0.0,>=0.5.2
  Downloading msgpack-1.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (409 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 409.3/409.3 kB 13.0 MB/s eta 0:00:00
Collecting filelock>=3.8.0
  Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
Collecting pycparser
  Downloading pycparser-2.22-py3-none-any.whl (117 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 14.6 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.3/140.3 kB 13.7 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.7-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB 22.0 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2024.7.4-py3-none-any.whl (162 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.0/163.0 kB 13.2 MB/s eta 0:00:00
Installing collected packages: pyparsing, urllib3, tqdm, six, pyyaml, pycparser, packaging, msgpack, kconfiglib, idna, future, filelock, contextlib2, colorama, click, charset-normalizer, certifi, schema, requests, cffi, requests-toolbelt, requests-file, cryptography, cachecontrol, idf-component-manager
Successfully installed cachecontrol-0.14.0 certifi-2024.7.4 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-3.4.8 filelock-3.15.4 future-1.0.0 idf-component-manager-1.5.3 idna-3.7 kconfiglib-13.7.1 msgpack-1.0.8 packaging-24.1 pycparser-2.22 pyparsing-2.3.1 pyyaml-6.0.1 requests-2.32.3 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.66.4 urllib3-1.26.19
Reading CMake configuration...
Generating assembly for certificate bundle...
Dependency Graph
|-- ESPMicroSpeechFeatures @ 1.0.0
Compiling .pioenvs/audio1/src/esphome/components/api/api_connection.o
Compiling .pioenvs/audio1/src/esphome/components/api/api_frame_helper.o
Compiling .pioenvs/audio1/src/esphome/components/api/api_pb2.o
Compiling .pioenvs/audio1/src/esphome/components/api/api_pb2_service.o
Compiling .pioenvs/audio1/src/esphome/components/api/api_server.o
Compiling .pioenvs/audio1/src/esphome/components/api/list_entities.o
Compiling .pioenvs/audio1/src/esphome/components/api/proto.o
Compiling .pioenvs/audio1/src/esphome/components/api/subscribe_state.o
Compiling .pioenvs/audio1/src/esphome/components/api/user_services.o
Compiling .pioenvs/audio1/src/esphome/components/esp32/core.o
Compiling .pioenvs/audio1/src/esphome/components/esp32/gpio.o
Compiling .pioenvs/audio1/src/esphome/components/esp32/preferences.o
Compiling .pioenvs/audio1/src/esphome/components/esphome/ota/ota_esphome.o
Compiling .pioenvs/audio1/src/esphome/components/i2s_audio/i2s_audio.o
Compiling .pioenvs/audio1/src/esphome/components/i2s_audio/microphone/i2s_audio_microphone.o
Compiling .pioenvs/audio1/src/esphome/components/logger/logger.o
Compiling .pioenvs/audio1/src/esphome/components/logger/logger_esp32.o
Compiling .pioenvs/audio1/src/esphome/components/logger/logger_esp8266.o
Compiling .pioenvs/audio1/src/esphome/components/logger/logger_host.o
Compiling .pioenvs/audio1/src/esphome/components/logger/logger_libretiny.o
Compiling .pioenvs/audio1/src/esphome/components/logger/logger_rp2040.o
Compiling .pioenvs/audio1/src/esphome/components/md5/md5.o
Compiling .pioenvs/audio1/src/esphome/components/mdns/mdns_component.o
Compiling .pioenvs/audio1/src/esphome/components/mdns/mdns_esp32.o
Compiling .pioenvs/audio1/src/esphome/components/mdns/mdns_esp8266.o
Compiling .pioenvs/audio1/src/esphome/components/mdns/mdns_host.o
Compiling .pioenvs/audio1/src/esphome/components/mdns/mdns_libretiny.o
Compiling .pioenvs/audio1/src/esphome/components/mdns/mdns_rp2040.o
Compiling .pioenvs/audio1/src/esphome/components/micro_wake_word/micro_wake_word.o
Compiling .pioenvs/audio1/src/esphome/components/micro_wake_word/streaming_model.o
Compiling .pioenvs/audio1/src/esphome/components/network/util.o
Compiling .pioenvs/audio1/src/esphome/components/ota/ota_backend.o
Compiling .pioenvs/audio1/src/esphome/components/ota/ota_backend_arduino_esp32.o
Compiling .pioenvs/audio1/src/esphome/components/ota/ota_backend_arduino_esp8266.o
Compiling .pioenvs/audio1/src/esphome/components/ota/ota_backend_arduino_libretiny.o
Compiling .pioenvs/audio1/src/esphome/components/ota/ota_backend_arduino_rp2040.o
Compiling .pioenvs/audio1/src/esphome/components/ota/ota_backend_esp_idf.o
Compiling .pioenvs/audio1/src/esphome/components/safe_mode/safe_mode.o
Compiling .pioenvs/audio1/src/esphome/components/sntp/sntp_component.o
Compiling .pioenvs/audio1/src/esphome/components/socket/bsd_sockets_impl.o
Compiling .pioenvs/audio1/src/esphome/components/socket/lwip_raw_tcp_impl.o
Compiling .pioenvs/audio1/src/esphome/components/socket/lwip_sockets_impl.o
Compiling .pioenvs/audio1/src/esphome/components/socket/socket.o
Compiling .pioenvs/audio1/src/esphome/components/time/automation.o
Compiling .pioenvs/audio1/src/esphome/components/time/real_time_clock.o
Compiling .pioenvs/audio1/src/esphome/components/voice_assistant/voice_assistant.o
Compiling .pioenvs/audio1/src/esphome/components/wifi/wifi_component.o
Compiling .pioenvs/audio1/src/esphome/components/wifi/wifi_component_esp32_arduino.o
Compiling .pioenvs/audio1/src/esphome/components/wifi/wifi_component_esp8266.o
Compiling .pioenvs/audio1/src/esphome/components/wifi/wifi_component_esp_idf.o
Compiling .pioenvs/audio1/src/esphome/components/wifi/wifi_component_libretiny.o
Compiling .pioenvs/audio1/src/esphome/components/wifi/wifi_component_pico_w.o
Compiling .pioenvs/audio1/src/esphome/core/application.o
Compiling .pioenvs/audio1/src/esphome/core/color.o
Compiling .pioenvs/audio1/src/esphome/core/component.o
Compiling .pioenvs/audio1/src/esphome/core/component_iterator.o
Compiling .pioenvs/audio1/src/esphome/core/controller.o
Compiling .pioenvs/audio1/src/esphome/core/entity_base.o
Compiling .pioenvs/audio1/src/esphome/core/helpers.o
Compiling .pioenvs/audio1/src/esphome/core/log.o
Compiling .pioenvs/audio1/src/esphome/core/ring_buffer.o
Compiling .pioenvs/audio1/src/esphome/core/scheduler.o
Compiling .pioenvs/audio1/src/esphome/core/string_ref.o
Compiling .pioenvs/audio1/src/esphome/core/time.o
Compiling .pioenvs/audio1/src/esphome/core/util.o
Compiling .pioenvs/audio1/src/main.o
Generating LD script .pioenvs/audio1/memory.ld
Compiling .pioenvs/audio1/app_trace/app_trace.o
Compiling .pioenvs/audio1/app_trace/app_trace_util.o
Compiling .pioenvs/audio1/app_trace/host_file_io.o
Compiling .pioenvs/audio1/app_trace/gcov/gcov_rtio.o
Compiling .pioenvs/audio1/app_update/esp_ota_ops.o
Compiling .pioenvs/audio1/app_update/esp_app_desc.o
Archiving .pioenvs/audio1/esp-idf/app_trace/libapp_trace.a
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_common.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_common_loader.o
Archiving .pioenvs/audio1/esp-idf/app_update/libapp_update.a
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_clock_init.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_flash.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_mem.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_random.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_random_esp32.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_utility.o
Compiling .pioenvs/audio1/bootloader_support/src/esp_image_format.o
Compiling .pioenvs/audio1/bootloader_support/src/flash_encrypt.o
Compiling .pioenvs/audio1/bootloader_support/src/secure_boot.o
Compiling .pioenvs/audio1/bootloader_support/src/flash_partitions.o
Compiling .pioenvs/audio1/bootloader_support/src/flash_qio_mode.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_flash_config_esp32.o
Compiling .pioenvs/audio1/bootloader_support/src/bootloader_efuse.o
Compiling .pioenvs/audio1/bootloader_support/src/idf/bootloader_sha.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborencoder_close_container_checked.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborencoder.o
Archiving .pioenvs/audio1/esp-idf/bootloader_support/libbootloader_support.a
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborerrorstrings.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborparser_dup_string.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborparser.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborpretty_stdio.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborpretty.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cbortojson.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/cborvalidation.o
Compiling .pioenvs/audio1/cbor/tinycbor/src/open_memstream.o
Compiling .pioenvs/audio1/cmock/CMock/src/cmock.o
Compiling .pioenvs/audio1/console/commands.o
Archiving .pioenvs/audio1/esp-idf/cbor/libcbor.a
Compiling .pioenvs/audio1/console/esp_console_repl.o
Archiving .pioenvs/audio1/esp-idf/cmock/libcmock.a
Compiling .pioenvs/audio1/console/split_argv.o
Compiling .pioenvs/audio1/console/linenoise/linenoise.o
Compiling .pioenvs/audio1/console/argtable3/arg_cmd.o
Compiling .pioenvs/audio1/console/argtable3/arg_date.o
Compiling .pioenvs/audio1/console/argtable3/arg_dbl.o
Compiling .pioenvs/audio1/console/argtable3/arg_dstr.o
Compiling .pioenvs/audio1/console/argtable3/arg_end.o
Compiling .pioenvs/audio1/console/argtable3/arg_file.o
Compiling .pioenvs/audio1/console/argtable3/arg_hashtable.o
Compiling .pioenvs/audio1/console/argtable3/arg_int.o
Compiling .pioenvs/audio1/console/argtable3/arg_lit.o
Compiling .pioenvs/audio1/console/argtable3/arg_rem.o
Compiling .pioenvs/audio1/console/argtable3/arg_rex.o
Compiling .pioenvs/audio1/console/argtable3/arg_str.o
Compiling .pioenvs/audio1/console/argtable3/arg_utils.o
Compiling .pioenvs/audio1/console/argtable3/argtable3.o
Compiling .pioenvs/audio1/cxx/cxx_exception_stubs.o
Compiling .pioenvs/audio1/cxx/cxx_guards.o
Compiling .pioenvs/audio1/driver/gpio.o
Archiving .pioenvs/audio1/esp-idf/console/libconsole.a
Compiling .pioenvs/audio1/driver/i2c.o
Archiving .pioenvs/audio1/esp-idf/cxx/libcxx.a
Compiling .pioenvs/audio1/driver/i2s.o
Compiling .pioenvs/audio1/driver/ledc.o
Compiling .pioenvs/audio1/driver/pcnt.o
Compiling .pioenvs/audio1/driver/periph_ctrl.o
Compiling .pioenvs/audio1/driver/rmt.o
Compiling .pioenvs/audio1/driver/rtc_io.o
Compiling .pioenvs/audio1/driver/rtc_module.o
Compiling .pioenvs/audio1/driver/sdspi_crc.o
Compiling .pioenvs/audio1/driver/sdspi_host.o
Compiling .pioenvs/audio1/driver/sdspi_transaction.o
Compiling .pioenvs/audio1/driver/sigmadelta.o
Compiling .pioenvs/audio1/driver/spi_common.o
Compiling .pioenvs/audio1/driver/spi_master.o
Compiling .pioenvs/audio1/driver/spi_slave.o
Compiling .pioenvs/audio1/driver/spi_bus_lock.o
Compiling .pioenvs/audio1/driver/timer.o
Compiling .pioenvs/audio1/driver/twai.o
Compiling .pioenvs/audio1/driver/uart.o
Compiling .pioenvs/audio1/driver/adc_common.o
Compiling .pioenvs/audio1/driver/dac_common.o
Compiling .pioenvs/audio1/driver/mcpwm.o
Compiling .pioenvs/audio1/driver/sdio_slave.o
Compiling .pioenvs/audio1/driver/sdmmc_host.o
Compiling .pioenvs/audio1/driver/sdmmc_transaction.o
Compiling .pioenvs/audio1/driver/touch_sensor_common.o
Compiling .pioenvs/audio1/driver/esp32/touch_sensor.o
Compiling .pioenvs/audio1/driver/adc.o
Compiling .pioenvs/audio1/driver/esp32/adc.o
Compiling .pioenvs/audio1/driver/adc_deprecated.o
Compiling .pioenvs/audio1/driver/esp32/dac.o
Compiling .pioenvs/audio1/efuse/esp32/esp_efuse_table.o
Compiling .pioenvs/audio1/efuse/esp32/esp_efuse_fields.o
Compiling .pioenvs/audio1/efuse/esp32/esp_efuse_utility.o
Compiling .pioenvs/audio1/efuse/src/esp_efuse_api.o
Archiving .pioenvs/audio1/esp-idf/driver/libdriver.a
Compiling .pioenvs/audio1/efuse/src/esp_efuse_fields.o
Compiling .pioenvs/audio1/efuse/src/esp_efuse_utility.o
Compiling .pioenvs/audio1/efuse/src/esp_efuse_api_key_esp32.o
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/debug_log.o
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/fake_micro_context.o
Archiving .pioenvs/audio1/esp-idf/efuse/libefuse.a
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/flatbuffer_utils.o
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/memory_helpers.o
Compiling .pioenvs/audio1/components/esp-tflite-micro/tensorflow/lite/micro/micro_allocation_info.o
ssieb commented 4 months ago

You probably need more RAM. You could try restricting the compile processes to 1, but that might still not be enough.

darth-hp commented 3 months ago

See https://github.com/esphome/issues/issues/5964#issuecomment-2236759711

karllinder commented 2 months ago

Did start a docker on a Linux, then all ok. Case closes