Slashdot Mirror


Getting Better Battery Life w/ Linux?

Nuclear Elephant asks: "After a little hacking, Linux has been running great on my Thinkpad T30 for about a year now. I can talk to my cellphone and bluetooth devices, do all kinds of neat hacking on wireless, and just about everything you'd expect to be able to do from a Windows machine, except make the battery last. Even after the standard optimizations (like cpufreq, laptop_mode, brightness, turning off useless processes, etc.) my battery still only lasts about an hour running under Linux as opposed to 2 1/2 hours in Windows. Has anybody come up with some innovative battery conservation ideas for Linux? It seems to be the only thing lacking in this fine operating system." What kernel options might one look into, for saving laptop battery power? Also, what desktop settings (both for Gnome and KDE) would work best, for this situation?

20 of 69 comments (clear)

  1. Use less power by redog · · Score: 3, Informative

    If you use and unload kernel modules, wireless NIC, sound card, hotplug, usb etc etc... your laptop should consume a bit less power, also look to see if your laptop supports processor frequency scaleing

  2. the usual... by ajagci · · Score: 3, Informative

    Have the harddisk spin down (e.g., hdparm, noflushd), dim the screen, lower the processor speed (e.g., longrun). In general, it shouldn't take a lot of effort to get similar battery life using Windows and Linux.

    If you buy your machine from a vendor that supports and pre-installs Linux (e.g., emperorlinux.com), they probably will take care of the necessary configuration for you.

    1. Re:the usual... by kevin+lyda · · Score: 2, Informative

      noatime for your fs options would be good too.

      --
      US Citizen living abroad? Register to vote!
  3. Re:Answered your own question. by Anonymous Coward · · Score: 1, Informative

    Was this seriously just modded troll? I'd say insightful. Off-topic, maybe (that's pushing it), but troll? Sounds like it's the mod who is a troll...

  4. tpctl for thinkpads by doja · · Score: 5, Informative

    Since you have a Thinkpad, you should download and install tpctl. It comes with a daemon called apmiser that controls power use according to CPU usage.

    1. Re:tpctl for thinkpads by aparrish · · Score: 3, Informative

      Apmiser works really well on my X24. I usually get between three and four hours on a charge, as long as I don't "emerge" and compile any huge Gentoo source packages while it's unplugged.

  5. Turn Off Eye Candy by jmt9581 · · Score: 2, Informative
    Definitely try turning off as much eye candy as possible with your WM, whether it's GNOME, KDE, or ratpoison.

    :)

    Visual and audio effects mean processing time, and CPU time uses battery power. Also look into unloading modules that you aren't using, especially wireless network-related modules.

    Alternatively, you could go the way of many /dotters and get a Mac. I'm a Unix geek who just got a used IBook and I love it.

    --

    My blog

    1. Re:Turn Off Eye Candy by ArmorFiend · · Score: 2, Informative

      Visual and audio effects mean processing time, and CPU time uses battery power.

      This is not always correct, it depends on what eye candy operations are implemented efficiently on your hardware. For example, suppose you turn on the nvidia cursor shadow extension. Does it take extra power? No, because the nvidia gpu trivially can compute it in hardware for 1/zillionth of a watt. Now suppose someone does write a non-nvidia X extension that emulates this inelegantly by doing lots of screen blits and software alpha blending: now you're talking power drain. I think another example is apple's eye candy transparent windows and whatnot. Since they're in dedicated hardware, I think they're not a major load.

  6. I know it's not Linux specific but... by Will2k_is_here · · Score: 3, Informative

    Don't forget to decrease the brightness and contrast of your display. I found this can add an extra half an hour or so to your battery life.

    And, as was hinted at by others, take off anything that will cause your processor to do more work than you need. This means removing big GUI's, and use basic software (like anything but Gnome and KDE, Firefox instead of Mozilla Suite, Mutt instead of Evolution, etc.)

  7. Re:Graphics card by PD · · Score: 3, Informative

    Those features are probably not supported. There are people working on them, but at best you'll have to compile your own copy of XFree86. I only know this because I spent a couple hours yesterday getting DRI to work on my T30. I read a lot of docs.

  8. thinkpad utils by tellurian · · Score: 5, Informative
    Go get these from Dag's site:
    • kernel-module-thinkpad
    • tpctl
    • configure-thinkpad
  9. HD sleep by trouser · · Score: 2, Informative

    Windows and Mac OS X will stop the HD after a period of inactivity. I've never got this working in Linux. The drive sleeps briefly before spinning up again. Maybe writing log messages or accessing the swap partition. Don't know. Anyway, that's probably a small part of the problem.

    --
    Now wash your hands.
    1. Re:HD sleep by jthj · · Score: 4, Informative

      You could use a loger like metalog which caches writes to reduce the amount of hard drive use. Also setting the noatime option in fstab will reduce writes to do the disk when you are browsing directories. This will not help the fact that the drives always spinning though. To avoid that you would pretty much need to turn of logging which may not be a good idea. Anyway that's just my .02

  10. Read the Mini-Howto -- Esp Syslog section by Snerdley · · Score: 5, Informative

    There is the "Battery Powered Mini-HOWTO" up on the Linux Documentation Project site: http://www.tldp.org/HOWTO/Battery-Powered/index.ht ml

    Of course, you probably looked there first before you asked Slashdot :)

    Seriously, read the section on syslogd(8). In addition to their suggestions, we have also setup a central log server which allows logging to only go over the network, and not to the local disk at all.

    If you are in a LAN (or wireless) environment, you might want to consider that although the wireless might cost you more powering the NIC than it would hitting the disk (after you disabled syncing).

  11. Re:Answered your own question. by trouser · · Score: 2, Informative

    How would buying a Mac improve the battery life on his Thinkpad? You are a crazy person.

    Incidentally I have an iBook and I get great battery life under Linux (YDL 3.01). Pretty much the same battery life as I used to get under OS X.

    --
    Now wash your hands.
  12. ACPI by Fluffy+the+Cat · · Score: 4, Informative

    One of the single best things you can do is enable ACPI support, which enables higher levels of CPU power saving when idle. This gives me about half an hour of extra battery power, but suspend support is still somewhat flaky.

  13. Lindows for Laptops by Anonymous Coward · · Score: 2, Informative

    For no-brain hassle of running Linux on a notebook computer, why not try a distro that's designed specifically for mobile computers?

    Such as Lindows for Laptops.

    It has built-in power management features and can even be bought pre-installed on a number of machines.

    Disclaimer: I don't work for Lindows, I run Windows and I don't even have a notebook computer. But this is the one commercial mobile Linux solution that I've heard of.

  14. APCI or APM? by ErisCalmsme · · Score: 2, Informative

    You might want to be sure that you have the right power mangament features enabled in your kernel. I had to enable all of the the APCI features myself. You can use dmesg|less to see if your kernel is actually finding the power management feautures that you enabled. But maybe you knew that;) In any event you would see stuff like this:
    ACPI: Battery Slot [BAT0] (battery present)
    ACPI: Battery Slot [BAT1] (battery absent)
    ACPI: Lid Switch [LID]
    ACPI: Power Button (CM) [PBTN]
    ACPI: Sleep Button (CM) [SBTN]
    ACPI: Processor [CPU0] (supports C1 C2 C3, 8 throttling states)

    Alas, my laptop is plugged in 90% of the time and I havent used windows on it for more than the time it took to make a debian cd (which I used to build LFS) so I never had time to notice the difference ;)

    Good luck!

    --
    Chaos is Divine *
  15. Fans are not likely the issue by Andy+Dodd · · Score: 4, Informative

    Given that the default fan thresholds of the 8200 are VERY aggressive w.r.t. power management (i.e. they run the CPU *damn hot* and you should NOT be slowing down the fans compared to the BIOS defaults), I don't think this is the reason for your long battery life with the 8200.

    But I can confirm that my battery life with my I8200 is comparable to, if not better than, under Windows.

    Power management features I use:

    cpufreq (Both speedstep-ich and p4-clockmod as modules - Load speedstep-ich, set the "powersave" governor to step down the voltage/speed, then load p4-clockmod to drop the clock speed even more. I've been running my P4-M 1.7 at 600 MHz lately, it's more than responsive enough for AIM and web browsing.)

    nvclock (Does not support mobile chipsets out of the box, but I disabled the code that causes nvclock to not touch mobile chipsets and it works fine on my GeForce 4 Go 440. I'm assuming the devs of nvclock disabled this because it's an overclocking tool and overclocking mobile GPUs is a bad idea, they forgot that mobile users might actually want to UNDERCLOCK their GPUs...)

    Get LOTS of memory. Enough to allow you to disable swap. If you have swap enabled, it seems that even with an idle machine, it'll page stuff in/out just enough to FUBAR any attempts to make the HD sleep.

    --
    retrorocket.o not found, launch anyway?
  16. Power Management Under Linux by darkmeridian · · Score: 2, Informative

    I have linux and ACPI seems to work pretty well. The largest things are:

    1. The screen. Blank it if possible (edit XF86Config-4) and use the darkest setting you can see with. Redundant, I know. But pay attention and actually do it.
    2. The wireless. The radio sucks up a lot of power. If you are not using the web, turn off the card. (You can use the tx setting for your card to put it into a sleep state.)
    3. The hard drive. Use hdparm to shut it down if no one is using it.
    4. Suspend. Doesn't work on the Latitude D800 yet in KDE. But quit KDE (set session manager to save your settings) and then suspend/hibernate.
    5. Enable Throttle. You have to enable this in the BIOS as well as the kernel. Don't forget to enable the modules you need for your particular laptop and chip/chipset.
    6. Enable auto-throttle. Throttling by itself is useless because you won't do it manually. You have to automate it. Download and compile auto-throttle and start it up on boot. The Pentium-M has eight modes, I believe, and autothrottle moves it up and down really nicely. No lag at all. It must have something to do with the pre-emptible kernel in 2.6.3.
    7. Don't blast music. This takes up a surprising amount of power.
    8. In windows, don't set stuff like anti-viruses and disk defragmenters to automatically start. This isn't really good for your battery life if it starts up.
    9. Don't compile programs while on battery. (Duh, right? Stupid me.)

    I get 3:15 hours of battery life on a D800 with the screen on the brightest setting and the internet. Under Linux! Battery life isn't just for windows, you know? Just word processing and web browsing. Cool, huh?

    --
    A NYC lawyer blogs. http://www.chuangblog.com/