Page 1 of 1

A2DP source, connection to two bt speaker

Posted: Wed Jun 13, 2018 8:15 pm
by rob_bits
Hello all,

I am interesting in the functionality of stream data at the same time to multiple A2DP SINK devices. More precisely I want to stream audio from ESP32 to two bluetooth speaker. Is it possible with the current esp-idf?

Could be the A2DP_source example code modified to work with two sink devices?

I went through the current source example and I think it can be modificated to discover multiple devices and connect to them, but will it work in the end?

Can be the esp_a2d_source_connect() function called if we already connected to one sink device? Will the previous connection maintained?

If we can connect multiple sink devices already then what about the following code (in /a2dp_source/main/main.c line 277 - 280):

/* initialize A2DP source */
What will be the role of the data callback function? Will it stream the data to both of the connected device? Or how can we handle which data goes where?


Re: A2DP source, connection to two bt speaker

Posted: Sat Jun 23, 2018 9:26 pm
by rob_bits
In the mean time I opened an issue on github:

I started the development of this feature. My goal is just to reach a proof-of-concept and it would answer for me can the esp32 be used in a product which aimed on this functionality. I do not want a final, very good quality result just I have to know is this possible or not.

There is the following whitepaper which gives me motivation:
Https:// ... _id=110679

So still any advice are welcomed!


Re: A2DP source, connection to two bt speaker

Posted: Sun Jun 24, 2018 3:08 am
by WiFive
Slightly off topic, but how does UE PartyUp mode work? They can direct multiple speakers to listen to the same single stream from the src? Essentially telling the additional speakers to passively clone (eavesdrop) the connection of the primary sink? Obviously this requires specialized software in the sink side but is interesting.

Re: A2DP source, connection to two bt speaker

Posted: Sun Jun 24, 2018 7:05 am
by rob_bits
This UE PartyUp application looks interesting for me but I do not know how it work. What I want is almost the same just only stream music to two sinks. But in the attached whitepaper it is written the source could be work in a multi-streamer and the connected sinks would not notice anything from this. So the sinks would not need a special software.

In this study there are use cases how should a source device act if the user wants to connect two sink audio device. One of the scenario follows the next steps:
  • AVDTP & AVCTP Connection establish with Sink device 1
    A2DP SEP Disc/Selec with Sink device 1
    SET_CONFIG for Sink device 1
    OPEN connection with Sink device 1
    START meadia Sink device 1 (ESP_A2D_MEDIA_CTRL_START)
    STREAM Media to Sink device 1
    ---- new device connection----
    GAP/ACL Connect to Sink device 2
    AVDTP Establish, SEP Disc/Select with Sink device 2
    Suspend media to Sink device 1 (ESP_A2D_MEDIA_CTRL_SUSPEND)
    SET_CONFIG to Sink device 2
    OPEN connection with Sink device 2
    START Media on Sink device 2 (ESP_A2D_MEDIA_CTRL_START)
    STREAM Media to Sink device 1
    STREAM Media to Sink device 2
But the implementation is not trully clear for me.