Monday, August 10, 2015

Power saving tools for Ubuntu

(A) TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements. These tweaks will also help with overheating issues!

Features

TLP is a pure command line tool with automated background tasks. It does not contain a GUI.

Settings depending on the Power Source

  • Kernel laptop mode and dirty buffer timeouts
  • Processor frequency scaling including "turbo boost" / "turbo core"
  • Power aware process scheduler for multi-core/hyper-threading
  • Hard disk advanced power magement level and spin down timeout (per disk)
  • SATA aggressive link power management (ALPM)
  • PCI Express active state power management (PCIe ASPM) – Linux 2.6.35 and above
  • Runtime power management for PCI(e) bus devices – Linux 2.6.35 and above
  • Radeon KMS power management – Linux 2.6.35 and above, not fglrx
  • Radeon dynamic power management – Kernel 3.11 and above, not fglrx
  • Wifi power saving mode – depending on kernel/driver
  • Power off optical drive in drive bay (on battery)
  • Audio power saving mode – hda_intel, ac97

Additional functions

  • I/O scheduler (per disk)
  • USB autosuspend with blacklist
  • Enable or disable integrated wifi, bluetooth or wwan devices upon system startup and shutdown
  • Restore radio device state on system startup (from previous shutdown).
  • Radio device wizard: switch radios upon network connect/disconnect and dock/undock
  • Disable Wake On LAN
  • WWAN state is restored after suspend/hibernate
  • Untervolting of Intel processors – requires kernel with PHC-Patch
  • Battery charge thresholds – ThinkPads only
  • Recalibrate battery – ThinkPads only
To avoid any conflicts make sure laptop-mode-tools or cpufrequtils is not installed:


sudo apt-get remove laptop-mode-tools
sudo apt-get remove cpufrequtils

A reboot would be recommended.


To install TLP on ubuntu copy paste the following information into your terminal :


sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw

ThinkPads require an additional:

sudo apt-get install tp-smapi-dkms acpi-call-dkms


To edit TLP configuration :


sudo gedit /etc/default/tlp     (if you dont have gedit installed --> sudo apt-get install gedit )

TLP comes preconfigured for battery saving , however i have added a more aggressive  power saving configuration , this will work very well on systems with multicore CPU's . Ubuntu is optimized to spread the load on all cores . Make sure to uncomment (remove "#" before editing a line to enable it)

Powersave will lock your CPU at the lowet frequency:








If your are running your OS on an SSD deadline scheduler is recommded .
For HDD you can use cfq  . More info on SSD benchmarks can be found here .




Do not edit the following setting unless you are using open-source drivers on AMD GPU !
If you already have a script configured like this one here  then you can use "#" before the lines to disable them in order to avoid any conflicts.


Using wifi power saving could decrease your internet speed ! 



To start TLP :

sudo tlp start 

(B)Laptop Mode Tools is a laptop power saving package for Linux systems. It allows you to extend the battery life of your laptop, in several ways. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down.
TLP or any other power saving tool installed must be removed before proceeding with the installation.

The latest Laptop Mode Tools is available in the WebUpd8 Backports PPA. You can add the PPA and install it in Ubuntu  by using the following commands:


sudo add-apt-repository ppa:webupd8team/unstable
sudo apt-get update
sudo apt-get install laptop-mode-tools


Laptop-mode-tools can be started from terminal with the following command :

gksu lmt-config-gui