ESP-32 I2S Audio Data Glitch
ESP-32 I2S Audio Data Glitch
I am randomly getting audio data glitches during initial playback of audio. It appears to be "random". Sometimes it doesn't occur, sometimes it does. I can't figure out why this is happening. I'm not getting any errors reported via the serial debug interface. Any suggestions? After about the first 1 second of playing audio, the glitches don't appear to happen. It's only on playback start. Attached is a scope image of the I2S bus and the audio output. Channel 1 is LRCLK, Channel 2 is BCLK, Channel 3 is Data, and Channel 4 is the audio output from my codec device. Any suggestions would be appreciated. Thanks.
- Attachments
-
- tek00024.png (64.59 KiB) Viewed 5321 times
-
- tek00026.png (83.77 KiB) Viewed 5321 times
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-32 I2S Audio Data Glitch
Can you share your code?
Re: ESP-32 I2S Audio Data Glitch
I can't send code onto the forum per my company's privacy policies. This issue appears when building with IDF Version 4.0 with VisualGDB GUI on Windows 10. Today I installed "master" (ESP-IDF v4.2-dev-459-ge36516372-dirty) version of IDF onto my Linux machine and found that I now only have a small glitch during the first 140msec of audio playback after an A2DP suspend has occurred. This is using testing with the IDF audio sink example. I changed my IDF version back to 4.0 and 4.1 on the Linux machine using the same example, and appear to have much more glitching at the start of playback and randomly during play.
FYI - I added ".use_apll = true" and ".fixed_mclk = 0" to the I2S configuration setup in the example in order to get the I2S frequency to be within 0.1Hz of 44100Hz. Without this modification the frequency is way off. I have made this modification with all my previous testing of different IDF versions as well.
FYI - I added ".use_apll = true" and ".fixed_mclk = 0" to the I2S configuration setup in the example in order to get the I2S frequency to be within 0.1Hz of 44100Hz. Without this modification the frequency is way off. I have made this modification with all my previous testing of different IDF versions as well.
Re: ESP-32 I2S Audio Data Glitch
I was incorrect. The I2S glitching still occurs whenever you resume audio playback after A2DP has been suspended (takes about 4 seconds to suspend after pausing audio when using Android device and about 1 minute to suspend when using IOS device). I have tried numerous things to fix this issue for the past 2 weeks. This is our first product development using the Espressif part. I would like to use this part, but if I can't get rid of the noise issue, I may need to find another vendor (Cypress, TI, Silabs...) for a replacement. My best guess is that on resuming an A2DP connection, the handling of the connection is causing dropped A2DP audio packets which in turn causes "noise" on the speaker. Once the connection is up and running, the noise appears to be gone. This appears when using the A2DP sink demo with V4.0 and with latest "master" IDF versions. I have also tested with a few different Esspressif evaluation boards (devkitC, Lyrat,...).
Regards,
Mike
Regards,
Mike
Who is online
Users browsing this forum: KMTsvetanov and 100 guests