No output with example basic-a2dp-spdif.ino #1493
-
I'm trying to get the example file "basic-a2dp-spdif.ino" to work. Hardware: Environment: When compiling the example sketch without any changes, I get a compilation error: I have to swap lines 9 and 10 (include "AudioTools.h" before "BluetoothA2DPSink.h") to compile the file without errors. Uploading works just fine, but I get the follwing error message when running the program (changed to AudioLogger to Debug level to get the full output after I had no sound):
After connecting a device an starting playback, I get
I also tried using PlatformIO to get the example to work. I don't get compilation errors here, but the error message when running the program is the same. Any other example using SPDIF as output works fine. I also tried the "base-generator-a2dp.ino" to check if I had a general problem with A2DP and it works just as expected. Is there anything I'm missing in my approach? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 15 replies
-
I changed the output to analog (44.1kHz, stereo, 16 bit) and I get "something that sounds similar to what I'm playing". Sounds a bit as if there are samples missing. I have similar distortions with the generator-analog example so this might be related to my wiring. |
Beta Was this translation helpful? Give feedback.
-
With the latest version of A2DP, it is possible to define the output. #include "AudioTools.h"
#include "BluetoothA2DPSink.h"
AudioInfo info(44100, 2, 16);
SPDIFOutput spdif;
BluetoothA2DPSink a2dp_sink(spdif);
void setup() {
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Warning);
// setup output
auto cfg = spdif.defaultConfig();
cfg.copyFrom(info);
cfg.buffer_size = 384;
cfg.buffer_count = 30;
cfg.pin_data = 23;
spdif.begin(cfg);
// Start Bluetooth Audio Receiver
a2dp_sink.start("a2dp-spdif");
}
void loop() {
delay(100);
} |
Beta Was this translation helpful? Give feedback.
-
What is your ESP32 Core Version ? In Arduino go to Tools -> Boards -> Board Manager and type "ESP32" You will the see e.g. esp32 by Espressif version 2.0.11 The actual version is 2.0.15! |
Beta Was this translation helpful? Give feedback.
-
Then I tried activating PSRAM, here are the results ================================================================== ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) |
Beta Was this translation helpful? Give feedback.
-
You don't have enough RAM: try to reduce the cfg.buffer_count! |
Beta Was this translation helpful? Give feedback.
-
For me both buffer_count 30 and PSRAM active and not active is working. But I noticed that reducing the buffer_count gets overwritten by the default value of 30! |
Beta Was this translation helpful? Give feedback.
-
Yaa, it works 😁 This is the video when i tried it: |
Beta Was this translation helpful? Give feedback.
With the latest version of A2DP, it is possible to define the output.
Can you try the following