espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
12.99k stars 7.12k forks source link

ESP32-S3 - I2S during Light Sleep (IDFGH-11660) #12773

Open timsterc opened 7 months ago

timsterc commented 7 months ago

Answers checklist.

General issue report

Hi,

I have an application where I am recording from stereo PDM microphones for a short duration (~10sec) then storing this on an SD card, along with values from some environmental sensors.

Everything is working nicely, but I'd like to improve the power performance for instances where the device is running on battery power.

Most of the time in the app is spent waiting on the blocking i2s_channel_read function to return when the data is available in the DMA buffer. I'd love to use light sleep if it's an option.

I've read through the datasheets, but for the life of me can't tell whether both the I2S and DMA peripherals will remain active during light sleep, and if so, how to properly configure them so that they aren't clock gated.

Any insight would be greatly appreciated!

Thanks! -Tim

timsterc commented 5 months ago

@L-KAYA Any thoughts?

SanZamoyski commented 3 months ago

Any update here?

L-KAYA commented 1 month ago

@timsterc @SanZamoyski Oh I'm so sorry for missing your question, and unfortunately, I2S can't work during the light sleep.

Generally, only LP peripherals are supported to run during the sleep (i.e., support to clocked by RTC clock source), currently I2S doesn't have such a LP peripheral (LP_I2S) except ESP32-P4.

If you want to save power consumption, maybe you can try to set FREERTOS_USE_TICKLESS_IDLE and PM_ENABLE in the menu config. So that you system will go into light sleep during the IDLE task and I2S will only prevent the light sleep when APB bus is under using. Hope it can help.

Thanks!

SanZamoyski commented 1 month ago

Thank You.