APLL is occupied when using i2s in esp-idf 5.0

TibiToz
Posts: 7
Joined: Mon Aug 10, 2020 1:46 pm

APLL is occupied when using i2s in esp-idf 5.0

Postby TibiToz » Mon Jan 16, 2023 8:28 am

Hi, i'm trying to update my project from esp-idf 4.3 to esp-idf 5.0 and i'm struggling with the i2s drivers and more precisely with the APLL. In 4.3 we had to use apll to avoid clicks in audio signal. I read the documentation and it seems that the APLL can be used by other drivers and we need to ensure that the APLL is not occupied when use in i2s driver. I got the confirmation when i try to run my code with APLL enable : " APLL is occupied already, it is working at 49151992 Hz while the expected frequency is 49152000 Hz".

I am not able to find any information on other driver's use of APLL and how to "free" the APLL for the i2s driver.

Thank you for your time,

Tibi

VladimirG
Posts: 3
Joined: Thu Mar 23, 2023 9:06 am

Re: APLL is occupied when using i2s in esp-idf 5.0

Postby VladimirG » Thu Mar 23, 2023 9:13 am

It`is ok, i assume.
Then you init 2 channels Rx and Tx, second initiated channel give you this message because first is already used APLL.

ESP-Kevin
Posts: 9
Joined: Fri Jul 01, 2022 6:10 am

Re: APLL is occupied when using i2s in esp-idf 5.0

Postby ESP-Kevin » Mon Mar 27, 2023 11:08 am

Yes, If you're using two channels under same sampling rate, just ignore this warning.

But if you're using two I2S ports with different sampling rate, the driver can still possible to make it work in this case, but you need to take care:

1. Allocate the I2S port which has higher frequency first, because the lock of APLL frequency will be held by the first peripheral that initialize the APLL, the following peripherals can't change the frequency unless all the occupants release the lock.
2. The following peripherals have to try to divide from the fixed APLL frequency which has been set by the first one, therefore, if the following peripherals can still get an appropriate frequency under this condition, it can still work, otherwise it will fail with error. So if you only see the warning instead of an error, don't worry, it's fine.

FYI, on ESP32, the driver that might occupy the APLL are: Ethernet, I2S (including ADC, DAC, LCD-i80)

Who is online

Users browsing this forum: No registered users and 207 guests