Closed jravetch closed 2 years ago
Yep. Can confirm that it is happening. I'm on a Dell XPS 15 9500, 22.04.
Strange that when I run lib/systemd/system-sleep/pop-default-settings_bluetooth-suspend
from bash, it works fine.
However if it runs when my machine resumes from sleep, it does run, but bluetooth does not get unblocked.
I also checked that this line does actually run.
[ ! -f "$BT_BLOCK_PATH" ] && rfkill unblock bluetooth
Other things I checked:
journalctl -b -u systemd-suspend.service
The script is working completely as intended, but perhaps something else is preventing bluetooth from unblocking?
For the moment, I emptied the script. Bluetooth does not get unblocked when suspended, but that is fine for me.
Clearing the script does enable bluetooth upon waking from suspend, but my devices no longer autoconnect. Unblocking is required for my bluetooth mouse to connect.
This sounds to me like a timing issue. Perhaps adding a sleep to the script would help?
We may be able to remove this script now, if the Linux regression requiring it is fixed. I am hesitant to do that, however, in case the regression comes back.
What was the regression that made this an issue? I'm fine with keeping the script as long as it does what it's intended. Where should I put the sleep?
The regression is that a number of bluetooth controllers broke suspend with kernels 5.18 and newer. This script just turns them off prior to suspend, and back on after. A sleep before the rfkill unblock bluetooth command would work.
[ ! -f "$BT_BLOCK_PATH" ] && sleep 1 && rfkill unblock bluetooth
will sleep 1 second before trying to unblock bluetooth. Adjust the 1
up if it does not work until you have a good value.
That worked perfectly! Thank you so much! Can I submit a pull request to add the sleep here https://github.com/pop-os/default-settings/blob/master_jammy/lib/systemd/system-sleep/pop-default-settings_bluetooth-suspend#L22 ?
Absolutely. We will then have to put it through extensive QA to ensure there are no regressions.
Hmm it seems to still happen to me on ThinkPad X1 Carbon gen 10 and 22.04
With bluetooth on, I enable suspend. After waking from suspend bluetooth is off, I need to turn it back on. I see the same issue was fixed for 20.04 now it's happening in 22.04 #147. I'm on a Dell XPS 13 7390.