You are not logged in.

#1 2016-05-15 15:36:32

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

PowerTOP for better battery consumption

PowerTOP is an interactive terminal program used for analysing system power consumption and will "tune" power usage via sysctl parameters whilst offering a real-time display.
https://packages.debian.org/jessie/powertop

Install it with:

sudo apt install powertop

Usefully, it also offers a "--auto-tune" feature whereby all the parameters are switched to minimum to save as much power as possible.

To enable this feature automatically at boot up, create a custom unit file at /etc/systemd/system/powertop.service (as root!) with the following content:

[Unit]
Description=Powertop tunings

[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/sbin/powertop --auto-tune
Environment="TERM=xterm"

[Install]
WantedBy=multi-user.target

Enable the unit to start at boot with:

sudo systemctl enable powertop.service

To disable the unit file from starting, use:

sudo systemctl disable powertop.service

Query status with:

sudo systemctl status powertop.service

Offline

#2 2016-05-15 16:39:55

ghorvath
Member
Registered: 2015-10-01
Posts: 161

Re: PowerTOP for better battery consumption

Just a small correction: Powertop suggests laptop-mode-tools, they are not exclusive.

I remember that I installed laptop-mode-tools with default settings, then I installed powertop to check if some things need to be tweaked. There were only 2 things mentioned. One of the suggestions was actually worse than the laptop-mode-tools setting (with dirty_writeback_centisecs ?), the other was about some audio settings, that did not make much difference one way or another. So yeah, laptop-mode-tools with basic settings satisfied PowerTOP.

Offline

#3 2016-05-19 20:40:07

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: PowerTOP for better battery consumption

Is Powertop with laptop-mode-tools a bit better than tlp?

Offline

#4 2016-05-20 06:26:12

kleiner_hussar
Member
From: Traunstein, Germany
Registered: 2016-04-25
Posts: 82

Re: PowerTOP for better battery consumption

martix wrote:

Is Powertop with laptop-mode-tools a bit better than tlp?



In my opinion they are the same. Both are setting the same values but from a different approach, miracles doesn't happen :-)
I use pm-utils with some additions (it is easily hackable) and powertop for checking the power saving state.

Last edited by kleiner_hussar (2016-05-20 06:42:31)

Offline

#5 2016-05-20 08:01:24

ghorvath
Member
Registered: 2015-10-01
Posts: 161

Re: PowerTOP for better battery consumption

martix wrote:

Is Powertop with laptop-mode-tools a bit better than tlp?

Install one, test it, then remove, install the other, and test, as well. Whichever works for you.

I personally have no experience comparing them, because I always only installed laptop-mode-tools, and it works all right. My reasons were: I read somewhere that pm-utils were originally developed mostly for suspending/hibernating machines, which is not an issue anymore, and it is updated less frequently than laptop-mode-tools (I might be wrong on both counts). Further, tlp is currently not in the stable repos. So I went with laptop-mode-tools, which I think brought in PowerTOP as dependency/recommend.

Offline

#6 2016-06-02 23:26:35

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: PowerTOP for better battery consumption

I tried both in the end: laptop-mode-tools wins the race! At least on my machine it works definitely better than tlp. Btw it comes without powertop, so I installed it on top of it. So far this is the best tool I used for optimized battery consumption.

Offline

#7 2016-06-02 23:43:03

Eraph
Member
From: /au/qld/bne
Registered: 2016-02-29
Posts: 282
Website

Re: PowerTOP for better battery consumption

martix wrote:

I tried both in the end: laptop-mode-tools wins the race! At least on my machine it works definitely better than tlp. Btw it comes without powertop, so I installed it on top of it. So far this is the best tool I used for optimized battery consumption.

Interesting. Did it take much tinkering, or did you notice immediate improvements? I've found tlp to be quite good anyway, so I'm intrigued to see if laptop-mode-tools can push battery performance even further.


Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD

Offline

#8 2016-06-03 19:57:07

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: PowerTOP for better battery consumption

Eraph wrote:

Interesting. Did it take much tinkering, or did you notice immediate improvements? I've found tlp to be quite good anyway, so I'm intrigued to see if laptop-mode-tools can push battery performance even further.

Tinkering? 30 seconds -> immediate improvement.    smile    It's easy as there is a gui with all the options and a short description. As root:

  lmt-config-gui 

Powertop is easy to use too. After starting it by "powertop" one can use the tabulator in order to go to the tunables. I'd say tlp brings around 10-15% more battery life, lmt and powertop around 15-20% (at least on my machine).

Offline

#9 2016-07-03 19:25:12

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: PowerTOP for better battery consumption

There is one more useful command. You can tinker powertop just by starting it and moving via tab to the last section or via

powertop --auto-tune

This sets all the possible options to the optimized state. I did not figure out yet though how to use it on autostart. Maybe someone can chime in...

Offline

#10 2016-07-03 20:35:14

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: PowerTOP for better battery consumption

Hey martix smile

martix wrote:

I did not figure out yet though how to use it on autostart

You need to create a custom systemd unit file and enable it, see this post for details:
https://forums.bunsenlabs.org/viewtopic … 285#p27285

Offline

#11 2016-07-04 05:40:12

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: PowerTOP for better battery consumption

imho battery consumption is one of the real problems to explain/try to fix (and not that whiny dw review ones). Q: Is it possible to measure energy consumption of a virtual machine? Would that even make sense? How do you test that properly on the real hardware?

Last edited by brontosaurusrex (2016-07-04 05:41:03)

Offline

#12 2016-07-04 07:12:08

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: PowerTOP for better battery consumption

brontosaurusrex wrote:

Is it possible to measure energy consumption of a virtual machine?

You could try running powertop in the host and checking the consumption of the emulator.

Would that even make sense?

I'm not sure hmm

Offline

#13 2016-07-04 16:18:32

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: PowerTOP for better battery consumption

Head_on_a_Stick wrote:

You need to create a custom systemd unit file and enable it, see this post for details

Thank you! I must have been blind, the tuto is in the thread already. It works great! The only detail I noticed is that it complains about "Cannot load from file /var/cache/powertop/saved_parameters.powertop" after starting powertop but it does not seem to affect usability. I'm just wondering: What is the meaning of this line:   Environment="TERM=xterm"    in the service file? I'm just asking as there is no xterm installed, but it's still working fine.

Last edited by martix (2016-07-04 16:28:20)

Offline

#14 2016-07-04 17:24:39

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: PowerTOP for better battery consumption

martix wrote:

it complains about "Cannot load from file /var/cache/powertop/saved_parameters.powertop"

Yeah, it just needs time to gather more data.

If the message bothers you, try running:

sudo powertop --calibrate
martix wrote:

What is the meaning of this line:   Environment="TERM=xterm"    in the service file?

There is (or perhaps was) a bug in the powertop package that requires a terminal session to be run when `--autotune` is doing it's thing.

It may not be needed any more, you could try removing the line and see if it still starts correctly.

Offline

#15 2016-07-04 18:42:33

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: PowerTOP for better battery consumption

Head_on_a_Stick wrote:

If the message bothers you, try running:

sudo powertop --calibrate

It may not be needed any more, you could try removing the line and see if it still starts correctly.

I tried the calibrate command. Just a warning to other users: It will close down everything! First I thought it's a crash, but after a while I could log in again. In the end it did work fine (although that powertop message is still there).


I tried to remove that line and it does NOT work in that case (failed to start message at boot). So it's still necessary. It seems to be a bit strange though as there is no xterm on my machine (probably it uses the terminal anyway).

Offline

#16 2016-07-04 18:47:28

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: PowerTOP for better battery consumption

martix wrote:

Just a warning to other users: It will close down everything!

Ah yes, sorry about that -- I should have warned you about the screen blanking :8

martix wrote:

It seems to be a bit strange though as there is no xterm on my machine

It's just a hack really, the program needs $TERM set to work correctly; xterm itself is not invoked at all.

Offline

#17 2016-07-05 18:27:48

buildid
Member
Registered: 2016-06-22
Posts: 11

Re: PowerTOP for better battery consumption

the auto tune command shut down my audio card , took some time for me to find out why my video have no sound .

Offline

#18 2016-07-10 23:56:57

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: PowerTOP for better battery consumption

@HoaS, thanks for this. I like the OP method, it's simple, effective, and doesn't require the qt libraries that lmt does.

hhh@base:~$ sudo apt install laptop-mode-tools
[sudo] password for hhh: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  ethtool hdparm libqt4-declarative libqt4-designer libqt4-help libqt4-opengl
  libqt4-scripttools libqt4-sql libqt4-sql-mysql libqt4-test
  libqt4-xmlpatterns libqtassistantclient4 libqtwebkit4 powermgmt-base
  python-qt4 python-sip sdparm

Cheers!


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#19 2016-07-19 14:24:58

tumblingthrough
New Member
Registered: 2016-07-19
Posts: 2

Re: PowerTOP for better battery consumption

Hi

I have a pretty unchanged version of bunsen on my laptop and noticed the battery isn't good at all. I've followed the suggested steps to set up lmt and powertop together. Is there any standard power management tools that I need to disable now that I've added these? For example, I've got the xfce power manager running in the system tray.

Many thanks.

Offline

#20 2016-07-19 17:35:11

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: PowerTOP for better battery consumption

tumblingthrough wrote:

Is there any standard power management tools that I need to disable now that I've added these? For example, I've got the xfce power manager running in the system tray.

I don't think so, no.

The "power manager" in the systray sets the suspend/sleep and display options along with notifications and is not involved in saving battery life specifically.

How new is your laptop?

What is the CPU?

Offline

Board footer

Powered by FluxBB