• Stars
    star
    110
  • Rank 315,149 (Top 7 %)
  • Language
    C
  • License
    Other
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ai-Thinker AudioKit Board SDK - 安信可 esp32-a1s 音频模组开发板

Ai-Thinker AudioKit Board SDK

EN | 中文

This framework is based on the second development of the ESPRESSIF audio framework esp-adf and follows the official open source agreement.

Overview

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

  • Music player or recorder supports audio formats such as MP3, AAC, FLAC, WAV, OGG, OPUS, AMR, TS, EQ, Downmixer, Sonic, ALC, G.711...
  • Play music from sources: HTTP, HLS(HTTP Live Streaming), SPIFFS, SDCARD, A2DP-Source, A2DP-Sink, HFP ...
  • Integrate Media services such as: DLNA, VoIP ...
  • Internet Radio
  • Voice recognition and integration with online services such as Alexa, DuerOS, ...

Developing with the ESP-ADF

Hardware

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-LyraT Development Board ESP32-LyraTD-MSC Development Board
ESP32 + ES8388 audio chip ESP32 + AC101 audio chip

Quick Start

Step 1. Set up ESP-IDF for Windows, Linux or Mac OS

please refer to the get-started-setup-esp-idf

Step 2. Get the ESP-ADF

git clone --recursive https://github.com/espressif/esp-adf.git

If you clone project without --recursive flag, please goto the esp-adf directory and run command git submodule update --init before doing anything.

Step 3. Set up Path to ESP-ADF

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-adf

You 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-adf

You 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_PATH

Step 4. Set up the environment variables

Before 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.bat

or with Windows PowerShell

.$HOME/esp/esp-idf/export.ps1

Linux and macOS

In the terminal where you have installed ESP-IDF, run:

. $HOME/esp/esp-idf/export.sh

Note 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 5. Adapter ESP-A1S Module

For ESP-A1S (ESP32 + ES8388 audio chips)
  • status: on sale
  • audio chips: ES8388

step 1 : alter the gpio connection ,path: esp-adf/components/audio_board/lyrat_v4_3/board_pins_config.c

  • sda_io: GPIO_33
  • scl_io: GPIO_32
  • bck_io: GPIO_NUM_27

the code as here:

esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config)
{
    AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
    if (port == I2C_NUM_0 || port == I2C_NUM_1) {
        i2c_config->sda_io_num = GPIO_NUM_33;
        i2c_config->scl_io_num = GPIO_NUM_32;
    } else {
        i2c_config->sda_io_num = -1;
        i2c_config->scl_io_num = -1;
        ESP_LOGE(TAG, "i2c port %d is not supported", port);
        return ESP_FAIL;
    }
    return ESP_OK;
}

esp_err_t get_i2s_pins(i2s_port_t port, i2s_pin_config_t *i2s_config)
{
    AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
    if (port == I2S_NUM_0 || port == I2S_NUM_1) {
        i2s_config->bck_io_num = GPIO_NUM_27;
        i2s_config->ws_io_num = GPIO_NUM_25;
        i2s_config->data_out_num = GPIO_NUM_26;
        i2s_config->data_in_num = GPIO_NUM_35;
    } else {
        memset(i2s_config, -1, sizeof(i2s_pin_config_t));
        ESP_LOGE(TAG, "i2s port %d is not supported", port);
        return ESP_FAIL;
    }
    return ESP_OK;
}

For ESP-A1S (ESP32 + AC101 audio chips)
  • status:halt production
  • audio chips: AC101

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
endif

step 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/ac101

laster , add the below code to edit the CMake file : components/audio_hal/CMakeLists.txt

 ./driver/es8388
 ./driver/es8388/es8388.c

![](static/add_ac101_cmake files.png)

Step 6. Start a Project

For ESP-A1S (ESP32 + ES8388 audio chips)

cd 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 monitor
For ESP-A1S (ESP32 + AC101 audio chips)

cd 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 monitor

Resources

More Repositories

1

GPRS_C_SDK

Ai-Thinker A9/A9G GPRS (with GPS(A9G)) module C development SDK
C
447
star
2

Telink_825X_SDK

Telink TLS825X 蓝牙芯片SDK
C
135
star
3

Telink_SIG_Mesh

Telink 蓝牙芯片SIG Mesh SDK,可对接天猫精灵,小爱同学等
C
84
star
4

Ai-Thinker-Open-WechatMini-ESP32-C3

开源一个微信小程序,支持蓝牙快速配网+WiFi双控制ESP32-C3模组应用示范。
JavaScript
74
star
5

Ai-Thinker-Open_ESP32-CAMERA_LAN

深圳市安信可科技有限中心-摄像头局域网解决方案
C
73
star
6

AiClouds3.0-Device

安信可 AiClouds3.0 架构- 设备端源码
C
37
star
7

WeChatAirkiss

一个基于微信airkiss配网的微信小程序
JavaScript
32
star
8

AiPi-Open-Kits

C
31
star
9

TBXX_Flash_Tool

安信可TB系列蓝牙模块烧录工具
Python
31
star
10

Ai-Thinker-WB2

C
29
star
11

GPRS-AT

Ai-Thinker A9 GPRS AT Module Related
26
star
12

Ai-Thinker-Open_ESP32-CAMERA_WAN

深圳市安信可科技有限公司-摄像头广域网解决方案
C
21
star
13

AiTBxxForWeChat

Ai-Thinker TB01/02 ble mesh module for WeChat Mini. 安信可蓝牙Mesh模组 Tb01/02的透传方案微信小程序端
JavaScript
20
star
14

Ai-Thinker-LoRaWAN-Ra-08

basic AiThinker Ra-08 ASR6601 SoC LoRaWAN Module 基于 ASR6601 安信可 Ra-08 LoRaWAN模组二次开发
C
20
star
15

AiThinker-Open-PB-BleMesh

安信可蓝牙模块 PB系列 SDK开源代码仓库
C
18
star
16

GPRS_C_SDK_DOC

doc of https://github.com/Ai-Thinker-Open/GPRS_C_SDK
Shell
17
star
17

Ai-Thinker-Open-qcloud-esp-wifi

安信可ESP8266模组-腾讯物联开发平台方案,支持微信连连小程序/smartconfig/绑定/控制;
C
17
star
18

Ai-Thinker-Open-TG7100C_SDK

安信可模组量产发布SDK
C
15
star
19

GPRS_CSDTK

toolchain and download debug tool for GPRS module
Ruby
11
star
20

Ai-Thinker-Open_WeChatMiniAP2Net

【安信可开源团队】微信小程序AP配网安信可WiFi模块加入路由器;
JavaScript
11
star
21

Ai-Thinker-Open_ESP32-S2-CAMERA_LAN

深圳市安信可科技有限中心-ESP32-S2模组-摄像头内置解决方案
C
10
star
22

AiPBxxForWeChat

Ai-Thinker PB-01/02 ble mesh module for WeChat Mini. 安信可蓝牙Mesh模组 PB-01/02的透传方案微信小程序端
JavaScript
10
star
23

AiTBxxForAndroid

【Android Code】Android APP Ble Control TB Board
Java
9
star
24

Ai-Thinker-Radar

C SDK for Ai-Thinker Radar Series Modules
C
9
star
25

WCMiniColorControl

在微信小程序上实现七彩圆环控制设备
JavaScript
9
star
26

Telink_Mesh

Telink 私有蓝牙Mesh
C
7
star
27

Ai-Thinker-Open-esp32-qcloud

安信可ESP32系列模组对接腾讯物联开发平台,支持 ESP32、ESP32S2、ESP32C3
C
7
star
28

Ai-Thinker-Open_ESP32-S2_SDK

深圳市安信可科技有限公司-ESP32-S2开发SDK
C
6
star
29

Ai-Thinker-Open_ESP32-A1S_ASR_SDK

C
5
star
30

Andestech

C++
4
star
31

Ai-Thinker-Open_ASR6501_LORAWAN_SDK

深圳市安信可科技有限公司-ASR6501 LORA解决方案SDK源码
C
3
star
32

Ai-Thinker-Open_RTL8710BX_ALIOS_SDK

深圳市安信可科技有限公司-阿里云飞燕&&天猫精灵对接代码
C
3
star
33

STM32F102_Rd-04

C
2
star
34

Ai-Thinker-Open_XR808_SDK

深圳市安信可科技有限公司-全志XR808开发SDK
C
2
star
35

aithinker_Ai-M6X_SDK

C
2
star
36

GPRS-C-SDK-LIB

lib for GPRS_C_SDK
2
star
37

Ai-Thinker-Open-PB-LLSyncSDK

安信可PB-02模组基于LLSync SDK蓝牙接入腾讯物联网
C
1
star