MrLampe
Posts: 3
Joined: Fri Feb 17, 2017 7:32 am

Bluetooth freezes

Fri Feb 17, 2017 9:50 am

Hi,

my bluetooth freezes, if I send much data. Me and my colleagues have been trying to solve this problem for almost a week now. Hope someone can push us into the right direction to solve the problem.

Scenario:
  • Fresh install of latest Raspbian. No Monitor, just ssh over WiFi.
  • Using Bluetooth Serial
  • Devices paired (RasPi and Android-Device)
  • Using rfcomm to send data from Pi
I'm now sending some random data using:

Code: Select all

while true; do dd if=/dev/urandom of=/dev/rfcomm0 bs=1000 count=1; sleep 0.01; done
Data is beeing received by the android device, but after a random time between a few seconds or some minutes the following happens:
  • Transmission stops (Btmon shows no activity anymore)
  • After some seconds the android device tells me, it lost the bluetooth connection
  • Connection cannot be reestablished
  • BluetoothCtl shows no error
I even cannot reset the device anymore with the command:

Code: Select all

hciconfig hci0 reset
When running this, I get the error message:
Can't init device hci0: Connection timed out (110)
And btmon outputs only the following lines:
* Unknown packet (code 8 len 0) [hci0] 938.480551
< HCI Command: Read Local Supported F.. (0x04|0x0003) plen 0 [hci0] 938.480635
< HCI Command: Read Local Version Inf.. (0x04|0x0001) plen 0 [hci0] 940.475667
< HCI Command: Read BD ADDR (0x04|0x0009) plen 0 [hci0] 942.475654
* Unknown packet (code 9 len 0) [hci0] 948.475607
Without rebooting the Pi I cannot get it working again.
So what did I do wrong with the inbuild bluetooth?

Thanks in advance and best wishes

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

Re: Bluetooth freezes

Fri Feb 17, 2017 2:04 pm

My best suggestion is to try it with a USB Bluetooth dongle.

MrLampe
Posts: 3
Joined: Fri Feb 17, 2017 7:32 am

Re: Bluetooth freezes

Sun Feb 19, 2017 12:28 pm

I tried using a bluetooth dongle. This is working perfectly fine in the above scenario for hours.
Also tried another brand new raspi 3: Bluetooth freezes. So I doubt that my first raspi3 was just a faulty one.

So what could be wrong with the built-in bluetooth? Is there anything known about driver issues?

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

Re: Bluetooth freezes

Sun Feb 19, 2017 2:09 pm

Cypress (née Broadcom) is apparently looking into the matter.

MrLampe
Posts: 3
Joined: Fri Feb 17, 2017 7:32 am

Re: Bluetooth freezes

Mon Feb 20, 2017 8:02 am

Thank you for the info.
Is there any place (e.g. a forum thread) to check for updates on this kind problems?

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

Re: Bluetooth freezes

Mon Feb 20, 2017 3:00 pm

Not that I am aware of. It's been a problem since the Pi3 was released, so I'm not holding my breath.

MoonDragon
Posts: 2
Joined: Thu Jan 11, 2018 11:27 pm

Re: Bluetooth freezes

Thu Jan 11, 2018 11:37 pm

For the record, I am suffering the exact same problem. It took a while to get my bluetooth speaker connected, without understanding why it doesn't work. Then finally I figured it was this exact issue.

If I power-cycle my raspberry pi 3, freshly connect the speaker as an audio output, I can generate sound (by using sox) that goes on until I stop it (didn't test for more than 10 seconds). If I then attempt to stream music from Soundcloud, the music starts and then dies within one or two seconds. hciconfig reports my hci0 to be DOWN. No amount of resetting or finagling can recover hci0. Only a full reboot works.

Any help in this department would be welcome. If someone can suggest some form of flow control or limitations to look into, that would be wonderful.
(@)

MoonDragon
Posts: 2
Joined: Thu Jan 11, 2018 11:27 pm

Re: Bluetooth freezes

Fri Jan 12, 2018 11:06 pm

After putting quite a few hours into this problem, I narrowed it down to the following:
* If I'm streaming music through wireless connection, the Bluetooth hardware will lock up in seconds;
* If I'm streaming through an Ethernet cable, the Bluetooth hardware works fine.

So the problem is using WiFi and Bluetooth at the same time.
(@)

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

Re: Bluetooth freezes

Sat Jan 13, 2018 1:37 am

That's an issue that has been frequently reported on this forum. If you are using the latest Raspbian Stretch release, I would recommend a

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade 
I was able to stream music to my Bluetooth speaker over WiFi for many minutes with a minimum of glitches.

Return to “Troubleshooting”

Who is online

Users browsing this forum: n67 and 74 guests