Laptop Mode Tools
From FrugalWiki
Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어
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 (LMT) 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, LMT provides most users with a complete notebook power management suite.
Contents |
Installation
Service
Start the service with
To get it launched at every boot:
Usage
Conf directory
All config files are in etc/laptop-mode/conf.d/
AUdio
Power management for AC97 Audio Cards
You must have an audio card with type AC97, then modify the file ac97-powersave.conf.
Find the following line:
# Control AC97 audio chipset power? CONTROL_AC97_POWER=0
To enable this function: replace CONTROL_AC97_POWER=0 by CONTROL_AC97_POWER=1
Power management for HDA Audio Cards
You must have an audio card with type HDA, mainly present on laptops, then modify the file intel-hda-powersave.conf.
CONTROL_INTEL_HDA_POWER=0
Set =1 to enable power saving for this card.
BATT_INTEL_HDA_POWERSAVE=1 LM_AC_INTEL_HDA_POWERSAVE=0 NOLM_AC_INTEL_HDA_POWERSAVE=0
This will enable (1) or not (0) the power saving of the audio card when the laptop is on battery (BATT), active with AC plugged (LM_AC) or inactive with AC plugged (NOLM_AC).
INTEL_HDA_DEVICE_TIMEOUT=10
Number of seconds after the laptop must switch to inactive. INTEL_HDA_DEVICE_CONTROLLER=1 To enable (1) or not (0) the deactivation of the audio car after the timeout seen previously. Set to 0 is the little sound when the audio card is deactivate is disturbing you.
Network
Power Management of Ethernet card
You will have to modify the file ethernet.conf.
You may have an ethernet card on your laptop and this tutorial will gain some minutes of battery life.
# Control Ethernet settings? CONTROL_ETHERNET=0
Set it to CONTROL_ETHERNET=1 to enable this module.
# Handle throttling of the ethernet deivce under specific circumstances BATT_THROTTLE_ETHERNET=1 LM_AC_THROTTLE_ETHERNET=0 NOLM_AC_THROTTLE_ETHERNET=0
This enable the overclocking of ethernet speed when the laptop is on battery (BATT), active with AC plugged (LM_AC) or inactive with AC plugged (NOLM_AC).
THROTTLE_SPEED="slowest"
This control the speed, so, set as slowest it will use less battery power.
DISABLE_WAKEUP_ON_LAN=1
To deactivate the wake on lan (WOL) feature of the laptop. In main cases, this feature is not enabled on laptops, you can re-activate it from BIOS or via linux. If you don't use WOL leave this line as it.
ETHERNET_DEVICES="eth0"
Ethernet interfaces concerned by the power management, just add other interfaces separating by ",". Type "ifconfig" to know the names of yours interfaces, in most cases, it's eth0.
DISABLE_ETHERNET_ON_BATTERY=1
This will disable the ethernet on battery. The principle is simple, if you are usng the battry, you may be connected via Wifi and not ethernet (and if you are using ethernet, an AC plug may be closer).
Wireless LAN Power management
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 the file wireless-power.conf.
It's a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets but for Intel Wifi chipset, see below.
Power saving with Intel Wifi chipset
You'll have to modify the file wireless-iwl-power.conf.
The Intel drivers are optimized for power saving but you can set a more effective rule.
CONTROL_IWL_POWER=0
Set =1 to enable wifi power saving
IWL_AC_POWER=0 IWL_BATT_POWER=3
These two options can set the energy economy mode of the wifi chipset. It's a number from 0 to 5. For example:
0=No economy 5=Maximal economy mode
Of course, these parameters will affcet the wifi signal quality. The first parameter is the mode when AC plugged and the second one when using the battery.
Device and bus
USB Auto Suspend
You will have to modify the file usb-autosuspend.conf.
Enabling the automatic USB suspend to avoid useless energy consumption when a device is plugged via USB.
CONTROL_USB_AUTOSUSPEND=0
Set to 1 if you want to enable the USB powesaving.
AUTOSUSPEND_USBID_BLACKLIST=""
To list USB plugs to be not included by the powersaving rules. This can be usefull, if you are using an USB mouse for example (the mouse will switch off due to usb autosuspend...)
To get the USBID, it's easy, type "lsusb" and you'll get something like that:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 002: ID 046d:c043 Logitech, Inc. MX320/MX400 Laser Mouse
See the ID column, ignore "Linux Foundation 2.0 root hub" sont à ignorer, these are unplugged usb. The important ID here is "046d:c043", it's my usb mouse. So, I just have to set:
AUTOSUSPEND_USBID_BLACKLIST="046d:c043"
You can add more USBID of course, but separate them with a space.
# Trigger auto-suspension of the USB deivce under conditional circumstances BATT_SUSPEND_USB=1 LM_AC_SUSPEND_USB=0 NOLM_AC_SUSPEND_USB=0
Enabling USB autosuspend when the laptop is on battery (BATT), active with AC plugged (LM_AC) or inactive with AC plugged (NOLM_AC).
AUTOSUSPEND_TIMEOUT=2
Number of seconds after the usb devices may switch to inactive.
bluetooth suspend
You'll have to modify the file bluetooth.conf.
If you don't use bluetooth when you're on battery, this could be a good idea to disable this feature. Of course, if you don't have bluetooth on your laptop, you're not concerned by this part of the tutorial.
CONTROL_BLUETOOTH=0
Set to 1 to enable the bluetooth suspend.
BATT_ENABLE_BLUETOOTH=0
Enable (1) or not (0) the bluetooth when using the battery.
AC_ENABLE_BLUETOOTH=1
Enable (1) or not (0) the bluetooth when AC plugged.
BLUETOOTH_INTERFACES="hci0"
To list bluetooth interfaces concerned by the suspend function (separate them by "," if you have several bluetooth interfaces).
Power management of SATA Intel controlers
You'll have to modify the file intel-sata-powermgmt.conf.
To know if you have a Sata Intel controler on your laptop, type lspci, and search a line like this one :
$ lspci 00:1f.2 SATA controller: **Intel** Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03)
Well, if it Intel, you'are concerned by this part of this tutorial
CONTROL_INTEL_SATA_POWER=0
Just set to 1 to enable the poser saving function.
Display and Graphics
Disabling useless video outputs
You'll have to modify the file video-out.conf.
Disabling video outputs can be good to gain some autonomy with battery.
CONTROL_VIDEO_OUTPUTS=0
Set to 1 to enable the module.
BATT_DISABLE_VIDEO_OUTPUTS="TMDS VGA" LM_AC_DISABLE_VIDEO_OUTPUTS="TMDS VGA" NOLM_AC_DISABLE_VIDEO_OUTPUTS=""
Set the list of video output to disable, to get their name, type xrandr and you'll get something like this:
$ xrandr Screen 0: minimum 320 x 200, current 1280 x 800, maximum 1280 x 1280 LCD **connected** 1280x800+0+0 (normal left inverted right x axis y axis) 331mm x 207mm 1280x800 60.0*+ 1280x768 60.0 1280x720 60.0 ... DFP1 **disconnected** (normal left inverted right x axis y axis) CRT1 **disconnected** (normal left inverted right x axis y axis) TV **disconnected** (normal left inverted right x axis y axis)
The ouputs named "disconnected" can put into the list, so in this case:
BATT_DISABLE_VIDEO_OUTPUTS="DFP1 CRT1 TV" LM_AC_DISABLE_VIDEO_OUTPUTS="DFP1 CRT1 TV"
NOLM_AC_DISABLE_VIDEO_OUTPUTS=""
Enable or not the power saving when the laptop is on battery (BATT), active with AC plugged (LM_AC) or inactive with AC plugged (NOLM_AC).
Terminal blanking
You'll have to modify the file terminal-blanking.conf.
This will disable virtual terminals (tty) (by default there 11 with Frugalware).
CONTROL_TERMINAL=0
Set =1 to enable the module
TERMINALS="/dev/tty1"
Path to the first virtual terminal, if you have several, you may indicate all of them.
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=50
To control disabling timers when the laptop is on battery (BATT), active with AC plugged (LM_AC) or inactive with AC plugged (NOLM_AC. The ones with suffix "_BLANK" controle the minute number after the terminal must be erased (screen becomes dark) and the ones with suffix "_POWERDOWN", the minutes number after the terminal may be shut off.
LCD Brightness
You'll have to modify the file lcd-brightness.conf.
If the brightness is not well managed by default, you can use laptop-mode-tools.
CONTROL_BRIGHTNESS=1
To activate brightness control
Then asjuts the following values depend of what you need:
BATT_BRIGHTNESS_COMMAND="echo [value]" LM_AC_BRIGHTNESS_COMMAND="echo [value]" NOLM_AC_BRIGHTNESS_COMMAND="echo [value]" BRIGHTNESS_OUTPUT="/proc/acpi/video/VID/LCD/brightness"
Replace [values] by the correct value indicated into /proc/acpi/video/VID/LCD/brightness (cat /proc/acpi/video/VID/LCD/brightness to see it).
With some laptops, there is no brightness file there, take a look into /sys/class/backlight/... directory
Si ce fichier n'existe pas, alors, vous avez peut-être un fichier /sys/class/backlight/…/brightness (remplacez "…" par le répertoire situé dans/sys/class/backlight/, pour le voir : ls /sys/class/backlight/). You can fin the max value into max_brightness file.
So in that case, modify like this :
BATT_BRIGHTNESS_COMMAND="echo [value]" LM_AC_BRIGHTNESS_COMMAND="echo [value]" NOLM_AC_BRIGHTNESS_COMMAND="echo [value]" BRIGHTNESS_OUTPUT="/sys/class/backlight/.../brightness"
Don't forget to put the real value and the correct path instead of "..." !
If you use an external program, like smartdimmer (included into nvclock package):
BATT_BRIGHTNESS_COMMAND="smartdimmer --set 50" LM_AC_BRIGHTNESS_COMMAND="smartdimmer --set 100" NOLM_AC_BRIGHTNESS_COMMAND="smartdimmer --set 100" BRIGHTNESS_OUTPUT="/dev/null"
Processor
CPU frequency
See the file cpufreq.conf and the Cpufrequtils tutorial.
Eeepc cpu
You'll have to modify the file eee-superhe.conf.
This id to use the "superHE" function with eeepc netbook to save energy by slowing cpu speed when using battery and overclocking the cpu speed when AC plugged.
The same thing is present with the linux kernel via the module "eeepc_laptop"
CONTROL_SUPERHE=0
Set =1 to enable SuperHE
BATT_SUPERHE=2 LM_AC_SUPERHE=0 NOLM_AC_SUPERHE=0
Change the superHE mode when the laptop is on battery (BATT), active with AC plugged (LM_AC) or inactive with AC plugged (NOLM_AC). 0 = performance, 1 = normal, 2 = power saving.