04-12-2024, 04:01 PM
(04-12-2024, 02:56 PM)Tim Curtis Wrote: I was working on some Bluetooth improvements and noticed that bluetooth always starts during boot even though its systemd unit (bluetooth.service) is set to "disabled" and it's not turned on in Renderer Config.
I poked around a bit and was not able to find what is starting Bluetooth.
ETA: Here's what shows up in dmesg log
Code:pi@moode9:~ $ dmesg | grep Bluetooth
[ 4.647910] Bluetooth: Core ver 2.22
[ 4.647946] Bluetooth: HCI device and connection manager initialized
[ 4.647952] Bluetooth: HCI socket layer initialized
[ 4.647955] Bluetooth: L2CAP socket layer initialized
[ 4.647960] Bluetooth: SCO socket layer initialized
[ 4.665974] Bluetooth: HCI UART driver ver 2.3
[ 4.665981] Bluetooth: HCI UART protocol H4 registered
[ 4.666022] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 4.672749] Bluetooth: HCI UART protocol Broadcom registered
[ 5.029576] Bluetooth: hci0: BCM: chip id 107
[ 5.029801] Bluetooth: hci0: BCM: features 0x2f
[ 5.030954] Bluetooth: hci0: BCM4345C0
[ 5.030962] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[ 5.036236] Bluetooth: hci0: BCM4345C0 'brcm/BCM4345C0.raspberrypi,5-model-b.hcd' Patch
[ 5.480236] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 5.480245] Bluetooth: BNEP filters: protocol multicast
[ 5.480252] Bluetooth: BNEP socket layer initialized
[ 5.774026] Bluetooth: hci0: BCM: features 0x2f
[ 5.775430] Bluetooth: hci0: BCM43455 37.4MHz Raspberry Pi 3+-0190
[ 5.775436] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0382
[ 5.775746] Bluetooth: hci0: BCM: Using default device address (43:45:c0:00:1f:ac)
[ 5.797339] Bluetooth: MGMT ver 1.22
I see what you mean. On the system I just spun up (and mentioned in my last post) I see
Code:
pi@m9pre3pull:~ $ systemctl status bluetooth.service
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; preset: enabled)
Active: active (running) since Fri 2024-04-12 07:43:56 EDT; 3h 26min ago
Docs: man:bluetoothd(8)
Main PID: 617 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 1596)
CPU: 121ms
CGroup: /system.slice/bluetooth.service
└─617 /usr/libexec/bluetooth/bluetoothd
...
Ah, but I also see bluealsa.service is enabled and running
Code:
pi@m9pre3pull:~ $ systemctl status bluealsa.service
● bluealsa.service - Bluealsa proxy
Loaded: loaded (/etc/systemd/system/bluealsa.service; enabled; preset: enabled)
Active: active (running) since Fri 2024-04-12 11:24:05 EDT; 31min ago
Main PID: 627 (bluealsa)
Tasks: 3 (limit: 1596)
CPU: 36ms
CGroup: /system.slice/bluealsa.service
└─627 /usr/bin/bluealsa -p a2dp-source -p a2dp-sink -c aptx -c aptx-hd -c ldac --sbc-quality=xq+
...
and bluetooth.service is required by bluealsa.service so maybe that's why bluetooth.service is running?
Code:
pi@m9pre3pull:~ $ systemctl cat bluealsa.service
# /etc/systemd/system/bluealsa.service
[Unit]
Description=Bluealsa proxy
Requires=bluetooth.service
After=bluetooth.service
[Service]
Type=simple
ExecStart=/usr/bin/bluealsa -p a2dp-source -p a2dp-sink -c aptx -c aptx-hd -c ldac --sbc-quality=xq+
[Install]
WantedBy=multi-user.target
Mind you, I'm just a dilettante with systemd and dbus related-stuff.
Regards,
Kent