Sleep and Wake
The Problem
Éowyn, my lovely Dell XPS 15 9570, likes to give its Ubuntu (and Linux) users hell when
it comes to going to sleep mode and waking up. As it stood, I couldn't close my laptop and
then resume working, which was rather problematic since closing the laptop should have theoretically
only put the computer in sleep mode. Every time I closed the lid, I had to power off and power on
my laptop.
Stuff that didn't work
The first solution I looked up was command-line ways to put the computer to sleep. I
tried using the
pm-suspend-hybrid
command
from
pm-utils as a superuser (which did
nothing) as well as tried the
systemcl hibernate
command.
The latter had the same effect as closing the laptop, unfortunately.
The next step was checking out my BIOS settings.
-
Get drivers (an .exe file) from the Dell website
(a truly dreadful experience), put the file on a USB drive, and mount the drive.
-
Shut down the computer and enter the BIOS by pressing the F2 key, and going
to Settings → Power Management →
USB Wake Support as well as Settings → Power Management →
Block Sleep. Why are BIOS's so painful to navigate?
-
One website said that the Enable USB Wake Support button
would be disabled, and that I should enable it. It also said that that
the Block Sleep option would also be selected, and that
I should disable it. However, my BIOS settings were already in these states.
-
The next step was to update the BIOS.
- Repeatedly pressing F12 (I don’t actually know
if doing it only once suffices)
- Selecting the BIOS Flash Update
- Navigating to and selecting that .exe file we talked about earlier
- Waiting for a while
This did absolutely zilch to fix the issue, but it was a learning experience. Yay! I now
know how to update my BIOS.
The Solution
There’s a pretty
simple 4-ish minute long YouTube video that
explained this the best. The chap pulled a ton of this stuff from the ArchWikis.
The pertinent stuff can be found in
the Power Management section
of the page.
-
If you type
cat /sys/power/mem_sleep
you’ll see
the (default) response: [s2idle] deep, meaning that
the s2idle is selected.
-
To fix the issue, you’ll want to use the deep version instead.
You could just go ahead and use the command
echo deep|sudo tee/sys/power/mem_sleep
which would
temporarily fix the issue.
-
To make the change permanent, change the kernel parameters by
editing the /etc/default/grub as a superuser.
-
In the grub file,
the GRUB_CMDLINE_LINUX_DEFAULT (the boot options)
is set to quiet splash.
- The quiet part just means “non-verbose.”
Without this, a bazillion messages would be printed to the screen.
- The splash bit gives us something to look at
while the real stuff loads in the background.
Without this, we’d just be staring at a blank screen.
-
After the quiet splash, add
the text mem_sleep_default=deep
- Now type
sudo grub-mkconfig -o /boot/grub/grub.cfg
- Reboot, test, and we’re done!