Bluetooth stops working after sleep

Hi,

I have a System76 Lemur Pro rocking Fedora Silverblue 36 with all the latest updates. I believe this problem has started somewhere around upgrading from F35 to F36.

I use my computer for sometime, then close the lid (it goes to sleep), come back to my room, attach it to my 4K monitor (I have to open the lid in order to wake it up) and when I try to use my bluetooth mouse and keyboard, they’re not paired.

I restart bluetooth service and everything is back to normal. I’m looking for a solution to this. Here are some latest logs of bluetooth service:

-- Boot 5a1afcdb84ff4d05b491cc42cd581a2e --
Tem 25 16:19:43 fedora systemd[1]: Starting bluetooth.service - Bluetooth service...
Tem 25 16:19:43 fedora systemd[531]: bluetooth.service: Failed to set up mount namespacing: /run/systemd/unit-root/var/lib/bluetooth: No such file or directory
Tem 25 16:19:43 fedora systemd[531]: bluetooth.service: Failed at step NAMESPACE spawning /usr/libexec/bluetooth/bluetoothd: No such file or directory
Tem 25 16:19:43 fedora systemd[1]: bluetooth.service: Main process exited, code=exited, status=226/NAMESPACE
Tem 25 16:19:43 fedora systemd[1]: bluetooth.service: Failed with result 'exit-code'.
Tem 25 16:19:43 fedora systemd[1]: Failed to start bluetooth.service - Bluetooth service.
Tem 25 16:19:55 penguix systemd[1]: Starting bluetooth.service - Bluetooth service...
Tem 25 16:19:55 penguix bluetoothd[1020]: Bluetooth daemon 5.64
Tem 25 16:19:55 penguix systemd[1]: Started bluetooth.service - Bluetooth service.
Tem 25 16:19:55 penguix bluetoothd[1020]: Starting SDP server
Tem 25 16:19:55 penguix bluetoothd[1020]: Bluetooth management interface 1.22 initialized
Tem 25 16:19:56 penguix bluetoothd[1020]: src/device.c:set_wake_allowed_complete() Set device flags return status: Invalid Parameters
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/ldac
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/aac
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSink/sbc
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/sbc
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSink/sbc_xq
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/sbc_xq
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/faststream
Tem 25 16:19:57 penguix bluetoothd[1020]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/faststream_duplex
Tem 25 16:20:04 penguix bluetoothd[1020]: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Host is down
Tem 25 22:42:22 penguix bluetoothd[1020]: Controller resume with wake event 0x0
Tem 25 22:43:12 penguix systemd[1]: Stopping bluetooth.service - Bluetooth service...
Tem 25 22:43:12 penguix bluetoothd[1020]: Terminating
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSource/ldac
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSource/aac
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSink/sbc
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSource/sbc
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSink/sbc_xq
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSource/sbc_xq
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSource/faststream
Tem 25 22:43:12 penguix bluetoothd[1020]: Endpoint unregistered: sender=:1.44 path=/MediaEndpoint/A2DPSource/faststream_duplex
Tem 25 22:43:12 penguix bluetoothd[1020]: Stopping SDP server
Tem 25 22:43:12 penguix bluetoothd[1020]: Exit
Tem 25 22:43:12 penguix systemd[1]: bluetooth.service: Deactivated successfully.
Tem 25 22:43:12 penguix systemd[1]: Stopped bluetooth.service - Bluetooth service.
Tem 25 22:43:12 penguix systemd[1]: bluetooth.service: Consumed 34.857s CPU time.
Tem 25 22:43:12 penguix systemd[1]: Starting bluetooth.service - Bluetooth service...
Tem 25 22:43:12 penguix bluetoothd[73967]: Bluetooth daemon 5.64
Tem 25 22:43:12 penguix systemd[1]: Started bluetooth.service - Bluetooth service.
Tem 25 22:43:12 penguix bluetoothd[73967]: Starting SDP server
Tem 25 22:43:12 penguix bluetoothd[73967]: Bluetooth management interface 1.22 initialized
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/ldac
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/aac
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSink/sbc
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/sbc
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSink/sbc_xq
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/sbc_xq
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/faststream
Tem 25 22:43:12 penguix bluetoothd[73967]: Endpoint registered: sender=:1.44 path=/MediaEndpoint/A2DPSource/faststream_duplex
Tem 25 22:43:12 penguix bluetoothd[73967]: src/device.c:set_wake_allowed_complete() Set device flags return status: Invalid Parameters
Tem 25 22:43:19 penguix bluetoothd[73967]: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Host is down

Hi,

I have the same issue with my mouse on Fedora 36. This issue appears weeks ago…

I have to open the bluetooth setting window, wait few seconds and the bluetooth connection is back.

Hey :slight_smile:

Well it seems that it has a related issue to this topic

Anyway, did u upgrade your system? Probably the new kernel version solves this issue?

Let us know :slight_smile:

v/r

Andi/andilinux

1 Like

the issue is still here with kernel 5.18.13-200.fc36.x86_64

Unfortunetely, it didn’t solve the problem. I also wrote a comment into the bug report, thanks for the link!

1 Like

you’re welcome every time and thx for reporting this as bug!

1 Like

what works for me is to call - bluetoothctl power off; bluetoothctl power on
I’m using a quirk like this for now:

 $ cat /etc/systemd/system/suspend-bluetooth-quirk.service

[Unit]
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStop=-/bin/bash -c 'bluetoothctl power on'
ExecStart=-/bin/bash -c 'bluetoothctl power off'

[Install]
WantedBy=sleep.target
1 Like