Difference between revisions of "TLP"

From ArchWiki
Jump to: navigation, search
(add unit to restart TLP after resuming to set correct APM value for harddisks)
(24 intermediate revisions by 9 users not shown)
Line 1: Line 1:
'''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.  
+
[[Category:Power management]]
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:
+
'''TLP''' is an advanced power management tool for Linux. It is a pure command line tool with
# Kernel-Laptop-Mode and timouts for writeback of the filesystembuffer to hard disk
+
automated background tasks and does not contain a GUI.  
# Advanced Power Management Level per hard disk
+
 
# I/O scheduler per hard disk
+
TLP is available in the AUR: {{aur|tlp}}, {{aur|tlp-rdw}}.  
# SATA Aggressive Link Power Management (ALPM)
+
 
# Wifi powersaving mode for wifi-cards with iwlagn driver
+
== Features ==
# battery-charging thresholds on some ThinkPads with (optionally) tp_smapi
+
Read the the full documentation at the [http://linrunner.de/tlp project homepage].
# 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
 +
* [https://aur.archlinux.org/packages/tlp-rdw/ tlp-rdw] (AUR) – optional, Radio Device Wizard
 +
* [[Tp_smapi|tp_smapi]] (Community) – optional ''ThinkPad only'', tp-smapi is needed for battery charge thresholds and ThinkPad specific status output of tlp-stat
 +
* [https://aur.archlinux.org/packages/dkms-acpi_call-git/ dkms-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.)
 +
 
 +
== Start ==
 +
After successful installation, you can start TLP by typing ''as root/with sudo'':
 
  tlp start
 
  tlp start
To start tlp as a deamon, add '''tlp''' to the DEAMONS section in {{Filename|/etc/rc.conf}}
+
 
DEAMONS=( ... '''tlp''' ...)
+
To run TLP automatically upon system startup, enable the service via:
 +
  systemctl enable tlp.service
 +
 
 +
'''Hint:''' the above step is also necessary when upgrading to 0.3.8.1 because the service name changed.
 +
 
 +
 
 +
To run TLP automatically upon resuming from standby / hibernation to set correct APM Value for HDD (activate with {{ic|# systemctl enable tlp_start}}):
 +
 
 +
{{hc|/etc/systemd/system/tlp_start.service|2=<nowiki>
 +
[Unit]
 +
Description=Start the TLP power management script after suspend/hibernation
 +
After=basic.target
 +
After=suspend.target
 +
After=hibernate.target
 +
StopWhenUnneeded=yes
 +
 
 +
[Service]
 +
Type=oneshot
 +
RemainAfterExit=yes
 +
ExecStart=-/usr/sbin/tlp start
 +
 
 +
[Install]
 +
WantedBy=basic.target
 +
WantedBy=suspend.target
 +
WantedBy=hibernate.target</nowiki>}}
  
 
== Configuration ==
 
== Configuration ==
The config-file is located at {{Filename|/etc/default/tlp}}. To make use of the battery-charging option, install and configure [[Tp_smapi]].
+
The config file is located at {{ic|/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)
+
 
 +
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].
 +
 
 +
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]]).
  
== Wifi ==
+
== Kernel 2.6.39 ==
Some intel wifi 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'')
+
According to this [https://bbs.archlinux.org/viewtopic.php?pid=946633 thread], the kernel 2.6.39 does not allow user-settings to
tlp wifi $IFACE
+
/sys/module/pcie_aspm/parameters/policy
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]]).
+
You can use PCIe ASPM settings by starting the kernel with
 +
pcie_aspm=force
  
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:
+
== External Links ==
iwconfig | grep "Power Management"
+
* [http://linrunner.de/tlp TLP - Linux Advanced Power Management] - Project homepage & documentation

Revision as of 10:18, 23 May 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
  • dkms-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.)

Start

After successful installation, you can start TLP by typing as root/with sudo:

tlp start

To run TLP automatically upon system startup, enable the service via:

 systemctl enable tlp.service

Hint: the above step is also necessary when upgrading to 0.3.8.1 because the service name changed.


To run TLP automatically upon resuming from standby / hibernation to set correct APM Value for HDD (activate with # systemctl enable tlp_start):

/etc/systemd/system/tlp_start.service
[Unit]
Description=Start the TLP power management script after suspend/hibernation
After=basic.target
After=suspend.target
After=hibernate.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/sbin/tlp start

[Install]
WantedBy=basic.target
WantedBy=suspend.target
WantedBy=hibernate.target

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

Kernel 2.6.39

According to this 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

External Links