0

This question already has an answer here:

I just installed Elementary OS Loki on my laptop. I love the OS, however my battery drains very fast. On a full charge, I only have have an hour of 3 to go. My previous installation of Elementary (Freya) could go for an hour of 5. How can I increase battery life?

I followed already the suggestions here How to optimize elementary OS for maximal battery life time on laptops?, however they don't seem to have any effect on Loki. inxi -G reports my Intel HD graphics are in use (and not my nvidia GPU). Powertop reports the following: Powertop output

Any help to get my battery life back?

My specs are:

  • Intel i5-6440HQ CPU
  • SSD with HDD (turned off almost all the time)
  • nVidia GTX 960M

Thanks!

marked as duplicate by Daniel Foré Sep 23 '16 at 20:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

If you have inxi 2.3.0 or later, it supports battery condition output:

inxi -B
Battery    BAT1: charge: 39.4 Wh 90.9% condition: 43.3/49.0 Wh (88%)

This is very useful to at a glance discover your actual battery capacity (condition:...).

You'd be surprised at how quickly you can lose battery capacity, depending on your use and charging patterns, basically a lithium ion battery loses capacity at every charge, it varies, but you have between 500 and 1000 full charges. Trickle charging I believe drains the actual capacity even more, but you can google questions about how to maximize battery life/capacity over time, that's a different question.

When I first checked all my battery capacity, I was actually shocked to learn how much capacity some of my batteries had lost, some were only at 15% of original, which means, less than 1 hour actual life, for example.

There other ways of getting battery information, inxi for example gets the data directly from /sys, which is where all tools get it as far as I know.

Note that a standard battery icon monitor in your taskbar will NOT show you the capacity state, it will show you the percent charged of the real capacity, for example, if you are at 50% capacity, and your battery monitor shows 98% charged, that means that you have 49% of your original starting capacity of 100% available.

To see what your system is doing when it's just running, run:

htop

or

top

to see cpu use.

inxi can also show you top cpu processes like this:

inxi -xtc20

which will show you your top 20 processes sorted by cpu consumption.

ps aux also will show you this but it's harder to read.

If you're seeing anything that is running at any significant cpu percent (firefox/chrome are frequent culprits, with out of control javascript stuff running in multiple tabs, can quite easily spike cpu to 100%, or at least 50%, and keep it there. Solution: noscript, flashblock)

In answer to your question, is there any way to get the battery life back, no, there probably is not, it's a physical event that happens either around the cathodes or anodes of the battery, I forget, but basically that breaks down internally and loses its ability to transfer more and more of battery power, which is why all the rechargeable lithion, nickel metal hydride, etc, type batteries steadily lose capacity over their lives, from the first charge on basically. Some people claim you can condition them, which is worth trying since it doesn't cost anything, but I haven't personally found that helps much, but it's worth trying, but if you have 50% capacity, that's what you have.

  • Thanks for your reply! My battery has 87% of its original capacity, so that doesn't seem te be the cause. The CPU usage of Xorg is quite high, next in the list is Gala. Is this normal? The 5 hours where I speakt about was only a week or 3 ago, I think it has something to do with Elementary because I didn't notice any change on Windows (which still has about 5 hours, like Freya before). – Brent Thierens Sep 19 '16 at 9:06
  • In powertop I also noticed btusb consumes 1.5W, what exactly is this? My bluetooth is turned off. – Brent Thierens Sep 19 '16 at 9:15
  • your battery at 87% is fine, but anything that runs out of control is not fine, like Xorg. Make sure you have NOTHING that autoupdates running on your desktop as a widget, except for very low cpu stuff like frequency monitors, battery monitors, etc, in taskbar. Xorg does not use very much unless you have something wrong or spinning it out of control. Right now for example, inxi -xtc20 shows: 8: cpu: 0.7% command: Xorg pid: 6952 mem: 221.00MB (2.7%) which means right now, with tons of stuff open 8 virtual desktops running, heavy programs, xorg uses 0.7% of 100% cpu – Lizardx Sep 19 '16 at 21:44
  • disable bluetooth in bios/uefi, if possible, disable everything not used, that all takes power, but 1.5 watts is not a lot of drain. but it is something. My suspicion is that whatever in linux you used to disable bluetooth simply disables the software running it, but doesn't actually touch the core hardware. – Lizardx Sep 19 '16 at 22:20
  • It seems that Xorg was refreshing my browser window even when it was minimized. Since Youtube was playing, I guess that caused the 7% CPU usage. But even with nothing open, I do notice any change. Is it possible that for some reason my nvidia is not disabled? I notice that the card becomes somewhat warm, which isn't the case under Windows. On my previous installation, I had bumblebee installed. However, running everything on the integrated graphics of Intel should do the same, not? So could it be that something still runs on the dedicated graphics card? – Brent Thierens Sep 21 '16 at 8:50
0

I figured out what the main reason was. In case it might help someone: despite the fact that the driver for the screen was pointed to my Intel integrated GPU, my nVidia GPU was still using lots of power. I disabled it via an ACPI call. First check which VGA devices are in use:

lspci | grep VGA

This will show all the GPU's. Notice the state (rev xx, mine is rev a2 for the nVidia one).

The following commands worked for me:

sudo apt install acpi-call
sudo modprobe acpi_call

This method requires you to have the Linux headers already installed for your kernel, which was the case for me. Then run the following sh script:

#!/bin/bash

if lsmod | grep -q acpi_call; then
methods="
\_SB.PCI0.P0P1.VGA._OFF
\_SB.PCI0.P0P2.VGA._OFF
\_SB_.PCI0.OVGA.ATPX
\_SB_.PCI0.OVGA.XTPX
\_SB.PCI0.P0P3.PEGP._OFF
\_SB.PCI0.P0P2.PEGP._OFF
\_SB.PCI0.P0P1.PEGP._OFF
\_SB.PCI0.MXR0.MXM0._OFF
\_SB.PCI0.PEG1.GFX0._OFF
\_SB.PCI0.PEG0.GFX0.DOFF
\_SB.PCI0.PEG1.GFX0.DOFF
\_SB.PCI0.PEG0.PEGP._OFF
\_SB.PCI0.XVR0.Z01I.DGOF
\_SB.PCI0.PEGR.GFX0._OFF
\_SB.PCI0.PEG.VID._OFF
\_SB.PCI0.PEG0.VID._OFF
\_SB.PCI0.P0P2.DGPU._OFF
\_SB.PCI0.P0P4.DGPU.DOFF
\_SB.PCI0.IXVE.IGPU.DGOF
\_SB.PCI0.RP00.VGA._PS3
\_SB.PCI0.RP00.VGA.P3MO
\_SB.PCI0.GFX0.DSM._T_0
\_SB.PCI0.LPC.EC.PUBS._OFF
\_SB.PCI0.P0P2.NVID._OFF
\_SB.PCI0.P0P2.VGA.PX02
\_SB_.PCI0.PEGP.DGFX._OFF
\_SB_.PCI0.VGA.PX02
\_SB.PCI0.PEG0.PEGP.SGOF
\_SB.PCI0.AGP.VGA.PX02
"

for m in $methods; do
    echo -n "Trying $m: "
    echo $m > /proc/acpi/call
    result=$(cat /proc/acpi/call)
    case "$result" in
        Error*)
            echo "failed"
        ;;
        *)
            echo "works!"
            # break # try out outher methods too
        ;;
    esac
done

else
    echo "The acpi_call module is not loaded, try running 'modprobe acpi_call' or 'insmod acpi_call.ko' as root"
    exit 1
fi

If you are lucky, one of of the lines will end at 'works!'. Running lspci | grep VGA again and look at the rev. It should now say rev ff. This means your card is disconnected. This needs to be done every system boot. So you may want to add the following line to /etc/rc.local which will automate this vor you:

modprobe acpi-call

and then place the script above. You may remove all others except the one that worked for you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.