Difference between revisions of "TLP"

From ArchWiki
Jump to: navigation, search
m (Add i18n template)
(Installation)
(35 intermediate revisions by 14 users not shown)
Line 1: Line 1:
[[Category:Power management (English)]]
+
[[Category:Power management]]
{{i18n|TLP}}
+
{{Related articles start}}
'''TLP''' is a set of scripts that bring you the benefits of advanced power management for Linux without the need to understand every technical detail. The default configuration provides optimized power saving out of the box.  
+
{{Related|Laptop Mode Tools}}
 +
{{Related articles end}}
 +
[http://linrunner.de/tlp TLP] is an advanced power management tool for Linux.  
  
It was originally written by linrunner for Ubuntu. A port is available at the [https://aur.archlinux.org/packages.php?ID=48464l AUR].
+
It is a pure, command-line tool with automated background tasks and does not contain a GUI.  
+
Settings depending on the power source ac/bat:
+
* Kernel laptop mode, dirty buffer params and file system commit timeout
+
* Power aware process scheduler for multi-core/multi-threading
+
* Hard disk advanced power magement level (per disk)
+
* SATA aggressive link power management (ALPM)
+
* PCI Express active state power management (PCIe ASPM) - Kernel 2.6.35 and above
+
* Runtime power management for pci/spi/i2c bus devices - Kernel 2.6.35 and above
+
* Radeon graphics KMS power management - Kernel 2.6.35 and above, not fglrx
+
* Wifi power saving mode -  depending on kernel/driver
+
* Power off optical drive in drive bay (on battery)
+
  
Additional functions:
+
== Features ==
* Hard disk spin down timeout and I/O scheduler (per disk)
+
Read the full documentation at the [http://linrunner.de/tlp project homepage].
* USB autosuspend with blacklist
+
* Audio power saving mode - hda_intel, ac97
+
* Disable Wifi, bluetooth or WWAN devices upon system startup and shutdown
+
* 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
+
  
 
== Installation ==
 
== Installation ==
Just install it from the [https://aur.archlinux.org/packages.php?ID=48464l AUR].
+
[[pacman|Install]] the {{Pkg|tlp}} and {{Pkg|tlp-rdw}} packages, which are available in the [[official repositories]].
After successful installation, you can start TLP by typing ''as root/with sudo'':
+
tlp start
+
To start TLP as a daemon, add '''tlp''' to the DAEMONS section in {{ic|/etc/rc.conf}}
+
DAEMONS=( ... '''tlp''' ...)
+
  
== Configuration ==
+
{{Note| tlp conflicts with pm-utils (or any other power management tool for that matter). This was worked around before in the AUR .install file by replacing some pm-utils files with symlinks to tlp scripts. However this workaround will not be used in an official package.}}
The config-file is located at {{ic|/etc/default/tlp}}. A full list of options is documented here: [https://github.com/linrunner/TLP/wiki/TLP-Configuration TLP Configuration]. To make use of the battery-related options, install and configure [[Tp_smapi]].  
+
  
== Kernel 2.6.39 ==
+
Optional dependencies are:
According to this [https://bbs.archlinux.org/viewtopic.php?pid=946633 thread], the kernel 2.6.39 does not allow user-settings to
+
* {{Pkg|tp_smapi}} – optional ''ThinkPad only'', tp-smapi is needed for battery charge thresholds and ThinkPad specific status output of tlp-stat
/sys/module/pcie_aspm/parameters/policy
+
* {{Pkg|acpi_call}} – optional ''ThinkPad only'', acpi_call is needed for battery charge thresholds on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)
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 {{ic|/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 package installation, it is mandatory to enable both contained services via:
linrunner has created a little script for NetworkManager , which sets the the Powersaving options. It should be located in {{ic|/etc/NetworkManager/dispatcher.d/02_tlp-ifup}}. Again, if everything is working ok, you do not need to add this script!
+
# systemctl enable tlp
 +
# systemctl enable tlp-sleep
 +
 
 +
'''Important:''' if you want to use tlp-rdw  – which in turn requires [[NetworkManager]] – it is mandatory to enable the [[NetworkManager#Network_services_with_NetworkManager_dispatcher|corresponding service]]:
 +
# systemctl enable NetworkManager-dispatcher
 +
 
 +
== Start ==
 +
 
 +
After successful installation, TLP starts automatically on every boot.
 +
 
 +
== Configuration ==
 +
The configuration 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 {{Pkg|acpi_call}} (see [[TLP#Installation|Installation]]).
Just add
+
POST_UP=tlp wifi $INTERFACE
+
to the config-file.
+
  
== External Links ==
+
== See also ==
* [https://github.com/linrunner/TLP/wiki/TLP-Linux-Advanced-Power-Management TLP Documentation]
+
* [http://linrunner.de/tlp TLP - Linux Advanced Power Management] - Project homepage & documentation
* [https://github.com/linrunner/TLP/wiki/TLP-Configuration TLP Configuration] - Settings
+
* [https://github.com/linrunner/TLP/blob/master/debian/changelog TLP Changelog]
+
* [https://github.com/linrunner/TLP/wiki/TLP-Developer-Documentation TLP Developer Documentation]
+
* [http://thinkpad-wiki.org/TLP_-_Linux_Stromsparen TLP - Linux Stromsparen] – Dokumentation in deutsch
+

Revision as of 08:36, 28 January 2014

Related articles

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.

Features

Read the full documentation at the project homepage.

Installation

Install the tlp and tlp-rdw packages, which are available in the official repositories.

Note: tlp conflicts with pm-utils (or any other power management tool for that matter). This was worked around before in the AUR .install file by replacing some pm-utils files with symlinks to tlp scripts. However this workaround will not be used in an official package.

Optional dependencies are:

  • tp_smapi – optional ThinkPad only, tp-smapi is needed for battery charge thresholds and ThinkPad specific status output of tlp-stat
  • acpi_call – 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

Important: if you want to use tlp-rdw – which in turn requires NetworkManager – it is mandatory to enable the corresponding service:

# systemctl enable NetworkManager-dispatcher

Start

After successful installation, TLP starts automatically on every boot.

Configuration

The configuration 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).

See also