Difference between revisions of "Laptop Mode Tools"

From ArchWiki
Jump to: navigation, search
m (Add subsections to outline the relationship between laptop-mode tools and other power management tools)
(Undo revision 493076 by Jasonwryan (talk) - the URL fix seems appropriate)
 
(144 intermediate revisions by 65 users not shown)
Line 1: Line 1:
[[Category:Laptops (English)]]
+
[[Category:Laptops]]
[[Category:Power management (English)]]
+
[[Category:Power management]]
{{Expansion}}
+
[[de:Laptop Mode Tools]]
{{Article summary start}}
+
[[fr:Laptop Mode Tools]]
{{Article summary text|Overview of the Laptop Mode Tools power management suite for notebooks.}}
+
[[it:Laptop Mode Tools]]
{{Article summary heading|Related}}
+
[[ja:Laptop Mode Tools]]
{{Article summary wiki|acpid}}
+
[[ru:Laptop Mode Tools]]
{{Article summary wiki|cpufrequtils}}
+
[[zh-hans:Laptop Mode Tools]]
{{Article summary wiki|pm-utils}}
+
{{Related articles start}}
{{Article summary heading|Resources}}
+
{{Related|acpid}}
{{Article summary link|Laptop Mode Tools|http://samwel.tk/laptop_mode/}}
+
{{Related|systemd}}
{{Article summary link|Mailing List Archives|http://mailman.samwel.tk/pipermail/laptop-mode/ }}
+
{{Related|cpufrequtils}}
{{Article summary link|Less Watts - Official Site|http://www.lesswatts.org/index.php}}
+
{{Related|pm-utils}}
{{Article summary link|Laptop - ArchWiki|http://wiki.archlinux.org/index.php/Laptop|lll}}
+
{{Related|Laptop}}
 +
{{Related|Powertop}}
 +
{{Related|TLP}}
 +
{{Related articles end}}
  
 +
[https://github.com/rickysarraf/laptop-mode-tools 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.
  
{{Article summary end}}
+
Combined with [[acpid]] and [[CPU frequency scaling]], LMT provides most users with a complete notebook power management suite.
  
==Preface==
+
== Installation ==
The Linux kernel, starting from version 2.6.6, contains a feature called ''laptop mode''. This feature is also present in the Linux 2.4 series starting from version 2.4.23. When enabled, the kernel allows the hard drive to spin down more often, resulting in significant power savings. Laptop Mode Tools (LTM) evolved from a simple program that controlled the hard drives to a centralized power saving solution providing a wide selection of options and can perform a number of varying power saving functions across separate subsystems simultaneously. Combined with [[acpid]], [[cpufrequtils]] and [[pm-utils]], LTM provides most users with a complete notebook power management suite.
 
=== Relationship to ACPID ===
 
=== Relationship to cpufrequtils ===
 
=== Relationship to pm-utils ===
 
  
==Installation==
+
[[Install]] the {{AUR|laptop-mode-tools}} package or the {{AUR|laptop-mode-tools-git}} package.
{{Package Official|laptop-mode-tools}} is part of the official [[Official Repositories|Arch Linux [extra] repository]].
 
# pacman -S laptop-mode-tools
 
  
==Configuration==
+
== Configuration ==
Add {{Codeline|laptop-mode}} to the {{Codeline|DAEMONS}} array in {{Filename|/etc/rc.conf}}:
 
DAEMONS=(...laptop-mode...)
 
  
Configuration is handled through the primary configuration file {{Filename|/etc/laptop-mode/laptop-mode.conf}} and through the configuration of dozens of feature-specific files in {{Filename|/etc/laptop-mode/conf.d/*}}. Recent versions of LTM are able to automatically enable commonly used {{Filename|conf.d/*}} settings by way of the {{Codeline|ENABLE_AUTO_MODULES}} variable in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.
+
Configuration is handled through:
  
===Disks===
+
* {{ic|/etc/laptop-mode/laptop-mode.conf}} - primary configuration file.
====Hard disks====
+
* {{ic|/etc/laptop-mode/conf.d/*}} - dozens of feature-specific "modules".  
Spinning down the hard drive through {{codeline|hdparm -S}} valuessaves 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. LTM can also establish {{codeline|hdparm -B}} values. 1 is maximum hard drive power saving and 254 is minimum. Set this value to 254 when on AC and 1 when on battery. If you move around a lot when on battery it might be a good idea to set it higher (eg. 128)<sup>[clarifiy]</sup>. {{codeline|hdparm -S}} and {{codeline|hdparm -B}} values are configured in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.
 
  
====HAL polling====
+
Each module can be explicitly {{ic|enabled}}, {{ic|disabled}}, or set to {{ic|auto}} by changing the {{ic|CONTROL_*}} argument of any file in {{ic|conf.d/}}.  LMT will attempt enable any modules where {{ic|CONTROL_*}} is set to {{ic|auto}} if {{ic|ENABLE_AUTO_MODULES}} is set in {{ic|/etc/laptop-mode/laptop-mode.conf}}.  There are two exceptions to the above rule: {{ic|auto-hibernate.conf}} and {{ic|battery-level-polling.conf}} use an {{ic|ENABLE_*}} variable instead of {{ic|CONTROL_*}}.
  
  # hal-polling.conf
+
To quickly check which modules are enabled, disabled or auto, run:
# ThinkPad T40/T42/T60 Example
+
 
#
+
  $ grep -r '^\(CONTROL\&#124;ENABLE\)_' /etc/laptop-mode/conf.d
DEBUG=0
+
 
CONTROL_HAL_POLLING=1
+
Finally, [[enable]] {{ic|laptop-mode.service}}.
BATT_DISABLE_HAL_POLLING=1
+
 
AC_DISABLE_HAL_POLLING=1
+
=== Hard disks ===
HAL_POLLING_DEVICES="/dev/scd?"
+
 
 +
For this you need to have ''hdparm'' and/or ''sdparm'' installed. See [[Hdparm]].
 +
 
 +
Spinning down the hard drive through {{Ic|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 {{Ic|hdparm -B}} values. The maximum hard drive power saving is 1 and the minimum is 254. For example, set this value to 254 when on AC and 20 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 (e.g. 128) which will make it spin down less often. {{Ic|hdparm -S}} and {{Ic|hdparm -B}} values are configured in {{ic|/etc/laptop-mode/laptop-mode.conf}}.
 +
 
 +
{{Warning|Spinning down a hard drive too frequently can shorten its lifespan. Take care when choosing a proper value.}}
 +
 
 +
With the {{ic|CONTROL_MOUNT_OPTIONS}} variable (default on), laptop-mode-tools automatically remounts your partitions, appending {{ic|1=commit=600,noatime}} in the mount options. This keeps the journaling program jbd2 from accessing your disk every few seconds, instead the disk journal gets updated every 10 minutes.
 +
 
 +
{{Warning|With this setting you could lose up to 10 minutes of work. Also be sure not to use the {{Ic|atime}} mount option. Use {{Ic|noatime}} or {{Ic|relatime}} instead.}}
 +
 
 +
{{Note|1={{ic|CONTROL_MOUNT_OPTIONS}} should not be turned on with nilfs2 partitions. Refer to this thread on the forum: https://bbs.archlinux.org/viewtopic.php?id=134656}}
 +
 
 +
==== Solid state drives ====
 +
 
 +
From the [https://github.com/rickysarraf/laptop-mode-tools/wiki/FAQ#i-have-a-solid-state-disk-ssd-in-my-machine-should-i-enable-any-of-the-disk-related-parts-of-laptop-mode-tools-or-are-they-irrelevant official, upstream FAQ]:
 +
 
 +
'''Question:''' I have a solid-state disk (SSD) in my machine. Should I enable any of the disk-related parts of laptop-mode-tools, or are they irrelevant?
 +
 
 +
'''Answer:''' They may be relevant, because (a) laptop mode will reduce the number of writes, which improves the lifetime of an SSD, and (b) laptop mode makes writes bursty, which enables power saving mechanisms like ALPM to kick in. However, your mileage may vary depending on the specific hardware involved. For some hardware, you will get no gain at all, for some the gain may be substantial.
 +
 
 +
=== CPU frequency ===
  
===Processor===
+
For this you need to have a CPU frequency driver installed. See [[CPU frequency scaling]].
====CPU frequency====
 
  
 
  # cpufreq.conf
 
  # cpufreq.conf
Line 69: Line 84:
 
  CONTROL_CPU_THROTTLING=0
 
  CONTROL_CPU_THROTTLING=0
  
* See [[CPU Frequency Scaling]] for details on how to setup the needed kernel modules.
+
=== Device and bus ===
 +
 
 +
==== Intel SATA ====
  
===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.
 
* 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
 
  # intel-sata-powermgmt.conf
 
  # ThinkPad T40/T42/T60 Example
 
  # ThinkPad T40/T42/T60 Example
Line 83: Line 99:
 
  NOLM_AC_ACTIVATE_SATA_POWER=0
 
  NOLM_AC_ACTIVATE_SATA_POWER=0
  
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf}} file for additional configuration details.}}
+
{{Note|Review the well-documented {{ic|/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf}} file for additional configuration details.}}
 +
 
 +
==== USB autosuspend ====
 +
 
 +
{{Tip|USB autosuspend functionality has been moved from the ''usb-autosuspend'' module to the ''runtime-pm'' module. Make sure to replace usb-autosuspend with runtime-pm on /lib/udev/rules.d/99-laptop-mode.rules.}}
  
====USB autosuspend====
+
  # runtime-pm.conf
  # usb-autosuspend.conf
 
 
  # ThinkPad T40/T42/T60 Example
 
  # ThinkPad T40/T42/T60 Example
 
  #
 
  #
 
  DEBUG=0
 
  DEBUG=0
  CONTROL_USB_AUTOSUSPEND=1
+
  CONTROL_RUNTIME_AUTOSUSPEND=1
  BATT_SUSPEND_USB=1
+
  BATT_SUSPEND_RUNTIME=1
  LM_AC_SUSPEND_USB=1
+
  LM_AC_SUSPEND_RUNTIME=1
  NOLM_AC_SUSPEND_USB=0
+
  NOLM_AC_SUSPEND_RUNTIME=1
 
  AUTOSUSPEND_TIMEOUT=2
 
  AUTOSUSPEND_TIMEOUT=2
  
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/usb-autosuspend.conf}} file for additional configuration details.}}
+
{{Note|Review the {{ic|/etc/laptop-mode/conf.d/runtime-pm.conf}} file for additional configuration details. If you have an USB tool you always use (like an USB mouse), blacklisting them would stop them from suspending.}}
 +
 
 +
=== Display and graphics ===
 +
 
 +
==== LCD brightness ====
 +
 
 +
* Available brightness values for certain laptops can be obtained by running following command:
  
===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
 
  $ cat /proc/acpi/video/VID/LCD/brightness
  
For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, minimum brightness values can be obtained by running one of the following two commands:
+
===== ThinkPad T40/T42 =====
$ cat /sys/class/backlight/acpi_video0/brightness
 
  
$ cat /sys/class/backlight/thinkpad_screen/brightness
+
For [[wikipedia:ThinkPad|ThinkPad]] T40/T42 notebooks, minimum and maximum brightness values can be obtained by running:
  
* For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, maximum brightness values can be obtained by running one of the following two commands:
+
$ cat /sys/class/backlight/acpi_video0/brightness
 
  $ cat /sys/class/backlight/acpi_video0/max_brightness
 
  $ cat /sys/class/backlight/acpi_video0/max_brightness
 
$ cat /sys/class/backlight/thinkpad_screen/max_brightness
 
  
 
  # lcd-brightness.conf
 
  # lcd-brightness.conf
Line 122: Line 141:
 
  NOLM_AC_BRIGHTNESS_COMMAND="echo 7"
 
  NOLM_AC_BRIGHTNESS_COMMAND="echo 7"
 
  BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"
 
  BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"
 +
 +
===== ThinkPad T60 =====
 +
 +
* For [[wikipedia:ThinkPad|ThinkPad]] T60 notebooks, minimum and maximum brightness values can be obtained by running:
 +
 +
$ cat /sys/class/backlight/thinkpad_screen/max_brightness
 +
$ cat /sys/class/backlight/thinkpad_screen/brightness
  
 
  # lcd-brightness.conf
 
  # lcd-brightness.conf
Line 133: Line 159:
 
  BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"
 
  BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"
  
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/lcd-brightness.conf}} file for additional configuration details.}}
+
{{Note|Review the well-documented {{ic|/etc/laptop-mode/conf.d/lcd-brightness.conf}} file for additional configuration details.}}
  
====Terminal blanking====
+
==== Terminal blanking ====
  
 
  # terminal-blanking.conf
 
  # terminal-blanking.conf
Line 150: Line 176:
 
  NOLM_AC_TERMINAL_POWERDOWN_MINUTES=10
 
  NOLM_AC_TERMINAL_POWERDOWN_MINUTES=10
  
{{Note|Review the well-documented {{Filename|/etc/laptop-mode/conf.d/terminal-blanking.conf}} file for additional configuration details.}}
+
{{Note|Review the well-documented {{ic|/etc/laptop-mode/conf.d/terminal-blanking.conf}} file for additional configuration details.}}
 +
 
 +
=== Networking ===
 +
 
 +
==== Ethernet ====
  
===Networking===
 
====Ethernet====
 
 
  # ethernet.conf
 
  # ethernet.conf
 
  # ThinkPad T40/T42/T60 Example
 
  # ThinkPad T40/T42/T60 Example
Line 165: Line 193:
 
  ETHERNET_DEVICES="eth0"
 
  ETHERNET_DEVICES="eth0"
  
====Wireless LAN====
+
==== 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:
 
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:
#{{Filename|/etc/laptop-mode/conf.d/wireless-power.conf}} 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).
+
#{{ic|/etc/laptop-mode/conf.d/wireless-power.conf}} 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).
#{{Filename|/etc/laptop-mode/conf.d/wireless-ipw-power.conf}} 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 {{Filename|/usr/share/laptop-mode-tools/modules/wireless-ipw-power}} for details. (note that the ipw3945 isn't used anymore, see below)
+
#{{ic|/etc/laptop-mode/conf.d/wireless-ipw-power.conf}} 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 {{ic|/usr/share/laptop-mode-tools/modules/wireless-ipw-power}} for details. (note that the ipw3945 is not used anymore, see below)
#{{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)
+
#{{ic|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} 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 shouldn't be much of a problem, since LTM detects the module used by the interface and acts accordingly.
+
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.
  
The supported modules for each config file, indicated above, are taken directly from LTM. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel doesn't 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 doesn't (or shouldn't) affect the way LTM 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 {{ic|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}}:
  
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 {{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} :
 
 
  IWL_AC_POWER
 
  IWL_AC_POWER
 
  IWL_BATT_POWER
 
  IWL_BATT_POWER
are ignored, because the {{Filename|/sys/class/net/wlan*/device/power_level}} file doesn't exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.
 
  
===Audio===
+
are ignored, because the {{ic|/sys/class/net/wlan*/device/power_level}} file does not exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.
====AC97====
+
 
 +
=== Audio ===
 +
 
 +
==== AC97 ====
  
 
  # ac97-powersave.conf
 
  # ac97-powersave.conf
Line 188: Line 220:
 
  CONTROL_AC97_POWER=1
 
  CONTROL_AC97_POWER=1
  
====Intel HDA====
+
==== Intel HDA ====
  
 
  # intel-hda-powersave.conf
 
  # intel-hda-powersave.conf
Line 201: Line 233:
 
  INTEL_HDA_DEVICE_CONTROLLER=0
 
  INTEL_HDA_DEVICE_CONTROLLER=0
  
==Tips and tricks==
+
== Tips and tricks ==
===Aliases===
+
 
===lm-profiler===
+
=== Aliases ===
===Disabling===
+
 
 +
=== lm-profiler ===
 +
 
 +
=== Disabling ===
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Laptop-mode-tools is not picking up events ===
 +
 
 +
Install {{Pkg|acpid}} and enable its [[systemd]] service {{ic|acpid.service}}.
 +
 
 +
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-tools to not properly set its state.
 +
 
 +
This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this particular issue is the laptop-mode script located in {{ic|/usr/lib/pm-utils/power.d}}. You can stop any unwanted hooks from running by creating a dummy file in {{ic|/etc/pm/power.d}} with the same name as the corresponding {{ic|/usr/lib/pm-utils/power.d}} hook. For example if you want to disable the laptop-mode hook:
 +
 
 +
# touch /etc/pm/power.d/laptop-mode
 +
 
 +
{{Note|Do not set the executable bit on that dummy-hook.}}
 +
 
 +
Its recommended to disable any hook that has equivalent functionality in LMT.
 +
 
 +
=== USB Mouse sleeping after 5 seconds when on battery ===
 +
 
 +
First find the ID of you device (it sould look like {{ic|046d:c534}}):
 +
 
 +
$ lsusb
 +
 
 +
Put this value into the {{ic|AUTOSUSPEND_DEVID_BLACKLIST}} variable in {{ic|/etc/laptop-mode/conf.d/runtime-pm.conf}}, for example:
 +
 
 +
{{hc|/etc/laptop-mode/conf.d/runtime-pm.conf|2=
 +
...
 +
AUTOSUSPEND_DEVID_BLACKLIST="046d:c534"
 +
...
 +
}}
 +
 
 +
Multiple IDs can be seperated with spaces.
 +
{{Note|Don't forget to [[restart]] the laptop-mode service. You might also need to reconnect the USB device.}}
 +
 
 +
== See also ==
  
==Troubleshooting==
+
* [http://samwel.tk/laptop_mode/ Laptop Mode Tools]<sup>[Broken link: 404]</sup>
 +
* [http://mailman.samwel.tk/pipermail/laptop-mode/ Mailing List Archives]

Latest revision as of 12:54, 14 October 2017

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 and CPU frequency scaling, LMT provides most users with a complete notebook power management suite.

Installation

Install the laptop-mode-toolsAUR package or the laptop-mode-tools-gitAUR package.

Configuration

Configuration is handled through:

  • /etc/laptop-mode/laptop-mode.conf - primary configuration file.
  • /etc/laptop-mode/conf.d/* - dozens of feature-specific "modules".

Each module can be explicitly enabled, disabled, or set to auto by changing the CONTROL_* argument of any file in conf.d/. LMT will attempt enable any modules where CONTROL_* is set to auto if ENABLE_AUTO_MODULES is set in /etc/laptop-mode/laptop-mode.conf. There are two exceptions to the above rule: auto-hibernate.conf and battery-level-polling.conf use an ENABLE_* variable instead of CONTROL_*.

To quickly check which modules are enabled, disabled or auto, run:

$ grep -r '^\(CONTROL\|ENABLE\)_' /etc/laptop-mode/conf.d

Finally, enable laptop-mode.service.

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. For example, set this value to 254 when on AC and 20 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 (e.g. 128) which will make it spin down less often. hdparm -S and hdparm -B values are configured in /etc/laptop-mode/laptop-mode.conf.

Warning: Spinning down a hard drive too frequently can shorten its lifespan. Take care when choosing a proper value.

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 disk every few seconds, instead the disk journal gets updated every 10 minutes.

Warning: 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. Refer to this thread on the forum: https://bbs.archlinux.org/viewtopic.php?id=134656

Solid state drives

From the official, upstream FAQ:

Question: I have a solid-state disk (SSD) in my machine. Should I enable any of the disk-related parts of laptop-mode-tools, or are they irrelevant?

Answer: They may be relevant, because (a) laptop mode will reduce the number of writes, which improves the lifetime of an SSD, and (b) laptop mode makes writes bursty, which enables power saving mechanisms like ALPM to kick in. However, your mileage may vary depending on the specific hardware involved. For some hardware, you will get no gain at all, for some the gain may be substantial.

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 /etc/laptop-mode/conf.d/intel-sata-powermgmt.conf file for additional configuration details.

USB autosuspend

Tip: USB autosuspend functionality has been moved from the usb-autosuspend module to the runtime-pm module. Make sure to replace usb-autosuspend with runtime-pm on /lib/udev/rules.d/99-laptop-mode.rules.
# runtime-pm.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_RUNTIME_AUTOSUSPEND=1
BATT_SUSPEND_RUNTIME=1
LM_AC_SUSPEND_RUNTIME=1
NOLM_AC_SUSPEND_RUNTIME=1
AUTOSUSPEND_TIMEOUT=2
Note: Review the /etc/laptop-mode/conf.d/runtime-pm.conf file for additional configuration details. If you have an USB tool you always use (like an USB mouse), blacklisting them would stop them from suspending.

Display and graphics

LCD brightness

  • Available brightness values for certain laptops can be obtained by running following command:
$ cat /proc/acpi/video/VID/LCD/brightness
ThinkPad T40/T42

For ThinkPad T40/T42 notebooks, minimum and maximum brightness values can be obtained by running:

$ cat /sys/class/backlight/acpi_video0/brightness
$ cat /sys/class/backlight/acpi_video0/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"
ThinkPad T60
  • For ThinkPad T60 notebooks, minimum and maximum brightness values can be obtained by running:
$ cat /sys/class/backlight/thinkpad_screen/max_brightness
$ cat /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 /etc/laptop-mode/conf.d/lcd-brightness.conf 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 /etc/laptop-mode/conf.d/terminal-blanking.conf 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. /etc/laptop-mode/conf.d/wireless-power.conf 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. /etc/laptop-mode/conf.d/wireless-ipw-power.conf 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 /usr/share/laptop-mode-tools/modules/wireless-ipw-power for details. (note that the ipw3945 is not used anymore, see below)
  3. /etc/laptop-mode/conf.d/wireless-iwl-power.conf 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 /etc/laptop-mode/conf.d/wireless-iwl-power.conf:

IWL_AC_POWER
IWL_BATT_POWER

are ignored, because the /sys/class/net/wlan*/device/power_level 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

Install acpid and enable its systemd service acpid.service.

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-tools to not properly set its state.

This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this particular issue is the laptop-mode script located in /usr/lib/pm-utils/power.d. You can stop any unwanted hooks from running by creating a dummy file in /etc/pm/power.d with the same name as the corresponding /usr/lib/pm-utils/power.d hook. For example if you want to disable the laptop-mode hook:

# touch /etc/pm/power.d/laptop-mode
Note: Do not set the executable bit on that dummy-hook.

Its recommended to disable any hook that has equivalent functionality in LMT.

USB Mouse sleeping after 5 seconds when on battery

First find the ID of you device (it sould look like 046d:c534):

$ lsusb

Put this value into the AUTOSUSPEND_DEVID_BLACKLIST variable in /etc/laptop-mode/conf.d/runtime-pm.conf, for example:

/etc/laptop-mode/conf.d/runtime-pm.conf
...
AUTOSUSPEND_DEVID_BLACKLIST="046d:c534"
...

Multiple IDs can be seperated with spaces.

Note: Don't forget to restart the laptop-mode service. You might also need to reconnect the USB device.

See also