A2DP code for ESP32-PICO-DevKitM-2 in I2S slave mode @48KHz FS rate

prashant.anlg
Posts: 1
Joined: Wed Dec 04, 2024 6:59 pm

A2DP code for ESP32-PICO-DevKitM-2 in I2S slave mode @48KHz FS rate

Postby prashant.anlg » Wed Dec 04, 2024 8:03 pm

Hello ESP32 Forum,

I am new to ESP32 world, completely novice to bluetooth developement, so it would be very much helpful if anyone can point me to right resources/code to achieve below. Thanks a lot for going through below points:
1. I have ESP32-PICO-DevKitM-2 and want to run A2DP on it (audio streaming from mobile phone)
2. I ran the existing A2DP_SINK code from example folder and it is working fine for me. But configuration for this code is, ESP32 is I2S master, providing data at 44.1KHzx16-bit format
3. I want to change the ESP32 configuration to I2S slave, providing data at 48KHzx32-bit format (BCLK=3.072MHz)
4. As a first step, I kept I2S mode as Master node only and tried changing the 'sample_rate' to 48000 and 'I2S_DATA_BIT_WIDTH' to 32BIT. Now, the ESP32 can generate the BCLK=3.072M and Frame sync =48K, as expected. But the Data is not continuous: ~90ms gap at every 1 seconds.
5. Do I need to enable ASRC inside ESP32? I dont find any reference to ASRC inside ESP32 documentation.
6. Some threads suggests that we may need to change PLL settings to generate exact 48KHz. Can you please point to any specific code that does this?
7. Also, do I need to do this when configuring ESP32 device as I2S slave?

Also, i faced one more issue when trying point-1 and 2. In this case, I was able to stream the mobile audio perfectly fine. But when call came on mobile phone, the ESP32 device stopped giving data signal. BCLK and Frame sync were running fine, but there was no data driven by ESP32. Basically call voice was appearing on mobile phone only. I believe, this should also go over bluetooth to ESP32 device and ESP32 should drive call data. Do I need to change any setting to realize this?

Thanks a lot for any inputs,
Prashant
Attachments
Data_stopped_during_mobile_call.PNG
For second issue mentioned in description
Data_stopped_during_mobile_call.PNG (76.9 KiB) Viewed 471 times

Who is online

Users browsing this forum: MatthewRes and 94 guests