Mitte
Posts: 6
Joined: Thu Apr 04, 2019 12:41 pm
Location: Austria

Bluetooth Device keeps disconnecting

Fri May 03, 2019 10:13 am

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+
Last edited by Mitte on Fri May 03, 2019 10:59 pm, edited 1 time in total.

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Device keeps disconnecting

Fri May 03, 2019 10:52 am

Check in bluetoothctl to make sure the device is trusted.

What kind of device (make/model/link)?

Mitte
Posts: 6
Joined: Thu Apr 04, 2019 12:41 pm
Location: Austria

Re: Bluetooth Device keeps disconnecting

Fri May 03, 2019 11:50 am

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.

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Device keeps disconnecting

Fri May 03, 2019 12:18 pm

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]

Mitte
Posts: 6
Joined: Thu Apr 04, 2019 12:41 pm
Location: Austria

Re: Bluetooth Device keeps disconnecting

Fri May 03, 2019 12:35 pm

Ok, thanks for your help. Do you have any suggestions for workaround?

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Device keeps disconnecting

Fri May 03, 2019 12:47 pm

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.

Mitte
Posts: 6
Joined: Thu Apr 04, 2019 12:41 pm
Location: Austria

Re: Bluetooth Device keeps disconnecting

Fri May 03, 2019 12:59 pm

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!

Mitte
Posts: 6
Joined: Thu Apr 04, 2019 12:41 pm
Location: Austria

Re: Bluetooth Device keeps disconnecting

Mon May 06, 2019 11:13 am

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.

Return to “Troubleshooting”