i2s connection between two ESP32 #149
-
I have a sender ESP32 generating a sine wave (from discussion #26) for testing the connection to a second ESP32:
The second ESP32 receives a distorted sine. What can be the cause? Settings in both ends are the same.
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 18 replies
-
Difficult to say: I am having these kind of effects if the log level is not set to warning, which does not apply in your case. |
Beta Was this translation helpful? Give feedback.
-
With a sample rate of 16000 there is still distortion, yet not so often but still too much. I set the use_apll on the receiver side. The sender is the master, the receiver is master=false. |
Beta Was this translation helpful? Give feedback.
-
The plot looks like one of the two ESP32 is dropping samples, most likely cause by buffer overrun. Also your observation that lowering the sample rate leads to less distortion could mean that one of your ESP32 does not have enough buffer space to store samples before you "collect" them in your sketch. I am not an expert on Arduino-audio-tools, but generally speaking it might help to increase the i2s buffer size, or increase number of buffers or adjust both parameters. Did you try this already? |
Beta Was this translation helpful? Give feedback.
-
I tried with config below, but still experiencing distortion. Can you give me any suggestions please?
Full code.
|
Beta Was this translation helpful? Give feedback.
-
I never tried this myself, so I don't know if this helps:
|
Beta Was this translation helpful? Give feedback.
-
I have this same setup at the moment as I thought it would be perfect to test the library out before buying I2S peripherals for my project. I'm using streams-generator-i2s.ino and streams-i2s-serial_16bit.ino I seem to be getting the same issues, although they don't seem to occur at regular intervals. On my two identical, brand new ESP32s, I am using the default I2S pin mappings. Did you find a solution, @yujonglee, @monojk? Thanks! |
Beta Was this translation helpful? Give feedback.
-
I came to the conclusion that the best way to transmit audio via wires, is to use the serial protocol together with a codec. |
Beta Was this translation helpful? Give feedback.
-
I have been troubleshooting this ESP32 to ESP32 via I2S problem a week now. I finally got a logic analyzer and think I have arrived at part of the problem. The BCLK seems to be sorta unstable. In this first picture you can see the clock is mostly at 1.42mhz... But in this second picture you can see every once in a while there is a 1.25mhz blip. It happens pretty frequently. I am using APLL. I upgraded to SDK 5.3.2 which helped quite a bit but its still not stable. I have some new ESP32 devkits coming directly from Espressif to see if maybe the older revision 0 and 1 or so chips have problems. I also see the 44.1mhz rate is not quite right ... see below - that one shows 44.05mhz and the next one shows 44.24mhz. I am not sure if this is because the BCLK is off or something else. I am going to try getting a better external clock to use to see if it helps. So far I have improved the audio 98% from what I had by just using the new SDK. I still have little crackles. I also tried an ESP32-S3 just simply outputting a clock signal - same thing. I can't seem to get an exact clock out of these things. |
Beta Was this translation helpful? Give feedback.
I came to the conclusion that the best way to transmit audio via wires, is to use the serial protocol together with a codec.