Page 1 of 1

Problems with latest Bluetooth code

Posted: Mon Oct 30, 2017 11:38 pm
by Douglas6
I've spent just a few hours on this, but am experiencing strange behavior with today's

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
When performed on my current system, things looked promising briefly. But then (perhaps after a power-cycle?) running bluetoothctl, it would respond with 'waiting to connect to bluetoothd' and then immediately overwrite that message with the '[bluetooth] #' prompt. 'sudo bluetoothctl' seemed to work, but I couldn't connect to the speaker that was previously working. I tried to remove BlueZ and install again, but that left the system unable to see the adapter (hci0).

So, I imaged a new card with the 2017-08-16-raspbian-stretch image. I again did a

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
and reboot, and this time, from the start, bluetoothctl is responding again with 'waiting to connect to bluetoothd' again overwritten by the bluetoothctl prompt. 'sudo bluetoothctl' appears to work normally. The adapter is up, and bluetoothd seems to be running normally.

Very odd, so I thought I'd bring it up.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 11:13 am
by drgeoff
Maybe not totally unconnected with what jamesh posted at viewtopic.php?f=28&t=196529&p=1228787#p1228787

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 12:04 pm
by B.Goode
drgeoff wrote:
Tue Oct 31, 2017 11:13 am
Maybe not totally unconnected with what jamesh posted at viewtopic.php?f=28&t=196529&p=1228787#p1228787
Isn't that exactly what the thread title and introductory sentence refer to...

[Subsequent edit: Oops, no, jumped to conclusions. I was referring to the Announcement at viewtopic.php?f=63&t=187256&p=1228724#p1228724 - I assumed @Douglas6 was doing the same.]

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 12:17 pm
by ShiftPlusOne
That thread is about pulseaudio problems. There hasn't been enough information provided to be able to link the two threads.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 1:08 pm
by Douglas6
Well the first link is about audio streaming (not necessarily PulseAudio, which is no longer used.) But yes, I wanted to test the new Bluetooth patches that jamesh announced. No luck. The problem I experienced was strictly with bluetoothctl, and seemingly only when run under the 'pi' user.

I'll try to test with a later version of Raspbian today, in between scary movies.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 1:12 pm
by ShiftPlusOne
Douglas6 wrote:
Tue Oct 31, 2017 1:08 pm
Well the first link is about audio streaming (not necessarily PulseAudio, which is no longer used.) But yes, I wanted to test the new Bluetooth patches that jamesh announced. No luck. The problem I experienced was strictly with bluetoothctl, and seemingly only when run under the 'pi' user.

I'll try to test with a later version of Raspbian today, in between scary movies.
A few of us have tried to reproduce the problem at the office and haven't been able to. If you manage it again, it would be nice to know the exact steps required.

Edit: Note that a reboot is required after the upgrade.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 1:25 pm
by Douglas6
My first post described the steps pretty completely.
1. Burn an SD with 2017-08-17-raspbian-stretch.
2. Run sudo apt-get update and sudo apt-get dist-upgrade.
3. Reboot.
4. Run bluetoothctl as user pi. Receive a 'Trying to connect to bluetoothd...' error.

I didn't test it before the upgrade, I'll do that now. Perhaps a hardware problem occurred coincidentally. But again, the adapter and bluetoothd are reporting normally.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 1:36 pm
by PhilE
For completeness, which platform are you testing on?

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 1:45 pm
by Douglas6
Sorry, yes. Pi3B, with on-board Bluetooth chip. Also, via SSH, over WiFi.
[EDIT: Also, if I recall, I set it to boot to command line, right about the time the error began.]

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 2:15 pm
by ShiftPlusOne
Douglas6 wrote:
Tue Oct 31, 2017 1:25 pm
My first post described the steps pretty completely.
1. Burn an SD with 2017-08-17-raspbian-stretch.
2. Run sudo apt-get update and sudo apt-get dist-upgrade.
3. Reboot.
4. Run bluetoothctl as user pi. Receive a 'Trying to connect to bluetoothd...' error.

I didn't test it before the upgrade, I'll do that now. Perhaps a hardware problem occurred coincidentally. But again, the adapter and bluetoothd are reporting normally.
Previously I was testing with the latest image and everything just worked. Testing with the image you're using and the instructions you gave above, it's still fine.

You'd lose the devices you had already paired because the older image had a hardcoded BT MAC address, which is now calculated from the pi's serial number.

EDIT: Just tried booting to CLI only and using bluetoothctl over ssh. Still no issues.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 2:21 pm
by Douglas6
Ok, that explains some of my results (I forgot about the bdaddr changes.) Still doesn't explain my 'waiting to connect to bluetoothd' error when using bluetoothctl as pi, but not under sudo. I'm burning the latest image now, and will continue my testing.

Re: Problems with latest Bluetooth code

Posted: Tue Oct 31, 2017 4:07 pm
by Douglas6
I was not able to reproduce my previous problems, with the latest Raspbian. I'll keep looking into it. Meanwhile, the new Bluetooth code looks promising. I'm currently streaming from an internet radio station over Wi-Fi and broadcasting it to a Bluetooth speaker. In almost an hour, no stoppages, and a minimal amount of glitching, which could be attributed to the server, my shoddy network, or Bluetooth in general.