Laptop immediately wakes up from sleep when Bluetooth is turned on

Hi everyone,
I’m struggling with the following issue: when I suspend (put to sleep) my laptop, it immediately wakes up. It doesn’t matter if you do it in the UI, press the power button, or close the lid. It always wakes up after around a second. I’m sure it goes into sleep for a moment because when the screen turns back on, WiFi and Bluetooth devices are disconnected.

After some experimenting, I found out that it’s caused by Bluetooth - if I turn it off then it works. It doesn’t even matter if there are no devices connected.

It has been happening for at least a month now but initially I was convinced that it must be a serious bug that’s going to be fixed soon. Week after week passed and nothing has changed, so I decided to ask here.

I only found some old issues that look similar:

https://bbs.archlinux.org/viewtopic.php?id=237812

However the only suggestion is to have a hook that turns BT off on sleep, which is not a real solution to the problem. It had been working earlier, so it can’t be related to some hardware issue.

Am I the only one experiencing this?
I’m using Dell XPS 9510, kernel 5.17.5-arch1-1, Gnome 42. I update my system regularly.

1 Like

Possibly related:

Bug 215768 Kernel 5.17 can’t suspend while bluetooth is enabled.

Via: https://bbs.archlinux.org/viewtopic.php?pid=2034525#p2034525
and https://bugzilla.redhat.com/show_bug.cgi?id=2077808

4 Likes

Welcome to the EndeavourOS Forum. I hope you enjoy your time here.

Pudge

Thanks @robin1! That seems to be it.
I wish I could downgrade back to 5.16 but I longer have it in my pacman cache.

Update:
Linux 5.18 has been released but it still doesn’t fix this issue.

Maybe someone finds this helpful. I was able to work around it by doing the following:
Create a file /lib/systemd/system-sleep/bluetooth-suspend with this content:

if [ "${1}" == "pre" ]; then
    systemctl stop bluetooth
elif [ "${1}" == "post" ]; then
    systemctl start bluetooth
fi

Make it executable: chmod +x bluetooth-suspend.
In file /etc/bluetooth/main.conf, enable the setting AutoEnable=true under [Policy].

That has fixed the issue for me.

2 Likes