esphome / issues

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

Audio.h seems to be missing in ESPHome 2024.11.0 #6460

Open JimmyPedersen opened 1 day ago

JimmyPedersen commented 1 day ago

The problem

Since updating to 2024.11.0 i can't rebuild the code for the ReSpeaker Lite

Which version of ESPHome has the issue?

ESPHome 2024.11.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.11.2

What platform are you using?

ESP32-IDF

Board

Seeedstudio ReSpeaker Lite

Component causing the issue

audio

Example YAML snippet

esphome:
  name: esp32s3
  friendly_name: ReSpeaker_1
  platformio_options:
    board_build.flash_mode: dio
    board_build.mcu: esp32s3
  # on_boot:
  #   then:
  #     - if:
  #            condition:
  #              switch.is_on: 
  #            then:
  #              - voice_assistant.start_continuous:

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: esp-idf
    version: recommended

# Enable logging
logger:
#  level: VERY_VERBOSE

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_encryption_key

ota:
  - platform: esphome
    password: "REMOVED!"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Respeaker1 Fallback Hotspot"
    password: !secret wifi_password

captive_portal:

external_components:
  - source: github://QingWind6/ESPHome_XIAO-ESP32S3

i2s_audio_xiao:
  i2s_lrclk_pin: GPIO7
  i2s_bclk_pin: GPIO8
  i2s_mclk_pin: GPIO9

microphone:
  - platform: i2s_audio_xiao
    id: xiao_mic
    adc_type: external
    i2s_din_pin: GPIO44
    pdm: false
    bits_per_sample: 32bit
    channel: left

speaker:
  - platform: i2s_audio_xiao
    id: xiao_speaker
    dac_type: external
    i2s_dout_pin: GPIO43
    mode: stereo

voice_assistant:
  microphone: xiao_mic
  use_wake_word: true
  noise_suppression_level: 0
  auto_gain: 0dBFS
  volume_multiplier: 1
  speaker: xiao_speaker
  id: assist
  on_listening:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: "Slow Pulse"
  on_stt_vad_end:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: "Fast Pulse"
  on_tts_start:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        brightness: 100%
        effect: none
  on_end:
    - delay: 100ms
    - wait_until:
        not:
          speaker.is_playing:
    - script.execute: reset_led
  on_error:
    - light.turn_on:
        id: led
        red: 100%
        green: 0%
        blue: 0%
        brightness: 100%
        effect: none
    - delay: 1s
    - script.execute: reset_led
  on_client_connected:
    - if:
        condition:
          switch.is_on: use_wake_word
        then:
          - voice_assistant.start_continuous:
          - script.execute: reset_led
  on_client_disconnected:
    - if:
        condition:
          switch.is_on: use_wake_word
        then:
          - voice_assistant.stop:
          - light.turn_off: led

light:
  - platform: esp32_rmt_led_strip
    id: led
    name: None
    disabled_by_default: true
    entity_category: config
    pin: GPIO1
    default_transition_length: 0s
    chipset: ws2812
    num_leds: 1
    rgb_order: grb
    rmt_channel: 0
    effects:
      - pulse:
          name: "Slow Pulse"
          transition_length: 250ms
          update_interval: 250ms
          min_brightness: 50%
          max_brightness: 100%
      - pulse:
          name: "Fast Pulse"
          transition_length: 100ms
          update_interval: 100ms
          min_brightness: 50%
          max_brightness: 100%

output:
  - platform: ledc
    id: light_output
    pin: GPIO21
    inverted: true

script:
  - id: reset_led
    then:
      - if:
          condition:
            - switch.is_on: use_wake_word
            - switch.is_on: use_listen_light
          then:
            - light.turn_on:
                id: led
                effect: none

          else:
            - light.turn_off: 
               id: led

switch:
  - platform: template
    name: Use wake word
    id: use_wake_word
    optimistic: true
    restore_mode: RESTORE_DEFAULT_ON
    entity_category: config
    on_turn_on:
      - lambda: id(assist).set_use_wake_word(true);
      - if:
          condition:
            not:
              - voice_assistant.is_running
          then:
            - voice_assistant.start_continuous
    on_turn_off:
      - voice_assistant.stop
      - lambda: id(assist).set_use_wake_word(false);

  - platform: template
    name: Use Listen Light
    id: use_listen_light
    optimistic: true
    restore_mode: RESTORE_DEFAULT_ON
    entity_category: config
    on_turn_on:
      - script.execute: reset_led
    on_turn_off:
      - script.execute: reset_led

Anything in the logs that might be useful for us?

INFO ESPHome 2024.11.0
INFO Reading configuration /config/esphome/respeaker1.yaml...
INFO Cloning https://github.com/QingWind6/ESPHome_XIAO-ESP32S3.git@None
INFO Generating C++ source...
INFO Core config, version or integrations changed, cleaning build files...
INFO Compiling app...
Processing esp32s3 (board: esp32-s3-devkitc-1; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
Platform Manager: Installing platformio/espressif32 @ 5.4.0
INFO Installing platformio/espressif32 @ 5.4.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif32@5.4.0 has been installed!
INFO espressif32@5.4.0 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
INFO Installing espressif/toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa-esp32s3@8.4.0+2021r2-patch5 has been installed!
INFO toolchain-xtensa-esp32s3@8.4.0+2021r2-patch5 has been installed!
Tool Manager: Installing espressif/toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
INFO Installing espressif/toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-riscv32-esp@8.4.0+2021r2-patch5 has been installed!
INFO toolchain-riscv32-esp@8.4.0+2021r2-patch5 has been installed!
Tool Manager: Installing espressif/toolchain-esp32ulp @ 2.35.0-20220830
INFO Installing espressif/toolchain-esp32ulp @ 2.35.0-20220830
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: toolchain-esp32ulp@2.35.0-20220830 has been installed!
INFO toolchain-esp32ulp@2.35.0-20220830 has been installed!
Tool Manager: Installing platformio/framework-espidf @ ~3.40408.0
INFO Installing platformio/framework-espidf @ ~3.40408.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%          
Tool Manager: framework-espidf@3.40408.0 has been installed!
INFO framework-espidf@3.40408.0 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.40400.0
INFO Installing platformio/tool-esptoolpy @ ~1.40400.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.40400.0 has been installed!
INFO tool-esptoolpy@1.40400.0 has been installed!
Tool Manager: Installing platformio/tool-cmake @ ~3.16.0
INFO Installing platformio/tool-cmake @ ~3.16.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%          
Tool Manager: tool-cmake@3.16.4 has been installed!
INFO tool-cmake@3.16.4 has been installed!
Tool Manager: Installing platformio/tool-ninja @ ^1.7.0
INFO Installing platformio/tool-ninja @ ^1.7.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-ninja@1.7.1 has been installed!
INFO tool-ninja@1.7.1 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40801.0
INFO Installing platformio/tool-scons @ ~4.40801.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-scons@4.40801.0 has been installed!
INFO tool-scons@4.40801.0 has been installed!
Library Manager: Installing esphome/noise-c @ 0.1.6
INFO Installing esphome/noise-c @ 0.1.6
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: noise-c@0.1.6 has been installed!
INFO noise-c@0.1.6 has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/libsodium @ 1.10018.4
INFO Installing esphome/libsodium @ 1.10018.4
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: libsodium@1.10018.4 has been installed!
INFO libsodium@1.10018.4 has been installed!
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - framework-espidf @ 3.40408.0 (4.4.8) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 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.20-py2.py3-none-any.whl (144 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 144.2/144.2 kB 4.2 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 15.6 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 26.3 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 140.1 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 68.2 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 45.2 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (467 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 467.2/467.2 kB 27.3 MB/s eta 0:00:00
Collecting packaging
  Downloading packaging-24.2-py3-none-any.whl (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.5/65.5 kB 80.5 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 62.2 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 60.5 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.67.0-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.6/78.6 kB 64.3 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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (762 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 763.0/763.0 kB 28.3 MB/s eta 0:00:00
Collecting cachecontrol[filecache]>0.12.6
  Downloading cachecontrol-0.14.1-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 92.8 MB/s eta 0:00:00
Collecting msgpack<2.0.0,>=0.5.2
  Downloading msgpack-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (403 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 403.7/403.7 kB 30.8 MB/s eta 0:00:00
Collecting filelock>=3.8.0
  Downloading filelock-3.16.1-py3-none-any.whl (16 kB)
Collecting pycparser
  Downloading pycparser-2.22-py3-none-any.whl (117 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 77.9 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.6/142.6 kB 117.5 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.10-py3-none-any.whl (70 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.4/70.4 kB 133.6 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2024.8.30-py3-none-any.whl (167 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 167.3/167.3 kB 88.7 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.1 certifi-2024.8.30 cffi-1.17.1 charset-normalizer-3.4.0 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-3.4.8 filelock-3.16.1 future-1.0.0 idf-component-manager-1.5.3 idna-3.10 kconfiglib-13.7.1 msgpack-1.1.0 packaging-24.2 pycparser-2.22 pyparsing-2.3.1 pyyaml-6.0.2 requests-2.32.3 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.67.0 urllib3-1.26.20
Reading CMake configuration...
Generating assembly for certificate bundle...
Dependency Graph
|-- noise-c @ 0.1.6
Compiling .pioenvs/esp32s3/src/esphome/components/api/api_connection.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/api_frame_helper.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/api_pb2.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/api_pb2_service.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/api_server.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/list_entities.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/proto.o
Compiling .pioenvs/esp32s3/src/esphome/components/api/subscribe_state.o
In file included from src/esphome/components/voice_assistant/voice_assistant.h:16,
                 from src/esphome/components/api/api_connection.cpp:22:
src/esphome/components/speaker/speaker.h:13:10: fatal error: esphome/components/audio/audio.h: No such file or directory
 #include "esphome/components/audio/audio.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/esp32s3/src/esphome/components/api/api_connection.o] Error 1
========================= [FAILED] Took 177.06 seconds =========================

Additional information

I also tried to uninstall and reinstall the ESP-Home add-on to make sure all files were properly downloaded from github etc.

samsonusmc commented 22 hours ago

also getting the same error

`Compiling .pioenvs/esp32-s3-box-3-5a94d8/src/esphome/components/api/api_connection.o In file included from src/esphome/components/voice_assistant/voice_assistant.h:16, from src/esphome/components/api/api_connection.cpp:22: src/esphome/components/speaker/speaker.h:13:10: fatal error: esphome/components/audio/audio.h: No such file or directory

include "esphome/components/audio/audio.h"

      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated. *** [.pioenvs/esp32-s3-box-3-5a94d8/src/esphome/components/api/api_connection.o] Error 1`

FelixGaebler commented 21 hours ago

Same here.

INFO ESPHome 2024.11.0
INFO Reading configuration /config/esphome/flur.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing flur (board: esp32-s3-devkitc-1; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - framework-espidf @ 3.40408.0 (4.4.8) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
No dependencies
Compiling .pioenvs/flur/src/esphome/components/api/api_connection.o
Compiling .pioenvs/flur/src/esphome/components/api/api_server.o
Compiling .pioenvs/flur/src/esphome/components/api/list_entities.o
Compiling .pioenvs/flur/src/esphome/components/api/proto.o
In file included from src/esphome/components/voice_assistant/voice_assistant.h:16,
                 from src/esphome/components/api/api_connection.cpp:22:
src/esphome/components/speaker/speaker.h:13:10: fatal error: esphome/components/audio/audio.h: No such file or directory
 #include "esphome/components/audio/audio.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/flur/src/esphome/components/api/api_connection.o] Error 1
========================== [FAILED] Took 4.76 seconds ==========================
FelixGaebler commented 21 hours ago

Duplicate of https://github.com/esphome/issues/issues/6464

JimmyPedersen commented 20 hours ago

Can confirm that just adding:

audio:

To the YAML (Causing it to include the Audio component) fixes the build issue. It build but I haven't had time to test the resulting firmware yet. Mostly likely everything should be ok

Ps. Credits to CamronBorealis that mentions this fix in https://github.com/esphome/issues/issues/6464#issuecomment-2492079028