Ai-Thinker AudioKit Board SDK - 安信可 esp32-a1s 音频模组开发板
EN | 中文
This framework is based on the second development of the ESPRESSIF audio framework esp-adf and follows the official open source agreement.
The framework is also suitable for the company's official development board such as esp-lyart, which also easily adds functions in the most comprehensive way, from simple to complex development of audio applications
AI Thinker boards V2.2 974 are using A1S designs where the AC101 was replaced by the ES8388 , including:
| ESP32-A1S-Kit ES8388 Development Board(undersides) | ESP32-A1S-Kit AC101 Development Board(undersides) |
|---|---|
| ESP32 + ES8388 audio chip | ESP32 + AC101 audio chip |
please refer to the get-started-setup-esp-idf
git clone --recursive https://github.com/espressif/esp-adf.gitIf you clone project without --recursive flag, please goto the esp-adf directory and run command git submodule update --init before doing anything.
The toolchain programs access ESP-ADF using ADF_PATH environment variable. This variable should be set up on your PC, otherwise the projects will not build.
Windows
Open Command Prompt and run the following command::
set ADF_PATH=%userprofile%\esp\esp-adfYou need to enter this command each time you start your PC. To avoid retyping you can add it to "ESP-IDF Command Prompt", batch or Power Shell scripts described in Step 4 below.
To make sure that ADF_PATH has been set up properly, run:
echo %ADF_PATH%It should return the path to your ESP-ADF directory.
Linux and macOS
Open Terminal, and run the following commands::
export ADF_PATH=~/esp/esp-adfYou need to enter this command each time you open a Terminal. To make this setting permanent follow similar instructions for configuration of IDF_PATH in ESP-IDF Programming Guide.
Check if ADF_PATH has been set up to point to directory with ESP-ADF::
printenv ADF_PATHBefore being able to compile ESP-ADF projects, on each new session, ESP-IDF tools should be added to the PATH environment variable. To make the tools usable from the command line, some environment variables must be set. ESP-IDF provides a script which does that.
Windows
ESP-IDF Tools Installer for Windows creates an "ESP-IDF Command Prompt" shortcut in the Start Menu. This shortcut opens the Command Prompt and sets up all the required environment variables. You can open this shortcut and proceed to the next step.
Alternatively, if you want to use ESP-IDF in an existing Command Prompt window, you can run:
%userprofile%\esp\esp-idf\export.bator with Windows PowerShell
.$HOME/esp/esp-idf/export.ps1Linux and macOS
In the terminal where you have installed ESP-IDF, run:
. $HOME/esp/esp-idf/export.shNote the space between the leading dot and the path!
You can also create an alias for the export script to your .profile or .bash_profile script. This way you can set up the environment in a new terminal window by typing get_idf:
alias get_idf='. $HOME/esp/esp-idf/export.sh'Note that it is not recommended to source export.sh from the profile script directly. Doing so activates IDF virtual environment in every terminal session (even in those where IDF is not needed), defeating the purpose of the virtual environment and likely affecting other software.
step 1 : alter the gpio connection ,path: esp-adf/components/audio_board/lyrat_v4_3/board_pins_config.c
the code as here:
…step 1 : edit the component file to add the AI Thinker Board to ESP-ADF : components/audio_board/component.mk
ifdef CONFIG_ESP_AI_THINKER_V2_2_BOARD
COMPONENT_ADD_INCLUDEDIRS += ./ai_thinker_audio_kit_v2_2
COMPONENT_SRCDIRS += ./ai_thinker_audio_kit_v2_2
endifstep 2 : add the AI Thinker Board include files to ESP-ADF , add the code form the file ai_thinker_audio_kit_v2_2:
and add the below code to edit the config file : components/audio_board/CMakeLists.txt
if (CONFIG_ESP_AI_THINKER_V2_2_BOARD)
message(STATUS "Current board name is " CONFIG_ESP_AI_THINKER_V2_2_BOARD)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./ai_thinker_audio_kit_v2_2)
set(COMPONENT_SRCS
./ai_thinker_audio_kit_v2_2/board.c
./ai_thinker_audio_kit_v2_2/board_pins_config.c
)
endif()laster , add the below code to edit the default config : components/audio_board/Kconfig.projbuild
choice AUDIO_BOARD
prompt "Audio board"
default ESP_AI_THINKER_V2_2_BOARD
help
Select an audio board to use with the ESP-ADF
···
···
config ESP_AI_THINKER_V2_2_BOARD
bool "ESP32-AiThinker-audio V2.2"step 3 : add the AI Thinker Board AC101 driver files to ESP-ADF , add the code form the file ac101:
and add the below code to edit the default config : components/audio_hal/component.mk
COMPONENT_ADD_INCLUDEDIRS += ./driver/ac101
COMPONENT_SRCDIRS += ./driver/ac101laster , add the below code to edit the CMake file : components/audio_hal/CMakeLists.txt
./driver/es8388
./driver/es8388/es8388.ccd examples/player/pipeline_bt_source , run idf.py menuconfig --- Audio Hal , select ESP32-Lyrat V4.3
Flash the binaries that you just built onto your board by running :
idf.py -p PORT [-b BAUD] flash monitorcd examples/player/pipeline_bt_source , run idf.py menuconfig --- Audio Hal , select ESP_AI_THINKER_V2_2_BOARD
Flash the binaries that you just built onto your board by running :
idf.py -p PORT [-b BAUD] flash monitorNo open issues yet, or sync has not completed.