6

My computer drains a lot of battery when in sleep mode.

I've tried following the steps outlined in this bug report, tried the diagnosis layed out in this question and disabled the "sign of life" options in the BIOS as described here.

I confirmed my system sleeps in the s2idle state. Which I suspect is the problem.

$ sudo journalctl | grep "PM: suspend" | tail -2
May 13 18:41:00 mex kernel: PM: suspend entry (s2idle)
May 13 20:52:36 mex kernel: PM: suspend exit

However I have 2 issues when trying to follow the above guides: Firstly my /sys/power/mem_sleep file does not contain a deep option:

sudo cat /sys/power/mem_sleep
[s2idle]

And secondly I can't seem to edit the file to add a deep option:

$ echo deep | sudo tee /sys/power/mem_sleep
deep
tee: /sys/power/mem_sleep: Invalid argument
$ sudo sh -c 'echo deep > /sys/power/mem_sleep'
sh: 1: echo: echo: I/O error

Not being able to close the lid and have the laptop suspend is very annoying, I find... Any help on this would be greatly appreciated.

OS: Ububntu 20.04, 5.8.0-26-generic / Hardware: Dell XPS 13 9310

shiftux
  • 91

2 Answers2

5

Welcome to askubuntu!

I have asked a member of the Dell Linux team about this issue. I got the following answer: "XPS 9310 only offers Modern Standby for Windows and Suspend to Idle for Linux." This means deep sleep is not supported by the firmware on this machine.

Furthermore it was noted that you should use the OEM kernel as it contains fixes for the power draw issue not yet upstream, though the fixes are expected to land upstream in Linux 5.10.

So try to install linux-oem-20.04 as this should contain fixes. Let me know if the power draw is better :-).

Edit: To try the Linux kernel from proposed, you could do the following:

mkdir kernel-5.10 && cd kernel-5.10
wget http://archive.ubuntu.com/ubuntu/pool/universe/l/linux-signed-oem-5.10/linux-image-5.10.0-1002-oem_5.10.0-1002.3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/l/linux-oem-5.10/linux-headers-5.10.0-1002-oem_5.10.0-1002.3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/l/linux-oem-5.10/linux-modules-5.10.0-1002-oem_5.10.0-1002.3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/l/linux-oem-5.10/linux-oem-5.10-headers-5.10.0-1002_5.10.0-1002.3_all.deb
sudo apt install ./*.deb

This set of commands creates a directory where the kernels are downloaded into from the official ubuntu proposed repos. Then apt asks for your permissions to install the packages.

NOTE: If for some reason you fail to boot your system, choose advanced options when booting and select the old kernel and just remove the packages again you installed here. I tested those instructions on an older XPS system and it worked fine for me.

Edit 2 Additional info for suspend to idle: The older XPS 9360 supports both deep sleep and suspend to idle. Since quite some time suspend to idle is configured default in Ubuntu for this machine. I've never actually used it though, I always went for classical deep sleep. Now I've tested it and it performs better than deep sleep on this machine: Waking up from suspend is very much faster and the power draw is roughly the same compared to deep sleep (around 2% in 8 hours).

Esokrates
  • 920
  • 10
  • 25
  • Thanks for the detailed answer @Esokrates! Very disappointing to hear that... Why would anyone want to forgo proper and classic sleep on Linux??? Not sure I'd have bought this product if I'd have known. How has the new kernel worked out for you? – shiftux Nov 10 '20 at 09:45
  • just checked, apparently I am already on a OEM kernel, but I only find version 5.8...
    $ sudo apt search linux-oem-20.04 ----->
    linux-oem-20.04/groovy-updates,now 5.8.0.26.31 amd64 [installed]
    
    – shiftux Nov 10 '20 at 10:09
  • @shiftux I feel your pain. I don't have the machine but I'm evaluating whether I should get one. It looks like vendors such as Lenovo and Dell deprecate S3 as s0ix should be a successor, see https://01.org/blogs/qwang59/2018/how-achieve-s0ix-states-linux If Intels claims are right the power draw should not be significantly more if the deepest state is actually reached. Could you try the 5.10 Linux oem kernel as there are listed quite some changes here with regard to Dell and s0ix: https://launchpad.net/ubuntu/+source/linux-oem-5.10/5.10.0-1002.3 – Esokrates Nov 10 '20 at 11:26
  • Are your sure you are on 20.04? Groovy is 20.10. According to https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1902687 the oem kernel in focal-proposed should contain patches, maybe try that kernel and report your problems in that bug. – Esokrates Nov 10 '20 at 11:33
  • So to sum up: Please make sure you have Ubuntu 20.04 (Focal) installed, enable the proposed repo and install linux-oem-5.10. It should be available there, see http://azure.archive.ubuntu.com/ubuntu/dists/focal-proposed/main/signed/linux-oem-5.10-amd64/ Would be nice if you can report back afterwards. How bad is the battery drain in your case (how much do you loose in 1 hour)? Please check the system log for error mentioned in the bug report. – Esokrates Nov 10 '20 at 11:39
  • BTW it seems HP is doing the same on comparable hardware: https://h30434.www3.hp.com/t5/Notebook-Operating-System-and-Recovery/Missing-S3-sleep-state/td-p/7748582 So it would be really great if you could verify whether you can really reach the deepest state of s0ix. If so and the power draw is really low I think the move is acceptable, although personally I think it is a bad idea to completely drop the option for S3. – Esokrates Nov 10 '20 at 13:09
  • yeah, i'm on groovy now are oem kernels always just available for LTS releases? i'll measure the drain when i get around to it and report back... – shiftux Nov 11 '20 at 08:42
  • @shiftux Yeah looks like the 5.10 kernel is only available in focal-proposed for now. You could do the dirty trick of downloading the kernel package from that repo and install it manually, though that's your own responsibility, if something breaks. I can't tell how much of an advanced user you are. If you are new to this kind of stuff I'd recommend a fresh install of 20.04. – Esokrates Nov 11 '20 at 08:52
  • i am new to dealing with kernels. and a bit reluctant to go through a whole fresh install again... when should the regular 5.10 kernel be out ? thanks for all your great insight BTW! amazing! – shiftux Nov 11 '20 at 12:24
  • @shiftux As the comment section gets pretty full, I have now updated the answer with instructions to install the 5.10 kernel from the proposed repository. Let me know how it works out for you and please tell me how the power draw in suspend is for you! – Esokrates Nov 15 '20 at 00:11
  • Thank you for your edits! In the meantime I have played around with a couple of BIOS settings and indeed the s2idle sleep now seems to work better (9% drain in ~24h). still on the 5.8 kernel. I've stared another discussion and shared some updates here: https://www.dell.com/community/XPS/Ubuntu-deep-sleep-missing-for-xps-9310/td-p/7734008/highlight/false – shiftux Nov 16 '20 at 09:26
0

I had the same problem on Ubuntu 22.04, Dell Inspiron 15, where the deep suspend seem not to be supported by the manufacturer. Updating Linux kernel (e.g. following https://linuxhint.com/install-upgrade-latest-kernel-ubuntu-22-04/) made the battery drain much better.