A2DP Source Example - SDP connection error

User avatar
ayan4m1
Posts: 5
Joined: Sun Dec 30, 2018 4:51 pm

A2DP Source Example - SDP connection error

Postby ayan4m1 » Sun Dec 30, 2018 5:26 pm

Hi all - first off, apologies if I was unable to find an existing post on this subject, but I did spend a few minutes searching. I am trying to stream audio to a Bluetooth speaker using an ESP-WROOM-32 dev board.

I have tested the speaker using a Windows 10 laptop and an Android phone - both are able to use the speaker to play audio with no PIN or special pairing setup outside of selecting the device from a list.

I am using the example here: https://github.com/espressif/esp-idf/tr ... 2dp_source

I have modified the hardcoded device name "ESP_SPEAKER" to the name of my speaker. The following is the serial monitor output with speaker MAC masked.

Code: Select all

I (196) BTDM_INIT: BT controller compile version [7b0770a]
I (196) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (256) phy: phy_version: 4000, b6198fa, Sep  3 2018, 15:11:06, 0, 0
I (736) BT_AV: Starting device discovery...
I (746) BT_AV: Discovery started.
I (3606) BT_AV: Scanned device: c0:0e:aa:aa:aa:aa
I (3606) BT_AV: --Class of Device: 0x240404
I (3606) BT_AV: --RSSI: -41
I (3616) BT_AV: Found a target device, address c0:0e:aa:aa:aa:aa, name Speaker
I (3626) BT_AV: Cancel device discovery ...
I (3626) BT_AV: Device discovery stopped.
I (3636) BT_AV: a2dp connecting to peer: Speaker
E (3636) BT_APPL: reset flags
I (3646) BT_AV: bt_app_av_sm_hdlr state 4, evt 0x0
I (10736) BT_AV: bt_app_av_sm_hdlr state 4, evt 0xff00
I (20736) BT_AV: bt_app_av_sm_hdlr state 4, evt 0xff00
I (30736) BT_AV: bt_app_av_sm_hdlr state 3, evt 0xff00
I (30736) BT_AV: a2dp connecting to peer: c0:0e:aa:aa:aa:aa
I (40736) BT_AV: bt_app_av_sm_hdlr state 4, evt 0xff00
W (41166) BT_SDP: SDP - Rcvd conn cnf with error: 0x8  CID 0x40
W (41176) BT_BTC: BTA_AV_OPEN_EVT::FAILED status: 2
I (41176) BT_AV: bt_app_av_sm_hdlr state 4, evt 0x0
I (50736) BT_AV: bt_app_av_sm_hdlr state 3, evt 0xff00
I (50736) BT_AV: a2dp connecting to peer: c0:0e:aa:aa:aa:aa
I (50736) BT_AV: bt_app_av_sm_hdlr state 4, evt 0x0
I (60736) BT_AV: bt_app_av_sm_hdlr state 4, evt 0xff00
I (70736) BT_AV: bt_app_av_sm_hdlr state 4, evt 0xff00
I (80736) BT_AV: bt_app_av_sm_hdlr state 3, evt 0xff00
I (80736) BT_AV: a2dp connecting to peer: c0:0e:aa:aa:aa:aa
W (88026) BT_SDP: SDP - Rcvd conn cnf with error: 0x8  CID 0x41
I found this issue on GitHub: https://github.com/espressif/esp-idf/issues/2116 - unfortunately it doesn't seem to apply, as according to: http://bluetooth-pentest.narod.ru/softw ... rator.html the Class of Device value 0x240404 indicates "Audio" and "Rendering."

The "connecting to peer" through "SDP - Rcvd conn cnf" lines then repeat for at least 20 loops.

I found this issue on GitHub: https://github.com/espressif/esp-idf/issues/2116 - unfortunately it doesn't seem to apply, as according to: http://bluetooth-pentest.narod.ru/softw ... rator.html the Class of Device value 0x240404 indicates "Audio" and "Rendering."

Where I got stuck is:

Code: Select all

W (41166) BT_SDP: SDP - Rcvd conn cnf with error: 0x8  CID 0x40
My understanding of SDP is hazy at best, and the only place I could find that specific log message is https://github.com/mozilla-b2g/platform ... sdp_main.c.

Is there anything apparent to you that I am doing wrong, or anything I should try in terms of diagnostics or different code approaches?

Thanks for your time.
Last edited by ayan4m1 on Mon Dec 31, 2018 7:20 pm, edited 1 time in total.

User avatar
ayan4m1
Posts: 5
Joined: Sun Dec 30, 2018 4:51 pm

Re: A2DP Source Example - SDP connection error

Postby ayan4m1 » Tue Jan 01, 2019 3:36 pm

Brief update - I got another model of BT speaker and the example connects to that one straightaway. Both speakers work fine with multiple other devices though. Is there anything I should do or try with the non-working speaker to get it to connect?

MNathan
Posts: 5
Joined: Tue Mar 12, 2019 1:08 pm

Re: A2DP Source Example - SDP connection error

Postby MNathan » Thu Apr 11, 2019 1:59 am

Hello Ayan4m1,
I'm having the same problem described above, a hand full of devices, most of them new BT speakers, are failing to connect with the a2dp source. Unfortunately there is not have a single response for such an important post.
The reason of my post is simply to ask if you find a good solution for our problem, besides switching the devices.

I'm also gathering as much information as possible about those "bad" devices to see if I can found a reason or a pattern which should help us solving this problem.

at the risk of you already giving up, I hope the reborn of this topic refresh the ideas of the community.

Who is online

Users browsing this forum: Bing [Bot] and 105 guests