[solved] Suspend and hibernate not working

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
user3456
Level 1
Level 1
Posts: 5
Joined: Sat May 28, 2022 7:14 am

[solved] Suspend and hibernate not working

Post by user3456 »

Hi to all,
I have a problem on my new HP envy x360 with Linux Mint. In Windows 11 everything is working fine (I have dual boot), but in Linux Mint, suspend doesn't work correctly. If I try by pressing power button, closing lid, selecting in start menu or using

Code: Select all

sudo systemctl suspend
screen and power light turn off, and I can't reactivate the laptop until I hold power button pressed and therefor power it off manually. This seems to have to do with a problem with the new ryzen-processors: https://gitlab.freedesktop.org/drm/amd/-/issues/1230

So I accepted suspend is not supported at this time for my laptop and tried to enable hibernate (to disk) instead of suspend (to ram) in order not to have to shut down the computer every time. I followed this tutorial: https://www.linuxuprising.com/2021/08/h ... buntu.html, but most of the time, when I enter

Code: Select all

sudo systemctl hibernate
the computer merely locks screen. I also disabled Windows' quick boot and created a swap file which is big enough. Any help would be much appreceated!

Swap file (output of swapon):

Code: Select all

NAME      TYPE SIZE USED PRIO
/swapfile file  16G   0B   -2

System information:
Linux Mint 20.3 Cinnamon

Code: Select all

System:
  Kernel: 5.13.0-44-generic x86_64 bits: 64 compiler: N/A 
  Desktop: Cinnamon 5.2.7 Distro: Linux Mint 20.3 Una 
  base: Ubuntu 20.04 focal 
Machine:
  Type: Convertible System: HP product: HP ENVY x360 Convertible 15-eu0xxx 
  v: N/A serial: <filter> 
  Mobo: HP model: 888A v: 63.29 serial: <filter> UEFI: AMI v: F.07 
  date: 03/10/2022 
Battery:
  ID-1: BAT0 charge: 50.7 Wh condition: 52.3/52.3 Wh (100%) 
  model: 333-27-3A-A BN03051XL status: Charging 
  Device-1: hid-0018:04F3:2D07.0004-battery model: ELAN2514:00 04F3:2D07 
  charge: N/A status: N/A 
CPU:
  Topology: 8-Core model: AMD Ryzen 7 5700U with Radeon Graphics bits: 64 
  type: MT MCP arch: Zen rev: 1 L2 cache: 4096 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 57490 
  Speed: 1397 MHz min/max: 1400/4370 MHz Core speeds (MHz): 1: 1397 2: 1396 
  3: 1396 4: 1397 5: 1397 6: 1397 7: 1397 8: 1397 9: 1397 10: 1397 11: 1397 
  12: 1396 13: 1397 14: 1397 15: 1397 16: 1397 
Graphics:
  Device-1: AMD vendor: Hewlett-Packard driver: amdgpu v: kernel 
  bus ID: 04:00.0 
  Display: x11 server: X.Org 1.20.13 driver: amdgpu,ati 
  unloaded: fbdev,modesetting,vesa 
  resolution: 1920x1080~60Hz, 1280x1024~60Hz 
  OpenGL: renderer: AMD RENOIR (DRM 3.41.0 5.13.0-44-generic LLVM 12.0.0) 
  v: 4.6 Mesa 21.2.6 direct render: Yes 
Audio:
  Device-1: AMD vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
  bus ID: 04:00.1 
  Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor 
  vendor: Hewlett-Packard driver: snd_rn_pci_acp3x v: kernel bus ID: 04:00.5 
  Device-3: AMD Family 17h HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus ID: 04:00.6 
  Sound Server: ALSA v: k5.13.0-44-generic 
Network:
  Device-1: Realtek vendor: Hewlett-Packard driver: rtw89_pci v: kernel 
  port: f000 bus ID: 02:00.0 
  IF: wlp2s0 state: up mac: <filter> 
  Device-2: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152 
  bus ID: 2-1.1:3 
  IF: enx00e04c681d5a state: down mac: <filter> 
Drives:
  Local Storage: total: 953.87 GiB used: 81.87 GiB (8.6%) 
  ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKNW010T8H size: 953.87 GiB 
Partition:
  ID-1: / size: 778.45 GiB used: 40.89 GiB (5.3%) fs: ext4 
  dev: /dev/nvme0n1p5 
Sensors:
  System Temperatures: cpu: 43.0 C mobo: 34.0 C gpu: amdgpu temp: 41 C 
  Fan Speeds (RPM): N/A 
Repos:
[...]
Info:
  Processes: 349 Uptime: 1h 13m Memory: 14.98 GiB used: 3.53 GiB (23.5%) 
  Init: systemd runlevel: 5 Compilers: gcc: 9.4.0 Shell: bash v: 5.0.17 
  inxi: 3.0.38 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rickNS
Level 9
Level 9
Posts: 2914
Joined: Tue Jan 25, 2011 11:59 pm

Re: Suspend and hibernate not working

Post by rickNS »

Hi user3456, welcome to Mint forums.

I see a bunch of pages with similar issue for that model.
https://www.google.com/search?q=linux%2 ... +ENVY+x360

Assuming you have done everything correctly in that fist link you posted, there still is a possibility you just won't be able to get hibernate to work.

That said I see an arch thread where it seems some have had success.
https://bbs.archlinux.org/viewtopic.php?id=276100

and one of the first links in that thread https://wiki.archlinux.org/title/Power_management
suggests to go back to a LTS kernel (5.4)

Read all of the thread, and maybe particular reply #8
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
User avatar
SMG
Level 25
Level 25
Posts: 31304
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Suspend and hibernate not working

Post by SMG »

user3456 wrote: Sat May 28, 2022 7:44 amI have a problem on my new HP envy x360 with Linux Mint. In Windows 11 everything is working fine (I have dual boot), but in Linux Mint, suspend doesn't work correctly. If I try by pressing power button, closing lid, selecting in start menu or using

Code: Select all

sudo systemctl suspend
screen and power light turn off, and I can't reactivate the laptop until I hold power button pressed and therefor power it off manually. This seems to have to do with a problem with the new ryzen-processors: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
Welcome to the forum, user3456.

Unfortunately a lot of Ryzens have an issue because of an issue with the amdgpu driver. However, I do not think all of them do. You have a different model than the one provided in the bug report.

I do know quite a few people with very new HP computers have better success with the 5.14-oem kernel than the 5.13. You omitted your repo list so I do not now if you tried installing the AMD website drivers. They will not work with the OEM kernel. If you did not install the AMD website drivers, then I suggest trying the 5.14-oem kernel. Install the latest 5.14-oem kernel with

Code: Select all

sudo apt install linux-oem-20.04d
and reboot.
user3456 wrote: Sat May 28, 2022 7:44 am I followed this tutorial: https://www.linuxuprising.com/2021/08/h ... buntu.html, but most of the time, when I enter

Code: Select all

sudo systemctl hibernate
the computer merely locks screen. I also disabled Windows' quick boot and created a swap file which is big enough. Any help would be much appreceated!
I did not do a close comparison, but that looks mostly similar to the one usually recommended here [GUIDE] How to hibernate to a swap file in Linux Mint 19.x (works on LM20 as well). You might be able to pick out differences easier than I can since you just went through the other process.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
user3456
Level 1
Level 1
Posts: 5
Joined: Sat May 28, 2022 7:14 am

Re: Suspend and hibernate not working

Post by user3456 »

I do know quite a few people with very new HP computers have better success with the 5.14-oem kernel than the 5.13. You omitted your repo list so I do not now if you tried installing the AMD website drivers. They will not work with the OEM kernel. If you did not install the AMD website drivers, then I suggest trying the 5.14-oem kernel. Install the latest 5.14-oem kernel with

Code: Select all

sudo apt install linux-oem-20.04d
and reboot.
Thank you so much, @SMG! I installed the OEM kernel and after some first tests, it seems to work!! :D I even tried using older kernels before, where the old sleep mode was supported, but they of course didn't support my graphics and wifi. And no, I didn't have to install any extra drivers.
user3456
Level 1
Level 1
Posts: 5
Joined: Sat May 28, 2022 7:14 am

Re: Suspend and hibernate not working

Post by user3456 »

Unfortunately, I have to open the topic again. The 5.14 oem kernel worked as a charm for two days, and then suddenly it took several minutes to start and didn't support devices any more (brightness, sound, wifi ...). I removed and reinstalled the oem-kernel, but the problem persisted. A look in the .bash_history told me that besides some ssh-stuff, the only thing I did was to install and then remove Slimbook Battery 4, as it didn't work. Any idea what could have caused this or how to solve it??
User avatar
SMG
Level 25
Level 25
Posts: 31304
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Suspend and hibernate not working

Post by SMG »

user3456 wrote: Tue May 31, 2022 12:02 pm A look in the .bash_history told me that besides some ssh-stuff, the only thing I did was to install and then remove Slimbook Battery 4, as it didn't work. Any idea what could have caused this or how to solve it??
If you only made that one change, then it's likely that caused a problem. Do you have a Timeshift snapshot of when your system was working?

Is this Slimbookbattery what you installed? I always recommend taking a Timeshift snapshot before installing any PPA. Sometimes reverting to the "before" snapshot is the only way to completely remove all the changes a PPA makes.

I see the description indicates, "This update offers new possibilities to the users, thanks to the integration with other applications, services and drivers like TLP, intel_pstate, AMD and NVIDIA." I have no idea how it "integrates" with the AMD driver so I do not know how to check to make sure it "un" integrated properly.

The OEM kernels have some differences from the other Canonical-maintained kernels. There are some differences related to DKMS which is why one should not use the AMD drivers from the AMD website.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
user3456
Level 1
Level 1
Posts: 5
Joined: Sat May 28, 2022 7:14 am

Re: Suspend and hibernate not working

Post by user3456 »

SMG wrote: Tue May 31, 2022 12:29 pm Do you have a Timeshift snapshot of when your system was working?

Is this Slimbookbattery what you installed? I always recommend taking a Timeshift snapshot before installing any PPA. Sometimes reverting to the "before" snapshot is the only way to completely remove all the changes a PPA makes.
Unfortunately, I forgot to make a Timeshift snapshot of this... :oops: It is not unlikely that the program (it is the one you linked) has done some harm. At least, it didn't work to click "Accept"-Button (see image on the GitHub page). I installed it with

Code: Select all

sudo add-apt-repository ppa:slimbook/slimbook
sudo apt update
sudo apt install slimbookbattery
and when it didn't work uninstalled it with

Code: Select all

sudo apt purge slimbookbattery
sudo apt remove-repository ppa:slimbook/slimbook
Is there any other possibility than going back to the last Timeshift snapshot and installing the oem kernel from there?
User avatar
SMG
Level 25
Level 25
Posts: 31304
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Suspend and hibernate not working

Post by SMG »

user3456 wrote: Tue May 31, 2022 1:50 pmIs there any other possibility than going back to the last Timeshift snapshot and installing the oem kernel from there?
Timeshift is usually the fastest way to get things working again.

The fact everything worked properly for two days then everything was broken indicates the issue of this topic was resolved. The current situation is a new problem and should be its own topic where all the problems are described and you list what you have done.

My guess is the problem is somehow related to DKMS, but I have no clue what that PPA affects so I have no idea where to look for changes that need undone.

Is there anything in the history which explains what was installed after you ran the installation commands?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
user3456
Level 1
Level 1
Posts: 5
Joined: Sat May 28, 2022 7:14 am

Re: Suspend and hibernate not working

Post by user3456 »

I couldn't find anything but the program. I reinstalled LM 20.3 with the kernel you recommended, and everything works fine again so far. Thank you for your help! Obviously, the program Slimbook Battery 4 did really crash the drivers...
Locked

Return to “Other topics”