Description
Board
ESP32 CHIP
Device Description
ESP32 One : https://www.waveshare.com/wiki/ESP32_One
Hardware Configuration
OV2460 Camera with SD Card reader, Classic BT and TLS enabled
Version
latest master (checkout manually)
IDE Name
ESP-IDF v5.3
Operating System
Windows 11
Flash frequency
40 Mhz
PSRAM enabled
yes
Upload speed
115200
Description
I am currently using an A2DP library : https://github.com/pschatzmann/arduino-audio-tools
This library need arduino-eps32 to run some of it's program and also i had initially written my code on Arduino IDE and then migrated to ESP-IDF.
I went through this related issue with the same error : #3436
This has put me in doubt that if the issue above is solved in the latest version of esp-idf , if not , there is a workaround provided in the issue but I am not sure how to use it in my case.
Sketch
#define HELIX_LOGGING_ACTIVE false
#include "AudioTools.h"
#include "AudioTools/AudioLibs/A2DPStream.h"
#include "AudioTools/AudioLibs/AudioSourceSDFAT.h"
#include "AudioTools/AudioCodecs/CodecMP3Helix.h"
const char *startFilePath="/music/";
const char* ext="mp3";
AudioSourceSDFAT source(startFilePath, ext, 15);
A2DPStream out;
MP3DecoderHelix decoder;
AudioPlayer player(source, out, decoder);
void setup() {
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Warning);
// setup player
// Setting up SPI if necessary with the right SD pins by calling
SPI.begin(14, 12, 13, 15);
player.setVolume(0.8);
player.begin();
// setup output - We send the test signal via A2DP - so we conect to a Bluetooth Speaker
auto cfg = out.defaultConfig(TX_MODE);
cfg.silence_on_nodata = true; // prevent disconnect when there is no audio data
cfg.name = "CLIP 5"; // set the device here. Otherwise the first available device is used for output
//cfg.auto_reconnect = true; // if this is use we just quickly connect to the last device ignoring cfg.name
out.begin(cfg);
}
void loop() {
player.copy();
}
Debug Message
Please go through this issue I created in : https://github.com/pschatzmann/arduino-audio-tools/issues/1977
Other Steps to Reproduce
Pleas apply this configuration: https://github.com/pschatzmann/ESP32-A2DP/wiki/Espressif-IDF-as-a-Component
and it should lead you to the error i am stuck with.
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Activity
me-no-dev commentedon Mar 26, 2025
is
btStart();
called from within that AudioTools library?me-no-dev commentedon Mar 26, 2025
I see it being called here: https://github.com/pschatzmann/ESP32-A2DP/blob/8b29acb85bf5edeb321c2c0cd234a29661eb4f45/src/BluetoothA2DPCommon.cpp#L400
Does the sketch work in Arduino IDE?
Admsher commentedon Mar 26, 2025
Yes it works on Arduino IDE
Jason2866 commentedon Mar 26, 2025
@Admsher Does PR #11167 solve the issue?
Admsher commentedon Mar 26, 2025
Nope still the same error. If I am correct we only remove the duplicate call from esp32-hal-bt.c ?
Jason2866 commentedon Mar 26, 2025
No it removes the weak trickery. It solved the issue for this example https://github.com/pioarduino/test-rainmaker/tree/wifiprov
Jason2866 commentedon Mar 26, 2025
btw. latest Arduino master needs IDF 5.4!
Admsher commentedon Mar 26, 2025
I see , I was under the impression that IDF version > 5.3 should suffice, will check for the same
Jason2866 commentedon Mar 26, 2025
Checked with your code (commented the SD part...) and my PR. Sample code is here https://github.com/Jason2866/audio-tools-test/tree/issue11181
Seems BT part is okay (at least it is doing "something")
Admsher commentedon Mar 27, 2025
That is quite strange, so is the SD part causing a bluetooth issue?
Jason2866 commentedon Mar 27, 2025
No, everything is working. Don't have a board with a SD Card for testing. SD Card code needs to be commented for avoiding errors stopping at this code part without a connected SD Card.
Admsher commentedon Mar 27, 2025
Sorry for my previous comment, this commit indeed works and weak attributes seem to be the problem. Closing this issue as resolved.
Jason2866 commentedon Mar 29, 2025
@me-no-dev The issue is not fixed.
me-no-dev commentedon Mar 29, 2025
Closed because "Closing this issue as resolved." was stated. I do know we still need to fix this for component and pioarduino
Jason2866 commentedon Apr 7, 2025
Fix for Platformio/pioarduino is to add
lib_archive = no
to platformio.iniCompile Arduino as an component of IDF still fails.