ESP32-audioI2S icon indicating copy to clipboard operation
ESP32-audioI2S copied to clipboard

PlatformIO + pioarduino + M5StickC Plus2: Cannot compile due to I2S v2 API incompatibility

Open pmolsen opened this issue 4 months ago • 2 comments

I’m using an M5StickC Plus2 and the M5Stack SPK2 Hat (I2S speaker). In the Arduino IDE, everything works perfectly using ESP32-audioI2S with Arduino core 3.x. Now I’m trying to use PlatformIO with pioarduino (ESP32 core 3.x fork) to get the same audio playback working.

❌ Problem Compilation fails due to:

error: 'i2s_chan_handle_t' does not name a type This comes from code that uses the new I2S v2 API (i2s_std_config_t, i2s_chan_handle_t, etc.).

This seems related to PlatformIO’s use of its own build system and lack of ESP-IDF header propagation or mismatched SDKs.

⚙️ My Setup PlatformIO platformio.ini: platform = https://github.com/pioarduino/platform-espressif32.git board = m5stick-c framework = arduino monitor_speed = 115200 lib_deps = https://github.com/m5stack/M5Unified.git#8b25496 https://github.com/m5stack/M5GFX.git#develop arduino-libraries/Arduino_BMI270_BMM150 paulstoffregen/Mahony adafruit/Adafruit Unified Sensor adafruit/Adafruit BusIO adafruit/Adafruit BMP280 Library arduino-libraries/WiFi schreibfaul1/ESP32-audioI2S m5stack/M5Unified 🔍 What I've Tried Works in Arduino IDE with Arduino core 3.0.0

Fails in PlatformIO (even with pioarduino)

Tried modifying library includes to manually pull in ESP-IDF 5 headers — no success Tried every other audio library I could find but all fail, both on espressif32 and pioarduino 💡 Feature Request Could you provide:

Either a backwards-compatible version using the I2S v1 API (e.g., i2s_config_t)

Or guidance for PlatformIO+pioarduino users to get this compiling?

Thank you for the great library and all your work!

pmolsen avatar Jun 19 '25 04:06 pmolsen