ESP32-S3 ADF Voip Example Port I2S1 Not Working for Microphone

newguy001
Posts: 3
Joined: Fri Dec 02, 2022 4:50 pm

ESP32-S3 ADF Voip Example Port I2S1 Not Working for Microphone

Postby newguy001 » Fri Dec 02, 2022 6:26 pm

AUDIO DEV BOARD: ESP32-S3-Korvo-2 V3.0
ESP IDF 4.4
I want to use I2S1 for VOIP Example here: https://github.com/espressif/esp-adf/bl ... voip_app.c

The only change I made in the example is as follows:

Code: voip_app.c Select all


.....
#define I2S1_CHANNELS I2S_CHANNEL_FMT_ONLY_LEFT
.....
int ret = i2s_write_expand(I2S_NUM_1, buf, len, 16, I2S_BITS, &bytes_write, wait_time);
......
i2s_driver_init(I2S_NUM_1, I2S1_CHANNELS, I2S_BITS);
.....
audio_player_int_tone_init(I2S_SAMPLE_RATE, I2S1_CHANNELS, I2S_BITS);
....
https://github.com/espressif/esp-adf/bl ... s_config.c

Code: board_pins_config.c Select all


.....
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) {
i2s_config->bck_io_num = -1;
i2s_config->ws_io_num = -1;
i2s_config->data_out_num = -1;
i2s_config->data_in_num = -1;
i2s_config->mck_io_num = -1;
} else if (port == I2S_NUM_1) {
i2s_config-> bck_io_num = GPIO_NUM_9;
i2s_config->ws_io_num = GPIO_NUM_45;
i2s_config->data_out_num = GPIO_NUM_8;
i2s_config->data_in_num = GPIO_NUM_10;
i2s_config->mck_io_num = GPIO_NUM_16;
} 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;
}
PROBLEM
The audio from speaker is working; however, the two microphones on the ESP32-S3-Korvo-2 V3.0, are not sending any voice i.e microphones stopped working.
When I revert back my changes to I2S0, everything is working.

Really need little guidance here!!!

Thanks

tempo.tian
Posts: 44
Joined: Wed Jun 22, 2022 12:10 pm

Re: ESP32-S3 ADF Voip Example Port I2S1 Not Working for Microphone

Postby tempo.tian » Tue Dec 06, 2022 5:06 am

Have you change the code below:
int ret = i2s_read(CODEC_ADC_I2S_PORT, buf, len, &bytes_read, wait_time);
changed to
int ret = i2s_read(1, buf, len, &bytes_read, wait_time);

For that record and playback use same I2S.

newguy001
Posts: 3
Joined: Fri Dec 02, 2022 4:50 pm

Re: ESP32-S3 ADF Voip Example Port I2S1 Not Working for Microphone

Postby newguy001 » Tue Dec 06, 2022 10:58 pm

Thanks a lot :D . Now both Mic and Speaker are working!

Who is online

Users browsing this forum: No registered users and 1 guest