How I drastically increased battery life on my Dell XPS M1530
I ordered my Dell XPS M1530 with the “extended”, 9-cell battery in the hopes that I could run on battery power for at least three hours. After using my laptop for a few days I realized that I had got my wish: It ran for about 4 hours with the screen dimmed to ~75%, the ondemand CPU governor enabled, and running a 3D-accelerated (Compiz) desktop. This was with Ubuntu 7.10 (Gutsy Gibbon) and KDE 3.
Recently (well, months ago =) after migrating to KDE 4.1 in Ubuntu 8.10 I’ve had to plug my laptop in after about 2 hours. Even if I dimmed the screen significantly and shut down non-essential services it still wouldn’t last very long. More importantly, as time progressed I knew the problem would just get worse so I decided to investigate. This investigation turned up some surprising tweaks that save a lot of power…
So what was wasting all that electricity? Lots of things but I’m only going to point out the big ones since there are limitless possibilities with Linux to save an extra 0.01 watts. There’s literally hundreds of little parameters I tweaked before I was able to narrow down the following “big energy savers”. The following items helped me get my laptop from using 23W (< 2 hours) down to 15W (~4 hours). Also, in powertop: from ~120 wakeups per second down to ~40. Note: A tilda (~) indicates an estimate. Your mileage may vary:
- HUGE: Enable Nvidia’s PowerMiser options in your xorg.conf (~3-4 watts)
- Surprisingly Large: Turn on the power saving mode of the Intel HD Audio controller (0.5 watts)
- Turn on wifi (iwlagn driver) power management (0.5 watts)
- Upgrade to KDE 4.2 (~1 watt)
- Turn off KNetworkManager (~15 wakeups per second)
- Kill the ssh-agent and gpg-agent daemons (~10 wakeups per second)
- Use Konqueror instead of Firefox (~20 wakeups per second)
- Kill artsd (~7 wakeups per second)
Nvidia PowerMizer
This one takes the cake as the biggest power saver that is also very difficult to find information on. When I was investigating power saving ideas for my laptop I must’ve read a dozen guides with all sorts of suggestions on tweaks you can do to save energy. Not ONE of them mentioned this and it is quite surprising considering how easy it is to turn on. If you’re using the binary nvidia drivers just add the following to the “Device” section of your /etc/X11/xorg.conf to enable maximum power saving on battery power, maximum performance on AC (it will switch automatically and you can verify from within the nvidia-settings app):
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2233; PowerMizerDefault=0x3"
I had two “Device” sections with the nvidia driver in my xorg.conf so I added it to both of them. I’m not sure if this was necessary. Note: You’ll need to restart your X server for this to take effect (control-alt-backspace).
FYI: This page documents the ins and outs of the Linux Nvidia PowerMizer settings.
Intel HD Audio Power Savings
This one really surprised me. Why in the world does an audio controller chip use up so much power? You’d think that by now these little chips would be using .0001W when not actually producing sound. Not only that, but I noticed ZERO difference in audio quality. I suspect that this would only make a difference if low-level audio latency really mattered to me (i.e. I was a musician trying to synchronize my MIDI stuff and my laptop with my recording gear). Put the following little script (99-intel-hd-audio.sh) in /etc/acpi/battery.d to turn on this power-saving feature whenever you switch to battery power:
#!/bin/sh # 99-intel-hd-audio.sh: Turn on power saving mode of the Intel HD Audio controller echo 10 > /sys/module/snd_hda_intel/parameters/power_save
Don’t forget to “chmod a+x 99-intel-hd-audio.sh” to make it executable.
Wifi Power Saving (wlagn)
I’ve never had much luck getting the power saving features of wifi cards to do much of anything in Linux *or* Windows so this one gave me a pleasant surprise. Also, none of the guides I read on Linux power saving had the correct instructions for turning this feature on (likely due to the new wifi networking stack that was added to recent Linux kernels). Here’s how to turn it on:
iwconfig wlan0 power on
Easy enough! To turn it on whenever you switch to battery power put the following script (99-iwlagn.sh) in /etc/acpi/battery.d:
#!/bin/sh # 99-iwlagn.sh: Enable power management on wlan0 /sbin/iwconfig wlan0 power on
Copy the same script to /etc/acpi/ac.d and change ‘on’ to ‘off’ to disable power management when the AC adapter is plugged in.
Upgrade to KDE 4.2
Before KDE 4.2 there were many KDE processes and daemons that hadn’t undergone powertop testing and modifications. Quite simply, there were a lot of processes (artsd, *cough*) that caused a lot of unnecessary wakeups (which uses up power). If you haven’t already, upgrade to KDE 4.2.
For reference, my laptop in KDE 4.2 has less wakeups per second than when in Gnome 2.24. The Gnome team needs to look at all the wakeups caused by gvfs2 and it’s related processes.
Turn off KNetworkManager
KNetworkManager constantly polls your wireless card to get the signal level. This causes a lot of wakeups and it really isn’t necessary if you’re not moving about very much (NetworkManager will still run in the background keeping you connected). Right-click on it and choose “quit” (easy enough!).
Turn off ssh-agent and gpg-agent
These aren’t really necessary for most folks and you might not even be using them. I’m not sure why they’re starting automatically when I login (not in ~/.config/autostart or ~/.kde/Autostart) but they’re easy enough to kill (killall ssh-agent gpg-agent). This probably doesn’t save that much power but I know I really don’t need them so why run keep them running?
Use Konqueror Over Firefox
I prefer Firefox but if I know I’ll be needing every last ounce of battery power I’ll switch to Konqueror. Firefox causes about 20 wakeups per second on my laptop when idle whereas Konqueror uses ZERO.
Kill artsd
It used to be much worse (25 wakeups per second) but it still causes about ~6-7 wakeups per second when idle. There’s no penalty to killing it (it’ll automatically restart itself when a KDE app needs sound) so you might as well if you want to squeeze that last ounce of power from your battery.
Wrap Up
All these changes made a significant impact on my laptop’s power usage. You may not experience as big savings but they’re worth a try. Also, this is not an exhaustive list! I highly recommend installing laptop-mode (sudo apt-get install laptop-mode) and looking at all the configuration options in /etc/laptop-mode/. Especially make sure you put services you know you won’t need (e.g. anacron, atd, cron, cups, ssh, mysql) in /etc/laptop-mode/batt-stop/ and also enable whatever you can under /etc/laptop-mode/conf.d.
2 Responses to 'How I drastically increased battery life on my Dell XPS M1530'
Leave a Reply

on February 26th, 2009 at 12:18 pm
Very interesting. Thank you for posting these, I have a couple people I need to send this to now.
on November 2nd, 2009 at 3:45 am
Thank you very much, I also was able to reduce power usage from 23 Watts to 13.9 Watts. Even though my battery is about two years old, I get about double battery life now.