ESP32-S3-Korvo-2 V3.0 es8311 无法播放声音

hexianren
Posts: 2
Joined: Sat Jan 27, 2024 9:27 am

ESP32-S3-Korvo-2 V3.0 es8311 无法播放声音

Postby hexianren » Sat Jan 27, 2024 9:39 am

我用 examples文件夹 i2s_es8311 在ESP32-S3-Korvo-2 V3.0开发板上播放没有声音,配置如下:。pipeline_http_select_decoder例子是可以播放的,哪位老师有时间帮忙看看哈

Code: Select all

/* I2C port and GPIOs */
#define I2C_NUM         (0)
#define I2C_SDA_IO      (GPIO_NUM_17)
#define I2C_SCL_IO      (GPIO_NUM_18)

/* I2S port and GPIOs */
#define I2S_NUM         (0)
#define I2S_MCK_IO      (GPIO_NUM_16)
#define I2S_BCK_IO      (GPIO_NUM_9)
#define I2S_WS_IO       (GPIO_NUM_45)
#define I2S_DO_IO       (GPIO_NUM_10)
#define I2S_DI_IO       (GPIO_NUM_8)

/* Example configurations */
#define EXAMPLE_RECV_BUF_SIZE   (2048)
#define EXAMPLE_SAMPLE_RATE     (16000)
#define EXAMPLE_MCLK_MULTIPLE   I2S_MCLK_MULTIPLE_256
#define EXAMPLE_VOICE_VOLUME    CONFIG_EXAMPLE_VOICE_VOLUME
#if CONFIG_EXAMPLE_MODE_ECHO
#define EXAMPLE_MIC_GAIN        CONFIG_EXAMPLE_MIC_GAIN
#endif


日志:
I (339) heap_init: Initializing. RAM available for dynamic allocation:
I (346) heap_init: At 3FC953D8 len 00054338 (336 KiB): D/IRAM
I (353) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DIRAM
I (360) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (366) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (373) spi_flash: detected chip: gd
I (376) spi_flash: flash io: dio
W (380) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (394) sleep: Configure to isolate all GPIO pins in sleep state
I (400) sleep: Enable automatic switching of GPIO sleep configuration
I (408) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (429) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=8
I (429) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=8
I (439) I2S: I2S0, MCLK output by GPIO16
I (459) ES8311: ES8311 in Slave mode and I2S format
I (10439) i2s_es8311: [music] i2s music played, 640000 bytes are written.
I (21409) i2s_es8311: [music] i2s music played, 640000 bytes are written.

ESP_William
Posts: 135
Joined: Tue Apr 24, 2018 5:54 am

Re: ESP32-S3-Korvo-2 V3.0 es8311 无法播放声音

Postby ESP_William » Mon Feb 05, 2024 3:04 am

您好, 代码中存在两个需要修改的地方.

1. 修改 I2S 的 data_in 和 data_out 配置

Code: Select all

/* I2S port and GPIOs */
#define I2S_NUM         (0)
#define I2S_MCK_IO      (GPIO_NUM_16)
#define I2S_BCK_IO      (GPIO_NUM_9)
#define I2S_WS_IO       (GPIO_NUM_45)
#define I2S_DO_IO       (GPIO_NUM_8)
#define I2S_DI_IO       (GPIO_NUM_10)
2. 在初始化 es8311 后, 使能 ESP32-S3-Korvo-2 开发板上的 PA
您可参考硬件设计: https://espressif-docs.readthedocs-host ... rvo-2.html
参考代码:

Code: Select all

gpio_config_t io_conf;
memset(&io_conf, 0, sizeof(io_conf));
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = BIT64(GPIO_NUM_48);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
gpio_config(&io_conf);
gpio_set_level(GPIO_NUM_48, 1);

Who is online

Users browsing this forum: No registered users and 9 guests