Page 1 of 1

Success building ESP-ADF with Audio command into Micropython?

Posted: Tue Aug 01, 2023 12:44 pm
by bschuhma
Hi all, new here...

I have a project where I need a relatively low cost Bluetooth BLE board with audio processing... I'd prefer not to use I2S, and the ESP32-A1S looked like a sure fit. I have micropython compiled onto it, but nowhere in the menuconfig did I get to choose which audio board I have. The build instructions at https://github.com/espressif/esp-adf/tr ... python_adf look to be about 3 years old and they mention a board selection file that doesn't exist anymore: ${ADF_PATH}/micropyton_adf/sdkconfig.adf

Has anyone had success building ESP-ADF with the 'audio' command into an ESP32-A1S and gotten audio out of the headphones? Is there a Howto on this somewhere? I've searched everywhere and pretty much keep coming back to the old instructions (above) on Github. In my searching I have seen some screenshots of running "idf.py menuconfig" that shows a HAL entry where you can pick which board you have, but I don't see that when I run menuconfig in my /Users/bret/personal/esp/esp-adf/micropython_adf/ports/esp32 directory.

FWIW, I've got esp-idf v5.1, esp-adf master branch. My ESP32-A1S seems to be the newer one with the ES8388 chip. The board has "ESP32 Audio Kit v2.2 A247" printed on it.

I'd be very grateful for someone to give me a shove in the right direction and/or correct any misconceptions I might have on this! :-) Would I have better luck/support with another chip - the ESP-WROOM-32 - perhaps? It doesn't have a headphone jack, but I might be able to add one.

Thanks,

Bret

Re: Success building ESP-ADF with Audio command into Micropython?

Posted: Fri Dec 13, 2024 3:40 pm
by jaxonplaxon
I'm revining this thread because I've finally found solution for the problem after many hours.

TL;DR: official instructions to install IDF+ADF+Micropython are bad. I'm sharing my steps that let me successfully build micropython ADF for esp32-lyraT-mini v1.2. The menuconfig now works fine, and board is able to play audio:

Follow the official instructions at: https://github.com/espressif/esp-adf/tr ... python_adf, but:
0. Do not remove fatfs file as instruction says (important)

1. Include ESP-ADF in the Cmakelists list in micropython/ports/esp32:
Put this somewhere at top:

cmake_minimum_required(VERSION 3.12)
include($ENV{ADF_PATH}/CMakeLists.txt)

2. Modify sdkconfig in \micropython\ports\esp32\build to enable cert bundle:

CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y

3. Modify file: \esp-adf\components\esp_peripherals\CMakeLists.txt:

Modify the part with "esp32" to remove sdcard.c sources like that:

IF (CONFIG_IDF_TARGET STREQUAL "esp32")
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./lib/sdcard ./lib/touch)
list(APPEND COMPONENT_SRCS ./periph_sdcard.c ./periph_touch.c ./lib/touch/touch.c)

4. Select your board using this command:
idf.py menuconfig -D MICROPY_BOARD_DIR=${ADF_PATH}/micropython_adf/boards/lyratmini -D USER_C_MODULES=${ADF_PATH}/micropython_adf/mod/micropython.cmake

5. Build from \micropython\ports\esp32\ using command with your board, example:
idf.py build -D MICROPY_BOARD_DIR=${ADF_PATH}/micropython_adf/boards/lyratmini -D USER_C_MODULES=${ADF_PATH}/micropython_adf/mod/micropython.cmake


At this point you should be able to load the official audio example from:
https://github.com/espressif/esp-adf/tr ... f/examples

They also need a little bit of tweaking - skip step 'import install_libs' and use this:

import mip

def install():
mip.install('urequests', target='/sdcard/lib')
mip.install('hmac', target='/sdcard/lib')

Then you can:
import audio_test
audio_test.run()

and it will work with single warning:
E (130300) AUDIO_HAL: audio_hal handle is null

Re: Success building ESP-ADF with Audio command into Micropython?

Posted: Fri Jan 03, 2025 6:25 pm
by telegreen
Hi! I'm glad I found this thread on the forum!
I used some of your instructions and my experience and
I managed to bulld MicroPython for ESP32-A1S AI-Thinker Audio kit v2.2 with ES8388 DAC

https://github.com/telegreen/ESP32-A1S- ... icropython


please ask questions if anyone is interested!

Re: Success building ESP-ADF with Audio command into Micropython?

Posted: Sun Aug 17, 2025 1:56 pm
by jpbianchi
Hi! I'm glad I found this thread on the forum!
I used some of your instructions and my experience and
I managed to bulld MicroPython for ESP32-A1S AI-Thinker Audio kit v2.2 with ES8388 DAC

https://github.com/telegreen/ESP32-A1S- ... icropython


please ask questions if anyone is interested!
Hi sir,
I am using the same board and having great difficuties with micropython because of lack of reference projects with this board.
Would you mind sharing your source code please?
Best regards

Re: Success building ESP-ADF with Audio command into Micropython?

Posted: Fri Oct 31, 2025 8:15 am
by dx11111
Thanks for posting this. Oct 2025, and I got this working with esp-idf v5.5, esp-adf off master from mid-August.
The instructions were accurate, but I needed add a few more settings to boards/sdkconfig.base
(Note that this ends up disabling streaming over https)

# For building with esp-adf, set up for esp32c3
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=n
CONFIG_ESP32_C3_LYRA_V2_BOARD=y