You are not logged in.

#1 2022-04-15 23:08:57

emilyst
Member
Registered: 2022-04-15
Posts: 1

On suspend, system does not disconnect Bluetooth devices, shuts down

Hi, all,

When I suspend my system, any connected Bluetooth device remains powered on. It's as if the device never gets disconnected, even though the system is now in a sleep state.

Additionally, the entire system will often shut down (as if the kernel crashes). I haven't been able to figure out why. This doesn't always happen, but usually does. If no Bluetooth devices are connected, this issue doesn't occur.

For now, I've been able to work around the issue by resetting the Bluetooth controller just before sleep, which disconnects the devices. I wrote this service to do so:

# /etc/systemd/system/reset-bluetooth-controller-before-sleep.service
# Hack to disconnect all devices before sleep
# Requires bluez-utils-compat (AUR)

[Unit]
Description=Reset Bluetooth controller before sleep
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecCondition=/usr/bin/systemctl is-enabled bluetooth.service
ExecStart=+/usr/bin/hciconfig hci0 reset

[Install]
WantedBy=sleep.target

(I'm running kernel 5.17.2-arch3-1 on a NUC11PAHi7. Not sure what all other info would be needed to diagnose, so let me know, and I'll post it.)

Is there a better solution? Thanks in advance!

Offline

Board footer

Powered by FluxBB