Hibernate On Low Battery - Not Working Properly on Gnome

Hello Everyone,

I installed Manjaro Gnome a few weeks ago (Fresh install, was a previous Manjaro KDE user), on my Dell XPS 13 laptop. I am having an issue with hibernate not working when reaching a critical low battery.

The Issue:
I’ve noticed that when my laptop battery reaches about 3%, I get a system message saying the system will enter hibernation mode very soon. Oddly, it seems that the computer goes into standby / suspend mode, because I can wake up the computer with the mouse, and does NOT enter hibernate mode. I tested and made sure hibernate works (by running systemctl hibernate) and the computer does hibernate properly without any issues when running the command manually in the terminal.

The Problem:
So, the main issue is the computer enters standby / suspend and not hibernate when the battery reaches 3%. I haven’t done much in terms of custom configurations, and it APPEARS that it should enter hibernate according to the system message that pops up on the screen. What should I do to check if things are setup correctly, and to fix the actual problem and have the computer enter hibernate when the battery reaches 3%?

Any help would be greatly appreciated. Thanks in advance to anyone who can help me figure this out.

  1. What’s the output of:

    gsettings list-recursively | grep power
    
  2. It’s always a good idea to post the output of an inxi --admin --verbosity=7 --filter --no-host --width with any question you ask as that gives us more information on your system.

:thinking:

Output:

gsettings list-recursively | grep power                                                                                                                         
org.gnome.settings-daemon.plugins.media-keys power ['']
org.gnome.settings-daemon.plugins.media-keys power-static ['XF86PowerOff']
org.gnome.ControlCenter last-panel 'power'
org.gnome.desktop.notifications application-children ['gnome-power-panel', 'firefox', 'discord', 'brave-browser', 'org-gnome-nautilus', 'org-manjaro-pamac-manager', 'spotify', 'teams-for-linux', 'variety', 'guake', 'gnome-printers-panel', 'org-gnome-chromegnomeshell']
org.gnome.settings-daemon.plugins.power idle-dim true
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power ambient-enabled true
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 1800
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 1200
org.gnome.settings-daemon.plugins.power power-button-action 'hibernate'
org.gnome.Lollypop power-management 'suspend'

Output:

inxi --admin --verbosity=7 --filter --no-host --width                                                                                                          
System:
  Kernel: 5.9.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.1 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 
  root=UUID=501de8bc-72f3-4eb8-8dd8-eb0381f16ebc ro 
  resume=UUID=2314cba6-fa6e-443b-8fc2-de4d6ad99ffe apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: GNOME 3.38.3 tk: GTK 3.24.24 wm: gnome-shell dm: GDM 3.38.2.1 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: Dell product: XPS 13 9350 v: N/A serial: <filter> 
  Chassis: type: 9 serial: <filter> 
  Mobo: Dell model: 076F9T v: A00 serial: <filter> UEFI: Dell v: 1.13.0 
  date: 02/10/2020 
Battery:
  ID-1: BAT0 charge: 11.5 Wh condition: 33.9/57.5 Wh (59%) volts: 7.4/7.6 
  model: SMP DELL JHXPY53 type: Li-poly serial: <filter> status: Discharging 
Memory:
  RAM: total: 7.64 GiB used: 2.78 GiB (36.4%) 
  RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:
  Info: Dual Core model: Intel Core i5-6200U bits: 64 type: MT MCP 
  arch: Skylake family: 6 model-id: 4E (78) stepping: 3 microcode: E2 
  L2 cache: 3 MiB bogomips: 19204 
  Speed: 500 MHz min/max: 400/2800 MHz Core speeds (MHz): 1: 500 2: 500 3: 500 
  4: 500 
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon art 
  avx avx2 bmi1 bmi2 bts clflush clflushopt cmov constant_tsc cpuid 
  cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est 
  f16c flexpriority flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window 
  hwp_epp hwp_notify ibpb ibrs ida intel_pt invpcid invpcid_single lahf_lm lm 
  mca mce md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx pae pat 
  pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts 
  rdrand rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1 
  sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust 
  tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt 
  xsaves xtopology xtpr 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel Skylake GT2 [HD Graphics 520] vendor: Dell driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:1916 
  Device-2: Microdia Integrated Webcam HD type: USB driver: uvcvideo 
  bus ID: 1-5:3 chip ID: 0c45:670c 
  Display: wayland server: X.org 1.20.10 compositor: gnome-shell driver: 
  loaded: intel unloaded: modesetting alternate: fbdev,vesa display ID: 0 
  resolution: <missing: xdpyinfo> 
  OpenGL: renderer: Mesa Intel HD Graphics 520 (SKL GT2) v: 4.6 Mesa 20.3.3 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Dell driver: snd_hda_intel 
  v: kernel alternate: snd_soc_skl bus ID: 00:1f.3 chip ID: 8086:9d70 
  Sound Server: ALSA v: k5.9.16-1-MANJARO 
Network:
  Device-1: Intel Wireless 8260 driver: iwlwifi v: kernel port: f040 
  bus ID: 3a:00.0 chip ID: 8086:24f3 
  IF: wlp58s0 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: link 
  WAN IP: <filter> 
RAID:
  Message: No RAID data was found. 
Drives:
  Local Storage: total: 238.47 GiB used: 22.61 GiB (9.5%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: PM951 NVMe 256GB 
  size: 238.47 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 serial: <filter> rev: BXV77D0Q temp: 27.9 C 
  Message: No Optical or Floppy data was found. 
Partition:
  ID-1: / raw size: 79 GiB size: 77.26 GiB (97.80%) used: 15.92 GiB (20.6%) 
  fs: ext4 dev: /dev/nvme0n1p6 maj-min: 259:6 label: N/A 
  uuid: 501de8bc-72f3-4eb8-8dd8-eb0381f16ebc 
  ID-2: /boot/efi raw size: 100 MiB size: 96 MiB (96.00%) 
  used: 26.6 MiB (27.7%) fs: vfat dev: /dev/nvme0n1p2 maj-min: 259:2 
  label: N/A uuid: 7294-110C 
  ID-3: /home raw size: 80 GiB size: 78.24 GiB (97.81%) used: 5.67 GiB (7.2%) 
  fs: ext4 dev: /dev/nvme0n1p5 maj-min: 259:5 label: N/A 
  uuid: 82acc9d6-e635-41ea-86f7-b8d09946a03e 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 3.84 GiB used: 1022.5 MiB (26.0%) 
  priority: -2 dev: /dev/nvme0n1p7 maj-min: 259:7 label: N/A 
  uuid: 2314cba6-fa6e-443b-8fc2-de4d6ad99ffe 
Unmounted:
  ID-1: /dev/nvme0n1p1 maj-min: 259:1 size: 499 MiB fs: ntfs label: N/A 
  uuid: 4CB29579B295686A 
  ID-2: /dev/nvme0n1p3 maj-min: 259:3 size: 16 MiB fs: <superuser required> 
  label: N/A uuid: N/A 
  ID-3: /dev/nvme0n1p4 maj-min: 259:4 size: 75.04 GiB fs: ntfs label: DRIVE 
  uuid: 022401A424019C33 
USB:
  Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 12 rev: 2.0 
  speed: 480 Mb/s chip ID: 1d6b:0002 
  Device-1: 1-3:2 info: Intel Bluetooth wireless interface type: Bluetooth 
  driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s chip ID: 8087:0a2b 
  Device-2: 1-5:3 info: Microdia Integrated Webcam HD type: Video 
  driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s chip ID: 0c45:670c 
  Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 6 rev: 3.0 speed: 5 Gb/s 
  chip ID: 1d6b:0003 
Sensors:
  System Temperatures: cpu: 31.0 C mobo: 26.0 C sodimm: SODIMM C 
  Fan Speeds (RPM): cpu: 0 
Info:
  Processes: 312 Uptime: 1d 18m wakeups: 8 Init: systemd v: 247 Compilers: 
  gcc: 10.2.0 Packages: pacman: 1402 lib: 424 flatpak: 0 Shell: Zsh v: 5.8 
  running in: gnome-terminal inxi: 3.2.02
  1. In the future, when providing code/output, please copy-paste that output in-between 3 backticks ``` at the beginning and end of the code/text so that the output looks like this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    

    instead of like this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    (as that makes both our lives much easier)

  2. No need to do anything right now as I’m an editor here on this site and have fixed it for you already. However, in the future I might not see your post so review my edits by pushing the orange pencil above the post I just fixed. :wink:

  3. output of gsettings list-recursively | grep battery, please?

  4. Kernel: 5.9.16-1-MANJARO is EOL. Please upgrade to 5.4 LTS and / or 5.10 (LTS candidate).

  5. BAT0 charge: 11.5 Wh condition: 33.9/57.5 Wh (59%) volts: 7.4/7.6 : your battery is reaching EOL too. 3% is too low. Once I receive #3 above you’ll be better set it to 10% to avoid catastrophic shutdowns.

  6. Unrelated to your issue (just a preference of mine): Kernel: swappiness: 60 (default) cache pressure: 100 (default): better set those to 90 and 75 respectively.

:thinking:

1 & 2. Thanks for the tip and correcting my post! I appreciate it! =)

  1. gsettings list-recursively | grep battery output:
    ~  gsettings list-recursively | grep battery                                                                                                                        
org.gnome.settings-daemon.plugins.media-keys battery-status-static ['XF86Battery']
org.gnome.settings-daemon.plugins.media-keys battery-status ['']
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 1800
org.freedesktop.Tracker3.Miner.Files index-on-battery-first-time true
org.freedesktop.Tracker3.Miner.Files index-on-battery true
org.gnome.desktop.interface show-battery-percentage true
org.freedesktop.Tracker.Miner.Files index-on-battery-first-time true
org.freedesktop.Tracker.Miner.Files index-on-battery true
  1. I am now on the latest 5.10 LTS Kernel:
Kernel: 5.10.7-3-MANJARO
  1. Sounds good.

  2. Can I ask what these kernel settings / properties are for? Also, what are the exact commands I need to run to update these correctly?

Thanks again for all of your time and help, it is greatly appreciated!

  1. I used to tun Gnome (on KDE now) and just did those from memory, but I can’t seem to find the right parameter, so I’ve edited your title and added the Gnome tag to attract people who can test this on a current version of Gnome (And why I left Gnome: Functionality that existed before seems to have gone away) :sob:
  2. Good! (Any difference? If not: have you tried 5.4 already?)
  3. :slight_smile:
  4. In a nutshell: Swap later and once swapped out, don’t try to immediately swap in again. Details:
     fab-user@fab-manjaro:~
     $ cat /etc/sysctl.d/30-swap_usage.conf
     # Fabrizio: 2014-03-02: change "swappiness" from default 60 to 10:
     #  Theoretically, only swap when RAM usage reaches around 80 or 90 percent
     # Fabrizio: 2014-03-29: lower to 5 as swapping is still occurring with low mem usage
     # Fabrizio: 2014-11-21: Bring back up to 10 as vm.vfs_cache_pressure was introduced 
     vm.swappiness = 10
    
     # Fabrizio: 2014-11-29: Lower vm.vfs_cache_pressure to 75%
     # (once cached, probably not immediately needed any more)
     #
     # This percentage value controls the tendency of the kernel to reclaim
     # the memory which is used for caching of directory and inode objects.
     #
     # At the default value of vfs_cache_pressure=100 the kernel will attempt to
     # reclaim dentries and inodes at a "fair" rate with respect to pagecache and
     # swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer
     # to retain dentry and inode caches.
     vm.vfs_cache_pressure = 75
    

Interesting, I do not have this file:

/etc/sysctl.d/30-swap_usage.conf

Not sure why it’s not there. Are you saying this is a custom config file you created?

So mini-update:

Update #1:
I re-ran the hibernate test (under 5.10.x Kernal), it appears that the issue still exists (laptop goes into standby instead of hibernate mode) when the battery is at critical low levels.

Update #2:
I also forgot to add, that I did modify a few configs to enable a power management setting for when I close the laptop lid (and the machine goes into standby, this is expected), I also wanted the machine to go into hibernate after a specific period of time (60-min). Specifically, for the laptop to go into ‘suspend then hibernate’ functionality.

To achieve this, I followed the steps outlined by “PRIHLOP” in the following post here:

By modifying the sleep.conf and the logind.conf config files, I was able to get this working PERFECTLY as expected. However, I mention it because maybe that’s the issue preventing the laptop from going into Hibernate on low-battery, even though the Manjaro System displays a message that it wants to hibernate on low-battery:
Imgur

If I can provide any additional details to help in the troubleshooting process, please let me know. Thank you in advance to everyone for your time and help, it is greatly appreciated!

2 Likes

Yes, to override the defaults.

As already stated: I’m at the end of my knowledge on Gnome…

:sob:

I just found out something, so coming back to you on this.

What is the output of:

grep "resume"  /etc/mkinitcpio.conf

:question:

Hey Fabby! Output is below:

grep "resume"  /etc/mkinitcpio.conf                                                                                                                      
HOOKS="base udev autodetect modconf block resume keyboard keymap plymouth filesystems"

I know I threw resume in there if that’s what you wanted to check. =)

1 Like

I’m confused… Did you add resume in mkinitcpio.conf before or after the grep? or was it there already? (If it was there already, I can’t help you any further as that was the missing bit for someone else…)

:thinking:

I added the ‘resume’ to mkinitcpio.conf a few weeks ago to get hibernate to work. So, when you asked me yesterday to check if it exists, it was already there. =)

Please let me know if that’s clear or not.

1 Like

Did you also execute the required:

sudo mkinitcpio --preset MyKernel

Where MyKernel is all of the kernels you see when executing:

ls -1 /boot/linux*

I.E. In my case that gives me:

ls -1 /boot/linux*
/boot/linux510-x86_64.kver
/boot/linux54-x86_64.kver

so I have to execute:

sudo mkinitcpio --preset linux510 
sudo mkinitcpio --preset linux54

:question:

Wasn’t sure, so I just ran through these commands again. “Image generation successful” at the bottom of each one.

Now to test I assume?

1 Like

I hope you’re not awaiting my approval to just reboot your machine and test again!

:crazy_face:

  • You should have rebooted and tested already!
  • Does it work now?
  • Hey, where are you???

:joy: :wink:

Well, I have to wait for my battery to wear down to less than 10% (currently at 90%). So, it’ll take some time to get the battery worn down so I can test the use-case properly. =)

1 Like

Well, on an: Intel Core i5-6200U, this should start draining your battery pretty quickly:

stress-ng --cpu 4 --timeout 6000

:stuck_out_tongue_winking_eye:

(pamac install stress-ng if the above would give you a -bash: stress-ng: command not found)

Update:
So, finally hit the magic 3% battery life mark, and got the usual hibernate system message, annnnddd the computer went into STANDBY mode (not hibernate). So, looks like this is still an issue so far.

Not sure what else to try at this point. If anyone else has any suggestions / feedback / thoughts, please let me know.

Thank you!

I’m on KDE, so helped you as much as I could from memory back when I was still running Gnome, so I’m all out of bright ideas!

:sob: