ReSpeaker - ESPHome compilation failed

Following instructions at Voice Assistant System for Home Assitant | Seeed Studio Wiki

Getting following compilation error in ESPHome

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/respeaker.yaml...
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Compiling app...
Processing esp32s3 (board: esp32-s3-devkitc-1; framework: espidf; platform: https://github.com/pioarduino/platform-espressif32.git#51.03.07)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - framework-espidf @ 3.50105.0 (5.1.5) 
 - tool-cmake @ 3.21.3 
 - tool-esptoolpy @ 4.8.1 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.10.2 
 - tool-riscv32-esp-elf-gdb @ 12.1.0+20221002 
 - tool-xtensa-esp-elf-gdb @ 12.1.0+20221002 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 12.2.0+20230208 
 - toolchain-xtensa-esp32s3 @ 12.2.0+20230208
Reading CMake configuration...
No dependencies
Compiling .pioenvs/esp32s3/src/esphome/components/i2s_audio_xiao/i2s_audio_xiao.cpp.o
In file included from src/esphome/components/i2s_audio_xiao/i2s_audio_xiao.h:5,
                 from src/esphome/components/i2s_audio_xiao/i2s_audio_xiao.cpp:1:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/i2s.h:27:2: warning: #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-Wcpp]
   27 | #warning "This set of I2S APIs has been deprecated, \
      |  ^~~~~~~
Compiling .pioenvs/esp32s3/src/esphome/components/i2s_audio_xiao/speaker/i2s_audio_speaker.cpp.o
Compiling .pioenvs/esp32s3/src/esphome/components/light/esp_range_view.cpp.o
Compiling .pioenvs/esp32s3/src/esphome/components/light/light_call.cpp.o
In file included from src/esphome/components/i2s_audio_xiao/speaker/../i2s_audio_xiao.h:5,
                 from src/esphome/components/i2s_audio_xiao/speaker/i2s_audio_speaker.h:5,
                 from src/esphome/components/i2s_audio_xiao/speaker/i2s_audio_speaker.cpp:1:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/i2s.h:27:2: warning: #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-Wcpp]
   27 | #warning "This set of I2S APIs has been deprecated, \
      |  ^~~~~~~
src/esphome/components/i2s_audio_xiao/i2s_audio_xiao.cpp: In member function 'virtual void esphome::i2s_audio_xiao::I2SAudioComponent::setup()':
src/esphome/components/i2s_audio_xiao/i2s_audio_xiao.cpp:15:24: error: 'I2S_NUM_MAX' was not declared in this scope; did you mean 'I2S_NUM_1'?
   15 |   if (next_port_num >= I2S_NUM_MAX) {
      |                        ^~~~~~~~~~~
      |                        I2S_NUM_1
*** [.pioenvs/esp32s3/src/esphome/components/i2s_audio_xiao/i2s_audio_xiao.cpp.o] Error 1
src/esphome/components/i2s_audio_xiao/speaker/i2s_audio_speaker.cpp: In static member function 'static void esphome::i2s_audio_xiao::I2SAudioSpeaker::player_task(void*)':
src/esphome/components/i2s_audio_xiao/speaker/i2s_audio_speaker.cpp:54:24: error: 'I2S_MCLK_MULTIPLE_DEFAULT' was not declared in this scope; did you mean 'I2S_MCLK_MULTIPLE_512'?
   54 |       .mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT,
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                        I2S_MCLK_MULTIPLE_512
*** [.pioenvs/esp32s3/src/esphome/components/i2s_audio_xiao/speaker/i2s_audio_speaker.cpp.o] Error 1
========================= [FAILED] Took 18.63 seconds =========================

Same issue here. Seems something has changed.

Hi there,
Granny LOL… and welcome here.
I’m thinking the BSP file is not compatible, try that if this is the latest or roll back to 3.0.5
:v:

HTH
GL :slight_smile: PJ :+1:

@PJ_Glasso can you explain what you mean by roll back to 3.0.5

Hi there,
Sure…
The BSP version , you may need the older one.
The Board Support package you compile with

HTH
GL :slight_smile: PJ :v:

Anyone know how to roll back the BSP in ESP Home inside home assistant. There is a version call out here but it only allows for dev, latest & recommended

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

I am confused if there is even an issue with esp32 section.
The error seems more likely from i2s_audio_xiao: component.

i2s_audio_xiao:
  i2s_lrclk_pin: GPIO7
  i2s_bclk_pin: GPIO8
  i2s_mclk_pin: GPIO9

I used this yaml file and it installed successfully with warnings

Rollback the esp-idf to the last major upgrade (4.4.8 instead of recommended) worked for me:

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: esp-idf
    version: 4.4.8
    platform_version: 5.4.0
4 Likes

Hi there,
Outstanding…

So a few months ago, Espressif Screwed us with the updates. PERIOD! :santa:

None of the old demo’s run, lots of Driver LIBs don’t work anymore WTFuzz Compiles on old stuff with C3 but not with the C6 and New BSP… Espressif I dislike you very much! I used to be a big fan go check muy other posts… :face_with_peeking_eye:
A new BSP every month C’mon man :face_with_hand_over_mouth:

seems I have to try 2 or 3 different ones before I get one that works…and of course the old ones don’t have the newer MCU’s. Why it breaks things is beyond me, they need a better process IMO. I really feel like it’s a protectionist attitude that is creeping into the industry that was built on OPENNESS and INCLUSIVITY. i.e use our IDE or else! Doesn’t seem fair they ride the back of 3 Party IDE to huge success, crank out different chips like cookies and then pull the rug with this 5.0 non-sense and lame ESP-IDF. under the guise of “depreciation” the only depreciation IMO is there regard for the buyers of this stuff.

As You were,

GL :slight_smile: PJ :v:

I’ve spent five hours wrangling with this issue today and just found this thread. Had no luck on GitHub either. Any chance you could explain HOW to roll back? I see that it might solve it but it would be good to see how to do it.

Thanks.

R

Hi there,

So without knowing your particular Dev environment, and the frustration in your vernacular.
MY Spoon is Here, :yum:

To rollback your ESP-IDF to version 4.4.8, you need to manually switch your local ESP-IDF git repository to the specific tag for that version using the git checkout command, essentially reverting your local ESP-IDF to the 4.4.8 release; ensure you back up your current project before making any changes as switching versions might require adjustments to your code.

Steps:

  1. Navigate to your ESP-IDF directory:

Code

    cd <path/to/your/esp-idf>
  1. Check out the 4.4.8 tag:

Code

    git fetch --tags
    git checkout v4.4.8

Important Considerations:

  • Backup your project:

Before switching versions, make a copy of your current project directory to avoid potential issues with code compatibility between different ESP-IDF versions.

  • Check for compatibility:

While minor updates within a major version usually maintain backward compatibility, large jumps between major versions might require code adjustments to ensure your project works correctly.

  • Update build system:

After switching to 4.4.8, you might need to clean your build directory and reconfigure your project using make menuconfig to ensure the build system is properly set up for the older version.

Alternative Method (Using ESP-IDF Installer on Windows):

  • Open the ESP-IDF Installer: If you are using the Windows ESP-IDF Installer, you can select the “Install” option and choose the 4.4.8 version to download and install a fresh copy of ESP-IDF. My prefered method. :saluting_face:

So now you know YMMV, so Maybe Spin up a virtual machine and just try it first? or go YOLO and Let us know :+1:

HTH
GL :slight_smile: PJ :v:

I’m so sorry about my grumpy response. I hadn’t eaten all day as I was fighting with this and it came out in my response. My apologies.

I just needed to put that piece of code in the YAML in ESPHome. Ironically, the GitHub guy posted the exact same response a few minutes later.

It compiled properly, I was able to download the file, and all seems well now.

Thank you again for your help, and once again my apologies for the hangry response! :blush:

1 Like