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:
  1. .....
  2. #define I2S1_CHANNELS       I2S_CHANNEL_FMT_ONLY_LEFT
  3. .....
  4. int ret = i2s_write_expand(I2S_NUM_1, buf, len, 16, I2S_BITS, &bytes_write, wait_time);
  5. ......
  6. i2s_driver_init(I2S_NUM_1, I2S1_CHANNELS, I2S_BITS);
  7. .....
  8.  audio_player_int_tone_init(I2S_SAMPLE_RATE, I2S1_CHANNELS, I2S_BITS);
  9. ....
https://github.com/espressif/esp-adf/bl ... s_config.c
  1. .....
  2. esp_err_t get_i2s_pins(i2s_port_t port, i2s_pin_config_t *i2s_config)
  3. {
  4.     AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
  5.     if (port == I2S_NUM_0) {
  6.         i2s_config->bck_io_num = -1;
  7.         i2s_config->ws_io_num = -1;
  8.         i2s_config->data_out_num = -1;
  9.         i2s_config->data_in_num = -1;
  10.         i2s_config->mck_io_num = -1;
  11.     } else if (port == I2S_NUM_1) {
  12.         i2s_config-> bck_io_num = GPIO_NUM_9;
  13.         i2s_config->ws_io_num = GPIO_NUM_45;
  14.         i2s_config->data_out_num = GPIO_NUM_8;
  15.         i2s_config->data_in_num = GPIO_NUM_10;
  16.         i2s_config->mck_io_num = GPIO_NUM_16;
  17.     } else {
  18.         memset(i2s_config, -1, sizeof(i2s_pin_config_t));
  19.         ESP_LOGE(TAG, "i2s port %d is not supported", port);
  20.         return ESP_FAIL;
  21.     }
  22.  
  23.     return ESP_OK;
  24. }
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: 40
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 27 guests