Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Bluetooth breaks autoplay on start
#3
Okay, I have solved the problem. Perhaps some of this can be useful to others, so I'll describe what I did.

First, I found in /var/log/syslog that the firmware for my dongle wasn't found correctly:
Code:
Jan  9 16:42:14 moode kernel: [    5.847526] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2
Jan  9 16:42:14 moode kernel: [    5.847557] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found

I built the firmware files using https://github.com/winterheart/broadcom-bt-firmware and downloads from http://www.catalog.update.microsoft.com/...+bluetooth, dropping the file  BCM20702A1-0a5c-21e8.hcd into the folder /lib/firmware/brcm. Now the messages didn't come up anymore at boot. However, nothing else changed - instead I found some new startup errors:

Code:
Jan 10 09:46:04 moode systemd[1]: dev-serial1.device: Job dev-serial1.device/start timed out.
Jan 10 09:46:04 moode systemd[1]: Timed out waiting for device dev-serial1.device.
Jan 10 09:46:04 moode systemd[1]: Dependency failed for Configure Bluetooth Modems connected by UART.
Jan 10 09:46:04 moode systemd[1]: hciuart.service: Job hciuart.service/start failed with result 'dependency'.
Jan 10 09:46:04 moode systemd[1]: dev-serial1.device: Job dev-serial1.device/start failed with result 'timeout'.


I found reference to similar issues here: https://github.com/hypriot/image-builder-rpi/issues/72

In the commit that was used to fix things for that project, I found that they changed the service file hciuart.service to work with /dev/ttyAMA0 instead of /dev/serial1. ttyAMA0 existed on the pi (in fact serial0 links to it), but serial1 didn't exist - so I decided to give this a try. I changed the combination of Requires/After in /lib/systemd/system/hciuart.service to this:

Code:
Before=bluetooth.service
After=dev-ttyAMA0.device

After a restart, everything works correctly now. The Bluetooth startup process takes no time at all - not a single second between the lines in the moodelog output:

Code:
20190110 102444 worker: Bluetooth controller started
20190110 102444 worker: Bluetooth controller initialized

Bluetooth works correctly, in fact it seems quite a bit faster to connect than before. And the autoplay on start feature now works like it does without Bluetooth.

Tim - I'm wondering if your 7 second initialization is still an indication of a problem. I wonder if other pis have /dev/serial1 for some reason? Where would it come from? Perhaps the hciuart service is simply misconfigured, but this results in different symptoms on different devices and so you haven't noticed previously.

Thanks
Oli
Reply


Messages In This Thread
Bluetooth breaks autoplay on start - by olisturm - 01-09-2019, 04:59 PM
RE: Bluetooth breaks autoplay on start - by olisturm - 01-10-2019, 10:47 AM

Forum Jump: