Page 1 of 1
Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 10:13 am
by Mitte
Hi, I want to connect a BT device with a Raspi 3B to recieve an audio signal for FFT Analysis. The audio signal comes from a devie that usually autoconnects to a simple BT speaker like an Anker SounCore, so it has no buttons or display to make settings. I installed the A2DP-Service from
https://gist.github.com/mill1000/74c747 ... tial-setup. With these settings I am able to connect my laptop, stream audio and get the sound from headphone jack or hdmi, so that works. But the problem is that the device I need to connect doesn't get in a stable connection. It keeps connecting and disconnecting every few seconds.
extract from btmgmt
https://pastebin.com/XKsEBEYr
extract from btmon for the last connection
https://pastebin.com/s4D7fduU
Raspbian Stretch 4.14.98-v7+
Re: Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 10:52 am
by Douglas6
Check in bluetoothctl to make sure the device is trusted.
What kind of device (make/model/link)?
Re: Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 11:50 am
by Mitte
It is paired and trusted. I also set it on trusted manually. It is a medical device using BTM510/511 bluetooth multimedia module from LairdTech. It works with HSP and A2DP(preferred) profiles. So i set the pi up as A2DP sink.
Re: Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 12:18 pm
by Douglas6
Sorry, I'm not familiar with that device. It seems to use the aptX audio codec; not sure if that's available to BlueALSA.
[EDIT: Apparently not:
https://github.com/Arkq/bluez-alsa/issues/142]
Re: Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 12:35 pm
by Mitte
Ok, thanks for your help. Do you have any suggestions for workaround?
Re: Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 12:47 pm
by Douglas6
1. Can the BTM510/511 be configured to use an older codec?
2. You could ditch BlueALSA and give PulseAudio a shot. You may have to compile a newer version of PA than what's in the repo to get aptX. In any case, uninstall BlueALSA first, it can conflict with the PA Bluetooth modules.
Please update us with any results.
Re: Bluetooth Device keeps disconnecting
Posted: Fri May 03, 2019 12:59 pm
by Mitte
Unfortunately i can't change anything on the BTM.
I also thought about PA to workaround, but I'm a noob with linux and programming. But I'm gonna give it a try, maybe I'll have some questions about that.
Thank you very much!
Re: Bluetooth Device keeps disconnecting
Posted: Mon May 06, 2019 11:13 am
by Mitte
According to the User Guide of the BTM "An optional codec must be supported by both ends of an A2DP link. At the beginning of each A2DP link a negotiation takes place. In the result of this negotiation both devices agree on the codec and the sampling rate to be used for the time of the connection. If no optional codec matches on both ends, SBC is used. Multiple optional codecs can be enabled.". So it should connect with SBC and not insist on apt-x.
Also fixed the btmon link.