Extending battery life on X200
Contents
Overview
I own the beautiful Lenovo X200 and run Ubuntu Intrepid on the machine. Its battery life is significantly lower than that under Windows and many users have reported that it runs hotter than under Windows.
With the changes below and a 9 cell battery I get over 9 hours on an idle system with backlight at the lowest level and wireless radios off. Before the changes I was only getting 5 hours.
The system also runs a lot cooler and I do not need tpfan (sw fan control for the ThinkPad available here), the built-in hw controller falls back to the lower speeds shortly after a CPU load subsides.
Details
The changes fall into 3 categories:
- Removing packages that create unnecessarily frequent wake up interrupts.
- These interrupts wake up the CPU, preventing it from staying in its most energy efficient state.
- I used Powertop from www.lesswatts.org for this task.
- Lowering the voltage supplied to the CPU.
- Lowering CPU voltage does not impact performance since the clock frequency is unaffected
- I used phc patches and phctools available at www.linux-phc.org for this task.
- Turning off radios you do not need
- My X200 has 3 wireless radios: Wifi, Blutooth, Broadband wireless
Finding and removing high interrupt packages
Install PowerTOP from here.
Run PowerTOP as root (sudo powertop) and look for the packages that come up on top of the interrupt frequency list. These are the packages that wake up the CPU most frequently.
In my case the majority of the easily preventable interrupts were from 3 packages:
- i915, the intel graphics driver
- SCIM
- Gnome Power Manager
With the first one accounting for the bulk of the battery life improvement.
The %'s in PowerTOP give you an indication of what to focus on, no need to worry about a 1% problem (unless it is easy to prevent that it), it will not have much impact on your battery life.
Remember that over time these packages will improve and will not need to be removed.
Turning off DRI
Just insert: Option "NoDRI" to the "Device" section in /etc/X11/xorg.conf. This turns off all 3D, so no compiz or other fancy effect. Worth it for me because the impact on battery life is substantial.
Turning off SCIM
I had my system set to accept foreign characters. Going to System > Language Support > Disable support to enter complex characters does the trick.
Turning off Gnome Power Manager
You may decide you cannot live without it, but on my system I disabled Gnome Power Manager from the startup list: System > Sessions > Power Management daemon.
I replaced it with the Gnome Panel Battery Charge Monitor (Add to Panel...) which works well enough for me.
Reducing CPU voltage
Installing phc module patches
The phc module patches are available here, make sure you get the version that matches you kernel version. You can easily check by typing uname -r in a console.
You need not compile your own module, check the thread, users have posted already compiled versions of the acpi-cpufreg.ko module for most kernel versions.
Once you have the apci-cpufreq.ko module, back up the old module:
sudo cp /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko.bak
Then copy the new module to the right place:
sudo cp acpi-cpufreq.ko /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq
Restart your system and check that you now have voltage controls by typing: more /sys/devices/system/cpu/cpu0/cpufreq/phc_vids
You should see something like:
38 29 23 13 (your values may be different)
These are the voltage index values for the 4 frequencies available on your CPU. They are directly related to the actual voltages, phctools does the computation for you.
Intalling phctools
Download them here.
Put the package where you can conveniently access it. Use the install script (install.sh) to enable pctools to run without requiring a password.
Start phctools by running phctools.sh.
Experimenting with lower voltages
This is the scary part: you will have to crash your system on purpose.