TLP

From ArchWiki
Revision as of 17:01, 9 October 2011 by Linrunner (Talk | contribs) (Update of features and links)

Jump to: navigation, search

Introduction

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.

It was originally written by linrunner for Ubuntu. A port is available at the AUR.

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
  • Intel graphics rc6/fbc power management - Kernel 3.0 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:

  • Hard disk spin down timeout and I/O scheduler (per disk)
  • 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

Just install it from the AUR. 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 Template:Filename

DAEMONS=( ... tlp ...)

Configuration

The config-file is located at Template:Filename. A full list of options is documented here: TLP Configuration. To make use of the battery-related options, install and configure Tp_smapi.

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

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 Template:Filename, 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

Linrunner has created a little script for NetworkManager , which sets the the Powersaving options. It should be located in Template:Filename. Again, if everything is working ok, you do not need to add this script!

#!/bin/sh
# 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

Just add

POST_UP=tlp wifi $INTERFACE

to the config-file.

External Links