stuttering sound on esp32 wrover devboard with pcm51xx connected to it. #6
Replies: 3 comments 1 reply
-
Not sure what the issue is. I suggest that you use the opus decoder instead of wav. The time synchronization is only relevant when you want to play multiple devices at the same time... I am not using any wire functionality, so there should not be any conflict from my code. Just make sure that you call begin() and define the pins and frequency when you don't want to use the default settings. |
Beta Was this translation helpful? Give feedback.
-
NTP should not be necessary and I expect that it would not make any difference. If you have an external DAC from this list, no configuration is necessary. Which DAC do you have exactly? |
Beta Was this translation helpful? Give feedback.
-
I guess your issue might also be coming from the logging |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks so much for all the work in this project.
I've started out creating a platformio project in vscode, copying both the arduino-snapclient and arduino-audio-tools in the src folder of the project.
i simply copy the example from the arduino-snapclient and paste it into main.cpp, replacing cfg by config in this bit:
// setup I2S to define custom pins auto config = out.defaultConfig(); config.pin_bck = 14; config.pin_ws = 15; config.pin_data = 22; out.begin(config);
when compiling, the compiler complains the vector library is missing in the file src/api/SnapProtocol.h, so i add it:
#include <vector>
in Snapconfig.h i leave everything as is, but replace the wifi setup and server ip with the one in my setup. Also give the client a pretty name.
Everything compiles nicely.
I make sure to set my snapserver codec to pcm and try various bitrates, now set to 44100:16:2
i made the bridges on PCM51xx board: 1L, 2L, 3H, 4L and soldered the SCK BCK bridge and connected like:
PCM51xx ESP32
VIN 3.3V
GND GND
LCK 15
DIN 22
BCK 14
SCK GND (or unconnected does not seem to make a difference, due to the bridge i assume)
Everything connects and music comes trough when i play on my server, but the sound stutters.
I've tried changing buffer settings, bitrate (even to 8000:16:2), changing pin layouts, tried with an unsoldered PCM51xx, varying different parameters in Snapconfig.h (which i don't fully understand) and also tried with a wroom module (setting psram to false), but that almost is unfunctional.
I also tried adding either
//static SnapTimeSyncDynamic synch(50, 50); static SnapTimeSyncFixed synch(123, 1.0);
and adding
client.begin(synch);
but that doesn't make a difference
Also when i import the PCM51xx library from https://github.com/tommag/PCM51xx_Arduino/tree/master
and change the code to:
// start snap client client.begin(synch); if (bla.begin(PCM51xx::SAMPLE_RATE_44_1K, PCM51xx::BITS_PER_SAMPLE_16)) Serial.println("PCM51xx initialized successfully.");
i get a lot of:
[ 4311][E][Wire.cpp:422] beginTransmission(): could not acquire lock [ 4312][E][Wire.cpp:526] write(): NULL TX buffer pointer [ 4312][E][Wire.cpp:526] write(): NULL TX buffer pointer [ 4317][E][Wire.cpp:448] endTransmission(): NULL TX buffer pointer [ 4323][E][Wire.cpp:422] beginTransmission(): could not acquire lock [ 4329][E][Wire.cpp:526] write(): NULL TX buffer pointer [ 4334][E][Wire.cpp:526] write(): NULL TX buffer pointer [ 4339][E][Wire.cpp:448] endTransmission(): NULL TX buffer pointer [ 4345][E][Wire.cpp:422] beginTransmission(): could not acquire lock [ 4351][E][Wire.cpp:526] write(): NULL TX buffer pointer [ 4356][E][Wire.cpp:526] write(): NULL TX buffer pointer [ 4362][E][Wire.cpp:448] endTransmission(): NULL TX buffer pointer
any directives why the stutters happen?
When i compile the https://github.com/pschatzmann/ESP32-A2DP
everything works so fast and smooth it's almost scary.
ps: i can't wrap my head around:
`#ifndef CONFIG_PROCESSING_TIME_MS
define CONFIG_PROCESSING_TIME_MS 172
#endif
#ifndef CONFIG_STREAMIN_DECODER_BUFFER
define CONFIG_STREAMIN_DECODER_BUFFER (12 * 1024)`
What does the 172 do? Also, why is 1024 multiplied by 12?
and lastly:
`#ifndef CONFIG_SNAPCAST_BUFF_LEN
define CONFIG_SNAPCAST_BUFF_LEN 1024`
should 1024 be 1000 if my snapserver buffer length is 1000?
thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions