Fix for Wake from suspend/sleep

I found a simple fix for suspend/sleep state and wanted to share and help those out with a similar issue. If your main concern is power saving while in suspend, then this might not be the best solution for you, but if you just want to be able to put your device on suspend ie. screen off and sleeping, then this is what the fix tries to do. It is probably not the best solution or most technical solution, but it is a simple fix and it works consistently for me. For reference, I own a 2012 Mac Mini, Intel i7, intel UHD 4000 graphics, and running Fedora 36 i3wm.

  1. First try modifying or disable certain options with sleep/hibernate.
  • navigate to sleep.conf (sudo nano /etc/systemd/sleep.conf or cd /etc/systemd/sleep.conf and then sudo nano sleep.conf)
    -remove hashtag and disable either AllowHibernation or AllowSuspend. I would recommend disabling Hibernation first because that is the more intensive idle mode apparently and leave suspend on. Save the file with whatever editor you used. You can play around and troubleshoot back and forth with the options to see what works for your system.
  1. If the above does not work, then try switching mem_sleep.
    (sudo nano /sys/power/mem_sleep or cd /sys/power and sudo nano mem_sleep).
  • There will be a [ ] brackets around the word deep or whatever default your system is set too. Mine was [deep] and then other words without brackets like “s2idle” or something. I only have s2idle and deep, which apparently means Fedora is saying my computer can only go into these two states, so maybe your computer has more options. Either way, remove the brackets from one of the choices and put it around another one, then save. I changed from deep to s2idle. Deep is a stronger suspend state and s2idle isn’t as strong, so switching it to s2idle allows the computer to still have power to the I/O ports whereas I think deep doesn’t. There are other technical factors like move memory to ram or memory to swap space stuff happening behind the scenes, but I don’t jave swap space or swapfile on mine. Maybe because of zram or btrfs, I am not sure. But anyways move the brackets to a lighter suspend state and hopefully that works for you.

Before I had made these fixes, whenever i put my computer to suspend and tried to wake it up through keyboard or mouse, the light would turn on the mac but the screen would stay blank without any power going to it. I think it has to do with either the ports or the graphics card compatibility with the kernel or fedora. But putting it to s2idle keeps the power going to the ports and the system is not in a deep idle state. Hope this helps.

O yea, and if you don’t like that black ugly green circle for lock screen, use sudo dnf remove i3lock.

3 Likes

Hi, I would like to add to this, as I had the same problem on an old Intel iMac.

While the instructions above did not work for me, they did point me in the right direction.

Specifically, the file /etc/systemd/sleep.conf was what I had to edit. That file also had useful comments pointing to a man page (man systemd-sleep.conf), and that man page took more to more info at the kernel.org documentation page on sleep.’

Using those resources I came up with the following values for the /etc/systemd/sleep.conf file:

[Sleep]
AllowSuspend=yes
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
SuspendMode=suspend
SuspendState=standby freeze mem

Now, the system sort of sleeps. At least it doesn’t die, which is a significant step forward.

Instead, it makes the display go to sleep. Then the display wakes up and shows the “locked screen” (showing the date and time, and saying press any key to unlock). If I leave the computer alone, it will go back to sleep, or at least shut off the display, and then later will wake up again, in a continuous cycle of sleeping and waking.

So it seems there is no perfect answer to this, but at least the computer is usable now.

Thank you Jason for the helpful post!