Note: this article is a follow-up of this one. Please take a look at it for extended info.
____________________________________________________
UPDATE: Check this post for related info.
I've been concerned about the energy consumption of my Thinkpad X200s for a while now. It's not that electricity is that expensive or I am sooo worried about global warming, it's more about squeezing the most out of the battery while trying not to damage it. My X200s has the 9cell battery which means 13 hours Lenovo-stated battery time. I'm going to use that twice in it's whole life. The point is in maximizing the long-time battery health. Lithium-ion batteries don't like to be deep-discharged too often, so my goal is to (almost) never let the charge drop below 20%. If someone only needs 2-3 hours of battery time and can charge it back to 100% after that, there is nothing to worry about. There is no way to burn 80% of the battery in that time with this laptop. Of course, if someone travels a lot and can't plug the laptop for a whole day, it makes sense to spend as few watts as possible.
Now, about battery life and energy consumption. Lenovo has made some serious effort to optimize the power drain in software and their Vista drivers are as of now unbeatable. In Vista, the minimum I've seen was 5.2W, in Linux 5.9W or 5.8W. Maybe 0.6W doesn't seem too much, but we are talking about more than 10% here! I've discussed this issue here with some folks, I recommend reading it.
First of all, use common sense. Don't expect 13 hours of number crunching, full-brightness video watching, usb-gadget powering or high-speed downloading. Turn down/off everything you don't use. If you are in a dark room, lower the screen brightness. If you are not listening to music, mute the volume. If you are, use headphones or set the volume a tad lower. Kill all the daemons you don't need. You got it, right?
Second point, my main source of info for all this stuff was this website. Follow all the steps you can. Make sure you have a tickless kernel. Turn on laptop-mode to spin down your hard drive when idle (ONLY if you have a SPINNING drive, you'll gain nothing if you have a SSD). Activate processor energy management and set the cpu frequency governor to ondemand or conservative. When you are familiar with all the goals, keep reading.
Now we are going to get our hands dirty. I'll explain this things for Arch Linux, the exact configuration files / paths may be located in a slightly different place in you distribution, use "locate" command or google to find them.
- General powersaving settings, aka laptop mode: Install and then activate laptop-mode editing the file "/etc/laptop-mode/laptop-mode.conf". After that, check all the files in "/etc/laptop-mode/conf.d/*" and activate all the things you can. Except maybe cpufreq, I rather let cpufreqd do that job, it's much simpler. Start laptop-mode with "/etc/rc.d/laptop-mode start" and add it to your daemon list in your rc.conf file. In case you skip something here, I'll probably mention it anyway, but laptop-mode comes in handy for automating it.
- Cpu frequency scaling. I recommend using cpufreqd, it is very very simple. Install it, do a "echo ondemand > /etc/conf.d/cpufreq" and start the daemon as shown above, also adding it to the daemon list.
- Turn off the video outputs. It sounds weird, but with the xorg 1.5 and the old intel 2.4 drivers, the video chipset doesn't detect the outputs right and turns on HDMI. The newer xorg 1.6 and intel driver 2.6 didn't have this problem when I tried them, but check it anyway. You can do it with "xrandr". If you see a star ( * ) on some line, that output is active. Turn it off with "xrandr --output HDMI-2 --off". You should check again on restart.
- Turn down the wifi power. This is a real power hog, it can drain more than 1.5W doing nothing. The control file is "/sys/class/net/wlan0/device/power_level". With "echo 5 > file" you maximize powersaving. Obviously, "cat file" gives you the wifi status. I've noticed some misbehavior lately, if you are not connected and with some network manager daemon running, it keeps going back to level 0 (maximum power usage). I usually fix it with:
# killall wicd-manager
# /etc/rc.d/wicd stop
# killall wpa_supplicant
# ifconfig wlan0 up
# echo 5 > /sys/class/net/wlan0/device/power_level
# ifconfig wlan0 down
# cat /sys/class/net/wlan0/device/power_level
If the last command shows a "INDEX:5", it'll probably stay that way, but checking it some time later would be good. As usual, let a script do that for you. If it is not 5 but 0, repeat the previous 3 steps. If you are conncected to some network, it usually stays at level 5 without any issue after a simple echo.
- Turn off bluetooth if you are not using it. As easy as "echo disable > /proc/acpi/ibm/bluetooth". Sometimes it doesn't want to wake up again, try a "lsusb" after re-enabling it. Again, acpid is a great way to handle it, here is a chunk of my handler:
*1005)
if [ "$(cat /var/local/bluetooth)" = "disabled" ]; then
echo "enable" > /proc/acpi/ibm/bluetooth
echo "enabled" > /var/local/bluetooth
lsusb > /dev/null
logger "ACPI bluetooth on"
else
echo "disable" > /proc/acpi/ibm/bluetooth
echo "disabled" > /var/local/bluetooth
logger "ACPI bluetooth off"
fi
;;
- Turn on SATA link powersaving. This one is pretty straightforward: "for i in /sys/class/scsi_host/host*/link_power_management_policy; do echo min_power > $i; done". Once every power cycle. If you connect the power plug and disconnect it, only one link file will go back to powersave, so you have to execute it every time you go on battery. Acpid, again, is a great way to do that.
- Turn on PCIe powersaving. The control file is "/sys/module/pcie_aspm/parameters/policy". You can "echo powersave" to it to turn it on and "echo performance" to turn it off. As always, cat will tell you the actual status.
- Activate the sound auto-suspend. Echo the timeout to "/sys/module/snd_hda_intel/parameters/power_save". If you are not using the sound at all, mute it with the hardware button, just in case.
- This one may be VERY DANGEROUS. You can turn off the fan if you are going to do lightweight work and you trust your programs to be infinite-loop-free, so firefox is out of the question here. You have to load the thinkpad_acpi module with "fan_control=1" parameter and then manage the control file "/proc/acpi/ibm/fan". Again, "echo" stuff to set the fan on/off, "cat" to get info. I HIGHLY recommend to use the watchdog function and some script to make sure the processor won't melt. You can read the temperatures at "/proc/acpi/ibm/thermal", "/sys/class/thermal/thermal_zone*/temp" and "/sys/bus/platform/devices/coretemp.*/temp1_input", among others. Google is your friend ;)
- If hal is polling you nonexistent (on a X200) CD drive, kill it.
- If you are not using it, close firefox. The diffrerence may be 1W. If you plan on use it later, a simple "killall -STOP firefox" will do the trick. When you are going to use it again, "killall -CONT firefox". Bind it to a hotkey if you want.
- Also, "ifconfig eth0 down" sure doesn't hurt if you are not using the good ol' ethernet interface.
- Unloading modules doesn't usually work, but you may try it (and post a comment with your findings!). Some people unloads uhci, snd_hda_intel, or iwlagn. I haven't seen any difference trying, but your mileage may vary. You can also take one core of the cpu offline, but it seems to cause to actually consume MORE power than sitting idle. I haven't measured it myself, so if you do, please let me know! The control file is "/sys/devices/system/cpu/cpu1/online", 0 takes it offline, 1 brings it back to work.
- Last but not least: install and run powertop. It's a wise program. Follow it's suggestions. I use it to activate USB autosuspend and see which programs and wreaking havoc. Firefox, amarok2 and any java-based ones are on top positions, but some other programs may be broken and causing the processor to work more than it should. Knotify4 in KDE 4.1 had a 100Hz timer, for instance.
If I remember any other tweak, I'll post it here, stay tuned.
With all these tricks, brightness at minimum, everything off and doing _nothing_, the X200s drains 5.8W. With wifi on, brightness 5/15, browsing and programming (without heavy compiling), it goes at around 6.5W. On full brightness, no wifi, just above 7W. Full brighness + wifi it's under 7.5W. You have to do some pretty heavy stuff to take it above 10W, watching HD movies at full volume and brightness will do it, but anyway, at 10W the battery still lasts more than 8 hours. If you want me to try any specific combination, let me know.
Finally, for more info, try these:
http://www.nabble.com/X200-Battery-Life-td20188937.html
http://www.nabble.com/Linux-Thinkpad-f13633.html
http://www.mail-archive.com/ibm-acpi-devel@lists.sourceforge.net/
Or ask a question in the comments.