Difference between revisions of "TLP"

From ArchWiki
Jump to: navigation, search
(cat)
(Installation)
(25 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Power management (English)]]
+
[[Category:Power management]]
'''TLP''' is set of powersaving-scripts for Lenovo/IBM ThinkPads (c), which handle powersaving options according to the current power source. It was originally written by linrunner for Ubuntu.  
+
'''TLP''' is an advanced power management tool for Linux. It is a pure command line tool with
A port is available at the [https://aur.archlinux.org/packages.php?ID=48464l AUR]. Although it is written for ThinkPads, it should work on other laptops as well, but without ThinkPad specific functions. Some features are:
+
automated background tasks and does not contain a GUI.  
* Kernel-Laptop-Mode and timouts for writeback of the filesystembuffer to hard disk
+
 
* Advanced Power Management Level per hard disk
+
TLP is available in the AUR: {{aur|tlp}}, {{aur|tlp-rdw}}.  
* I/O scheduler per hard disk
+
 
* SATA Aggressive Link Power Management (ALPM)
+
== Features ==
* Wifi powersaving mode for wifi-cards with iwlagn driver
+
Read the the full documentation at the [http://linrunner.de/tlp project homepage].
* battery-charging thresholds on some ThinkPads with (optionally) tp_smapi
+
* and some more...
+
  
 
== Installation ==
 
== Installation ==
Just install it from the [https://aur.archlinux.org/packages.php?ID=48464l AUR].
+
Install the following packages plus dependencies:
After successful installation, you can start TLP by typing ''as root/with sudo'':
+
* [https://aur.archlinux.org/packages/tlp/ tlp] (AUR) – Power saving
tlp start
+
* [https://aur.archlinux.org/packages/tlp-rdw/ tlp-rdw] (AUR) – optional, Radio Device Wizard
To start TLP as a daemon, add '''tlp''' to the DAEMONS section in {{Filename|/etc/rc.conf}}
+
* [[Tp_smapi|tp_smapi]] (Community) – optional ''ThinkPad only'', tp-smapi is needed for battery charge thresholds and ThinkPad specific status output of tlp-stat
DAEMONS=( ... '''tlp''' ...)
+
* [https://aur.archlinux.org/packages/acpi_call-git/ acpi_call-git] (AUR) – optional ''ThinkPad only'', acpi_call is needed for battery charge thresholds on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)
  
== Configuration ==
+
After package installation it is mandatory to enable both contained services via:
The config-file is located at {{Filename|/etc/default/tlp}}. A full list of options is documented here: [http://thinkpad-wiki.org/TLP_-_Stromspareinstellungen_fuer_Ubuntu www.thinkpad-wiki.org] (currently only in German language). To make use of the battery-charging option, install and configure [[Tp_smapi]].  
+
# systemctl enable tlp
 +
# systemctl enable tlp-sleep.service
  
== Kernel 2.6.39 ==
+
== Start ==
According to this [https://bbs.archlinux.org/viewtopic.php?pid=946633 thread], the kernel 2.6.39 does not allow user-settings to
+
/sys/module/pcie_aspm/parameters/policy
+
You can use PCIe ASPM settings by starting the kernel with
+
pcie_aspm=force
+
== Wi-Fi ==
+
Some Intel Wi-Fi cards require to set their powersaving options '''after''' establishing connection. Therefore the original version of TLP adds a script to {{Filename|/etc/network/if-up.d/}}, which itself calls (''as root'')
+
tlp wifi $IFACE
+
where '''$IFACE''' is the current Interface (e.g. wlan0). In Arch Linux, there is no such possibility by default. If you own a wifi card, which is not supported out of the box, please use the post-up methods of your preferred networking manager (like [[netcfg]] oder [[NetworkManager]]).
+
If TLP sets the powersaving options properly on ac-state changed, you do not need to change anything. Check this, by issuing the following command twice, before and after unplugging your ac adapter:
+
iwconfig | grep "Power Management"
+
  
=== NetworkManager ===
+
After successful installation, TLP starts automatically on every boot.
Linrunner has created a little script for NetworkManager , which sets the the Powersaving options. It should be located in {{Filename|/etc/NetworkManager/dispatcher.d/02_tlp-ifup}}. Again, if everything is working ok, you do not need to add this script!
+
 
 +
== Configuration ==
 +
The config file is located at {{ic|/etc/default/tlp}}.  
  
#!/bin/sh
+
The default configuration provides optimized power saving out of the box. For a full list of options see: [http://linrunner.de/en/tlp/docs/tlp-configuration.html TLP Configuration].
# tlp - ifup hook
+
[ -n "$1" ] || exit 0
+
+
IWC=iwconfig
+
TLP=/usr/sbin/tlp
+
[ -x $TLP ] || exit 0
+
+
IFACE="$1"
+
case "$2" in
+
    up)
+
        if [ -z $($IWC $IFACE 2>&1 | grep "no wireless extensions") ]; then
+
            # interface is wifi
+
            $TLP wifi $IFACE
+
        elif [ "${IFACE#usb}" != "$IFACE" -o "${IFACE#hso}" != "$IFACE" -o "${IFACE#ppp}" != "$IFACE" ]; then
+
            # interface is (probably) wwan
+
            $TLP usb
+
        fi
+
        ;;
+
       
+
    *) # do nothing
+
        ;;
+
esac
+
exit 0
+
  
=== netcfg ===
+
To make use of the ThinkPad-specific battery options, install and configure [[Tp_smapi|tp_smapi]] and/or [https://aur.archlinux.org/packages/dkms-acpi_call-git/ acpi_call] (see [[TLP#Installation|Installation]]).  
Just add
+
POST_UP=tlp wifi $INTERFACE
+
to the config-file.
+
  
 
== External Links ==
 
== External Links ==
* TLP Documentaion at [http://thinkpad-wiki.org/TLP_-_Stromspareinstellungen_fuer_Ubuntu thinkpad-wiki.org] (in German)
+
* [http://linrunner.de/tlp TLP - Linux Advanced Power Management] - Project homepage & documentation
* TLP Developer Documentation at [http://thinkpad-wiki.org/TLP_Programmdokumentation thinkpad-wiki.org] (in German)
+

Revision as of 22:43, 18 August 2013

TLP is an advanced power management tool for Linux. It is a pure command line tool with automated background tasks and does not contain a GUI.

TLP is available in the AUR: tlpAUR, tlp-rdwAUR.

Features

Read the the full documentation at the project homepage.

Installation

Install the following packages plus dependencies:

  • tlp (AUR) – Power saving
  • tlp-rdw (AUR) – optional, Radio Device Wizard
  • tp_smapi (Community) – optional ThinkPad only, tp-smapi is needed for battery charge thresholds and ThinkPad specific status output of tlp-stat
  • acpi_call-git (AUR) – optional ThinkPad only, acpi_call is needed for battery charge thresholds on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)

After package installation it is mandatory to enable both contained services via:

# systemctl enable tlp
# systemctl enable tlp-sleep.service

Start

After successful installation, TLP starts automatically on every boot.

Configuration

The config file is located at /etc/default/tlp.

The default configuration provides optimized power saving out of the box. For a full list of options see: TLP Configuration.

To make use of the ThinkPad-specific battery options, install and configure tp_smapi and/or acpi_call (see Installation).

External Links