2 Channel audio / Stereo audio Not working? #1836
-
TL;DR: Stereo doesnt work and I dont know how to enable it. I'm trying to send stereo audio wirelessly between two ESP32s via ESP-NOW, but I can't seem to get stereo to work. When i increase the number of channels to 2, the audio gets crunchy, and gets extremely slowed down. I'm guessing the problem is a mono-stereo mismatch, something inverse to this discussion: #1178 I'm assuming the esp32 currently can't read stereo at all, since when I run the example "streams_i2c_serial" and monitor the output via the serial plotter, I get only 1 audio signal. I get 4 signals, 1 responds correctly to the input audio signal, but the other 3 are stuck at 1024. (I don't know if the other 3 values are some read/status/log announcement values that the serial plotter automatically picked up as data values. Anyways,I still find it weird that I only have 1 audio signal even in stereo mode.) I feel like I have to enable stereo mode somewhere, But I can't seem to find it. Hardware(Input/TX) The serial example is also run here.
(Output/RX)
SoftwarePlease note that i have tried playing with sample frequency, bit depth, buffer no and size, channels, and all that jazz. nothing seemed to work. Semi-Modified Example code:
TX Code:
RX Code:
Also, Here is a sliver of the log in debug mode. I can't seem to find any useful info for me.
This is all the log parts that I could find. maybe there's more within the flood of data, but i couldn't find any. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Changing to stereo is as simple as defining the channels as 2 instead of 1: You will need to do this on the sending and receiving side! But be careful this doubles the amount of data to be transmitted in the same time: Try to measure first how many samples (or bytes you can transmit per second) with a MeasuringStream and from there calculate the max sample rate that you can use! You can try to optimize the values of the ESP-Now configuration (e.g. the rate) Using a codec will reduce the amount of transmitted data. |
Beta Was this translation helpful? Give feedback.
Changing to stereo is as simple as defining the channels as 2 instead of 1: You will need to do this on the sending and receiving side!
But be careful this doubles the amount of data to be transmitted in the same time: Try to measure first how many samples (or bytes you can transmit per second) with a MeasuringStream and from there calculate the max sample rate that you can use!
You can try to optimize the values of the ESP-Now configuration (e.g. the rate)
Using a codec will reduce the amount of transmitted data.