To get the same battery life running Linux and Windows is still a challenge. Especially for ThinkPads, as Lenovo Engineers seems to magically tweak the drivers to use less power in Windows and get a fantastic battery life(Windows only). For Linux users, power usage has never been excellent out of the box and extra tuning is necessary to double the out-of-the-box battery life. I get more than 12 hours for Ubuntu 11.10 with the 9-cell battery, the power usage in Idle State is around 7.5W.
Installation of Ubuntu on my new Thinkpad x220 i7 was a no brainer, as we know it from Ubuntu and it seems that installing an OS has never been so easy and fast. Every thing seems to be working out of the box, but looking closer there are some things that needs to be tweaked. As notes to myself, I am writing about how I fixed these problems in a series of posts.
The first thing that needs to be tuned is battery life. Under Windows7 I get with pre-installed settings about 10-11 hours of runtime. The conditions were brightness set to 20% with ethernet in use. Under Ubuntu 11.10 out of the box I got around 4-5 hours, and that is quite a difference with some room to optimization.
To get started I installed powertop, a command line tool to show which part drains the battery. To install just call in command line:
and then run it from command line with
You have 5 tabs (change with direction keys).
On the overview tab you see how many Watts are being used now. My goal here is to go below 9W for light work and 7.5W for idling. Change to the tab Tunables, where you see everything that powertop thinks can be tuned (tagged with BAD). Use the direction keys to select those and with Enter-key toggle them, so they say GOOD. For me powertop was not able to scroll so you should make your terminal size to full-screen to see all available options.
On the overview tab of powertop you can observe which hard- or software parts are draining your energy. As usual the rule is turn off everything that you don’t need.
Then there has been a problem with recent Linux kernels with modern processors. For my Thinkpad x220 I added the following boot parameters to grub
pcie_aspm=force i915.i915_enable_rc6=1 i915.lvds_downclock=1 i915.i915_enable_fbc=1
Test them first by adding them on a normal boot process in grub (press e to edit boot parameters, see here). If this works for you then add them permanently to grub, by editing /etc/default/grub. (after editing you have to call update-grub once).
Finally I get idling around 7W usage and working on ethernet (wireless should be about the same) 9-10W. This gives me a battery life time of 10