A2DP source, connection to two bt speaker

rob_bits
Posts: 3
Joined: Wed Jun 13, 2018 5:15 am

A2DP source, connection to two bt speaker

Postby rob_bits » Wed Jun 13, 2018 8:15 pm

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 */
esp_a2d_register_callback(&bt_app_a2d_cb);
esp_a2d_source_register_data_callback(bt_app_a2d_data_cb);
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?

Rob

rob_bits
Posts: 3
Joined: Wed Jun 13, 2018 5:15 am

Re: A2DP source, connection to two bt speaker

Postby rob_bits » Sat Jun 23, 2018 9:26 pm

In the mean time I opened an issue on github:
https://github.com/espressif/esp-idf/issues/2060

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://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=110679

So still any advice are welcomed!

Rob

WiFive
Posts: 1820
Joined: Tue Dec 01, 2015 7:35 am

Re: A2DP source, connection to two bt speaker

Postby WiFive » Sun Jun 24, 2018 3:08 am

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.

rob_bits
Posts: 3
Joined: Wed Jun 13, 2018 5:15 am

Re: A2DP source, connection to two bt speaker

Postby rob_bits » Sun Jun 24, 2018 7:05 am

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
    HAPPY USERs

But the implementation is not trully clear for me.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests