Laptop Mode Tools

From ArchWiki
Revision as of 11:57, 7 February 2012 by Fengchao (Talk | contribs) (Quote introduction from official website.)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Overview of the Laptop Mode Tools power management suite for notebooks.
Related
acpid
cpufrequtils
pm-utils
Resources
Laptop Mode Tools
Mailing List Archives
Less Watts - Official Site
Laptop - ArchWiki

Laptop Mode Tools is a laptop power saving package for Linux systems. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down. In addition, it allows you to tweak a number of other power-related settings using a simple configuration file.

Combined with acpid, CPU frequency scaling, and pm-utils, LMT provides most users with a complete notebook power management suite.

Installation

laptop-mode-tools can be installed from the official repositories.

Configuration

Add laptop-mode to the DAEMONS array in Template:Filename:

DAEMONS=(...laptop-mode...)

Configuration is handled through the primary configuration file Template:Filename and through the configuration of dozens of feature-specific files in Template:Filename. Recent versions of LMT are able to automatically enable commonly used Template:Filename settings by way of the ENABLE_AUTO_MODULES variable in Template:Filename.

Disks

Hard disks

For this you need to have hdparm and/or sdparm installed. See Hdparm.

Spinning down the hard drive through hdparm -S values saves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LMT can also establish hdparm -B values. The maximum hard drive power saving is 1 and the minimum is 254. Set this value to 254 when on AC and 1 when on battery. If you find that normal activity hangs often while waiting for the disk to spin up, it might be a good idea to set it to a higher value (eg. 128) which will make it spin down less often. hdparm -S and hdparm -B values are configured in Template:Filename.

With the CONTROL_MOUNT_OPTIONS variable (default on), laptop-mode-tools automatically remounts your partitions, appending 'commit=600,noatime' in the mount options. This keeps the journaling program jbd2 from accessing your disc every few seconds, instead the disc journal gets updated every 10 minutes (BEWARE: with this setting you could lose up to 10 minutes of work). Also be sure not to use the atime mount option, use noatime or relatime instead.

Note: CONTROL_MOUNT_OPTIONS should not be turned on with nilfs2 partitions (see this thread on the forum https://bbs.archlinux.org/viewtopic.php?id=134656)

Processor

CPU frequency

For this you need to have a CPU frequency driver installed. See CPU Frequency Scaling.

# cpufreq.conf
# ThinkPad T40/T42/T60 Example
#
CONTROL_CPU_FREQUENCY=1
BATT_CPU_MAXFREQ=fastest
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=ondemand
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=fastest
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=ondemand
LM_AC_CPU_IGNORE_NICE_LOAD=1
NOLM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=ondemand
NOLM_AC_CPU_IGNORE_NICE_LOAD=0
CONTROL_CPU_THROTTLING=0

Device and bus

Intel SATA

  • Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.
# intel-sata-powermgmt.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_INTEL_SATA_POWER=1
BATT_ACTIVATE_SATA_POWER=1
LM_AC_ACTIVATE_SATA_POWER=1
NOLM_AC_ACTIVATE_SATA_POWER=0
Note: Review the well-documented Template:Filename file for additional configuration details.

USB autosuspend

# usb-autosuspend.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_USB_AUTOSUSPEND=1
BATT_SUSPEND_USB=1
LM_AC_SUSPEND_USB=1
NOLM_AC_SUSPEND_USB=0
AUTOSUSPEND_TIMEOUT=2
Note: Review the well-documented Template:Filename file for additional configuration details.

Display and graphics

LCD brightness

  • Available brightness values for certain laptops can can be obtained by running following two commands:
$ cat /proc/acpi/video/VID/LCD/brightness

For ThinkPad notebooks, minimum brightness values can be obtained by running one of the following two commands:

$ cat /sys/class/backlight/acpi_video0/brightness
$ cat /sys/class/backlight/thinkpad_screen/brightness
  • For ThinkPad notebooks, maximum brightness values can be obtained by running one of the following two commands:
$ cat /sys/class/backlight/acpi_video0/max_brightness
$ cat /sys/class/backlight/thinkpad_screen/max_brightness
# lcd-brightness.conf
# ThinkPad T40/T42 Example
#
DEBUG=0
CONTROL_BRIGHTNESS=1
BATT_BRIGHTNESS_COMMAND="echo 0"
LM_AC_BRIGHTNESS_COMMAND="echo 7"
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"
BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"
# lcd-brightness.conf
# ThinkPad T60 Example
#
DEBUG=0
CONTROL_BRIGHTNESS=1
BATT_BRIGHTNESS_COMMAND="echo 0"
LM_AC_BRIGHTNESS_COMMAND="echo 7"
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"
BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"
Note: Review the well-documented Template:Filename file for additional configuration details.

Terminal blanking

# terminal-blanking.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_TERMINAL=1
TERMINALS="/dev/tty1"
BATT_TERMINAL_BLANK_MINUTES=1
BATT_TERMINAL_POWERDOWN_MINUTES=2
LM_AC_TERMINAL_BLANK_MINUTES=10
LM_AC_TERMINAL_POWERDOWN_MINUTES=10
NOLM_AC_TERMINAL_BLANK_MINUTES=10
NOLM_AC_TERMINAL_POWERDOWN_MINUTES=10
Note: Review the well-documented Template:Filename file for additional configuration details.

Networking

Ethernet

# ethernet.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_ETHERNET=1
LM_AC_THROTTLE_ETHERNET=0
NOLM_AC_THROTTLE_ETHERNET=0
DISABLE_WAKEUP_ON_LAN=1
DISABLE_ETHERNET_ON_BATTERY=1
ETHERNET_DEVICES="eth0"

Wireless LAN

Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:

  1. Template:Filename for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).
  2. Template:Filename for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See Template:Filename for details. (note that the ipw3945 is not used anymore, see below)
  3. Template:Filename for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)

Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.

The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.

There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of Template:Filename :

IWL_AC_POWER
IWL_BATT_POWER

are ignored, because the Template:Filename file does not exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.

Audio

AC97

# ac97-powersave.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_AC97_POWER=1

Intel HDA

# intel-hda-powersave.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_INTEL_HDA_POWER=1
BATT_INTEL_HDA_POWERSAVE=1
LM_AC_INTEL_HDA_POWERSAVE=1
NOLM_AC_INTEL_HDA_POWERSAVE=0
INTEL_HDA_DEVICE_TIMEOUT=10
INTEL_HDA_DEVICE_CONTROLLER=0

Tips and tricks

Aliases

lm-profiler

Disabling

Troubleshooting

Laptop-mode-tools is not picking up events

You need to install and enable acpid. Add acpid to your DAEMONS list in Template:Filename:

DAEMONS=(... acpid ...)

If that does not help, go through the laptop-mode configuration files and make sure that the service you want to enable is set to 1. Many services (including cpufreq control) are by default set to "auto", which may not enable them.

I have experienced issues with bluetooth not working if i boot up with battery, and i fixed it with disabling runtime-pm.

Laptop-mode-tools does not disable on AC

It is possible if you have both laptop-mode-tools and pm-utils installed, they can conflict with each other, causing laptop-mode to not properly set its state.

This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this is the laptop-mode script located in /usr/lib/pm-utils/power.d. The script can be blacklisted by creating a file in /etc/pm/config.d as follows:

HOOK_BLACKLIST="laptop-mode"

You can also add any other scripts found in /usr/lib/pm-utils/power.d to this list to disable them. I recommend going through and disabling any hook that has equivalent functionality in LMT.