Four plus channels of audio recording with I2S

cblondon
Posts: 3
Joined: Sun Dec 08, 2019 7:03 pm

Four plus channels of audio recording with I2S

Postby cblondon » Sun Dec 08, 2019 7:14 pm

Hi all,

I've been working with a pair of INMP441 MEMS microphones, and the ESP32 has no problem capturing audio from them, and subsequently writing that to an SD card. My current program uses a single I2S channel to capture the data from the two mics, sampling at 44.1 kHz, 16 bits per sample.

My question is whether it is possible to capture more channels of audio than just two, and if so how I might go about doing that. I do understand that there is a second I2S channel on the ESP32, but that it cannot be operated for audio capture while the other channel is being used. If that's incorrect please advise!

Best,

CB

ESP_Sprite
Posts: 3746
Joined: Thu Nov 26, 2015 4:08 am

Re: Four plus channels of audio recording with I2S

Postby ESP_Sprite » Mon Dec 09, 2019 2:16 am

As far as I know, there's no reason you can't use it, but there's only one audio PLL, so you likely can't use it to record a stream on a random sample rate. Not sure how the driver implements it, but I'd guess you should be fine if you use a sample rate derived from the main PLL, or the same sample rate as the other I2S channel.

cblondon
Posts: 3
Joined: Sun Dec 08, 2019 7:03 pm

Re: Four plus channels of audio recording with I2S

Postby cblondon » Mon Dec 09, 2019 11:39 am

ESP_Sprite wrote:
Mon Dec 09, 2019 2:16 am
As far as I know, there's no reason you can't use it, but there's only one audio PLL, so you likely can't use it to record a stream on a random sample rate. Not sure how the driver implements it, but I'd guess you should be fine if you use a sample rate derived from the main PLL, or the same sample rate as the other I2S channel.

Thanks for your response. The reason I thought that it could not be done that way is from reading this doc:

https://docs.espressif.com/projects/esp ... s/i2s.html

...which states that for the Function: esp_err_ti2s_set_pin(i2s_port_ti2s_num, consti2s_pin_config_t*pin)
The I2S peripheral output signals can be connected to multiple GPIO pads. However, the I2S peripheral input signal can only be connected to one GPIO pad.

From this, it would seem that it is not possible to read from both I2S peripherals simultaneously.

Am I reading that incorrectly?

ESP_Sprite
Posts: 3746
Joined: Thu Nov 26, 2015 4:08 am

Re: Four plus channels of audio recording with I2S

Postby ESP_Sprite » Tue Dec 10, 2019 3:31 am

'the' is a bit misleading here (probably something to do with Chinese not having articles) but it is per I2S peripheral. If you have two I2S peripherals, you can assign an unique GPIO to either, totalling 2 I2S inputs. The idea behind the line is that you can use the GPIO matrix to route an I2S output to go to a bunch of pins in parallel, but you cannot do the same with input pins.

cblondon
Posts: 3
Joined: Sun Dec 08, 2019 7:03 pm

Re: Four plus channels of audio recording with I2S

Postby cblondon » Tue Dec 10, 2019 9:18 am

Thanks for that very helpful clarification. I'll give it a try!

temponit
Posts: 3
Joined: Mon Jan 13, 2020 9:20 am

Re: Four plus channels of audio recording with I2S

Postby temponit » Mon Jan 13, 2020 11:41 am

Sorry, I don’t quite understand what the program code will look like allowing you to simultaneously record more than 2 ADC channels while using 2 I2S.
I mean in the i2s_adc_dac example one ADC channel is recorded using one I2S.. Is there any ability to simultaneously ascque 3-4 adc channels with high (20-50K) sps per channel ?

temponit
Posts: 3
Joined: Mon Jan 13, 2020 9:20 am

Re: Four plus channels of audio recording with I2S

Postby temponit » Tue Jan 14, 2020 3:07 am

Some search gives that esp32_technical_reference_manual says:
Multiple-channel scanning mode; there is a pattern table that defines the measurement rule for each SAR
ADC. The scanning mode can be configured as a single mode, double mode, or alternate mode.


But API for pattern table has a lot of issues and not documented in IDF... The question is when is it planned to add pattern table functionality to the IDF API and docs?

Who is online

Users browsing this forum: No registered users and 13 guests