ssid_callback() search timeout and stop #678
-
Hi, I appreciate that you can search for A2DP sink devices using ssid_callback(), however where or how do you specify, or manage the search timeout, and how do you stop the scan? I would also like to know how to connect to a found device from the list it produces? thank you Alan |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Did you have a look at the example ? In the comment it tells you that you can just return true to select the device! |
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
I did read the comment, however I wish to build an I2S over A2DP bridge with I2C control to search, list devices, connect, disconnect, handle AVRCP pass through events, and control volume, so I will need an independent search function, and an independent connection function, since these won’t be managed in the same transaction if that makes sense.
For the moment I’m setting set_ssid_callback(nullptr) and then calling disconnect() and then separately calling start with a name I discovered using the callback function.
I just wondered if there was a better way to handle this?
I guess I could leave it searching forever, and then put an if statement in isValid() so that it returns true when a found device matches the name received over I2C which could work?
I cannot seen for the life of me to get your AudioPlayer streaming PCM to a sink device all on the single ESP32, the ESP simply enters a reboot loop when player.begin() is called, however if I comment out the A2DP source commands, then it will happily print my PCM data in HEX format all day long to serial debug, so I’ve decided to build a dual ESP32 PCB, and turn a standard ESP32-WROVER into a custom I2S A2DP bridge, and simply stream PCM to it from my “master” ESP32 which will run the AudioPlayer, and feature a TFT for use with LVGL etc.
Too many. Very quick response
Thanks
Alan
Sent from my iPhone
On 5 Mar 2025, at 16:45, Phil Schatzmann ***@***.***> wrote:
Did you have a look at the example<https://github.com/pschatzmann/ESP32-A2DP/blob/main/examples/bt_music_sender_ssid_callback/bt_music_sender_ssid_callback.ino> ? In the comment it tells you that you can just return true to select the device!
—
Reply to this email directly, view it on GitHub<#678 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AY5LBIFJHKHA2EN7F55NQBL2S4SZFAVCNFSM6AAAAABYMRQNBGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBQGQYDONQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
Yes my master ESP32 is an S3 with 8MB PSRAM, and 16MB flash built-in, and to be honest it works reasonably well.
The main priority is to overcome my code challenges as described in my previous email with regards to searching, and connecting to sink devices.
ESP32-WROVER I2S / A2DP source Bridge project.
Wi-Fi, Bluetooth and Helix seems impossible on a single ESP32-WROVER with PSRAM, or not, but saying that sending classic data from a PS3 controller to a HTTP UDP server seems to work fine.
Regards
Alan
…Sent from my iPhone
On 5 Mar 2025, at 17:12, Phil Schatzmann ***@***.***> wrote:
Be careful with your RAM: mp3 decoding in the Player, A2DP and TFT use a lot of RAM, so you will need to use an ESP32 variant that provides PSRAM and you need to activate it in the tools menu.
I suggest that you activate the memory logging.
—
Reply to this email directly, view it on GitHub<#678 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AY5LBID2NEZFSIQ3VHEHGQT2S4V6XAVCNFSM6AAAAABYMRQNBGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBQGQZTGOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
I have managed to get HTTP streaming, with Helix decoding sending PCM audio to a sink device, using your source method working, sort of.
It's still stuttering a lot, however considering what we are up against it's a major step forward.
Sent for your perusal.
I figured you are a more experienced coder than myself, given the complexity (judegment) of how you put your code together, and might be able to fix it better?
See attached.
Load it into a ESP32 with classic support, enable PSRAM, and update the WIFI credentials to your own to get started!
You may need this version of libhelix, since it's been set-up to make use of PSRAM.
GitHub - mkopa/libhelix-esp32-arduino: A MP3 and AAC Decoder using Helix for ESP32<https://github.com/mkopa/libhelix-esp32-arduino>
Let me know how you get on, however i am celebrating over here.
I have been trying for weeks to get this far, and i'm really chuffed with myself.
If and when you/I get it working, it could present in the README of your A2DP GitHub!
Regards
Alan
…________________________________
From: Phil Schatzmann ***@***.***>
Sent: 05 March 2025 17:12
To: pschatzmann/ESP32-A2DP ***@***.***>
Cc: alantrundle ***@***.***>; Author ***@***.***>
Subject: Re: [pschatzmann/ESP32-A2DP] ssid_callback() search timeout and stop (Discussion #678)
Be careful with your RAM: mp3 decoding in the Player, A2DP and TFT use a lot of RAM, so you will need to use an ESP32 variant that provides PSRAM and you need to activate it in the tools menu.
I suggest that you activate the memory logging.
—
Reply to this email directly, view it on GitHub<#678 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AY5LBID2NEZFSIQ3VHEHGQT2S4V6XAVCNFSM6AAAAABYMRQNBGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBQGQZTGOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
I used this specific version since it’s been modified to use PSRAM, as opposed to the internal DRAM, which in part did help with my boot loop issue.
I found some basic test code, outputting to serial, then added a buffer, then brought your library into the party, and quite literally this is the very first time I’ve managed to get anything like this to work.
By all means develop it further, get it running nice, if you have time that is.
It looks promising.
It is stuttering a fair bit. I tried to tweak the buffer given my knowledge, you would probably know better, which is why I sent it to you.
Potential game changer.
I’m not trying to patronise you at all, I’ve just spent a lot of time working on some code, and reaching out for some help.
Kind regards
Al.
…Sent from my iPhone
On 6 Mar 2025, at 15:08, Phil Schatzmann ***@***.***> wrote:
Hmm, I dont see any need for a separate libhelix<https://github.com/pschatzmann/arduino-libhelix?tab=readme-ov-file#memory-management>
—
Reply to this email directly, view it on GitHub<#678 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AY5LBIASJ3VVZYFBN5JMSST2TBQG7AVCNFSM6AAAAABYMRQNBGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBRGUZTEMY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Did you have a look at the example ? In the comment it tells you that you can just return true to select the device!