Why Is Linux Notebook Battery Life Still Poor? 907
Ganty writes "I recently purchased a Lenovo W500 notebook, and after 'downgrading' to XP and creating a dual partition, I found that I had a battery life of nearly three hours using the long-life battery, at this point I was a happy camper because it means that I can watch a DVD during a flight. I then tried various Linux distributions and found the battery life under FOS to be very disappointing, with an average of 45 minutes before a warning message. After settling on Ubuntu I then spent three days trying various hardware tweaks but I only managed to increase the battery life to one and a half hours. Unwanted services have been disabled, laptop mode has been enabled, the dual core CPU reduces speed when idle and the hard drive spins down when not needed. Obviously Apple with their X86 hardware and BSD based OS have got it right because the MacBooks last for hours, and a stock install of MS Windows XP gives me three hours of life. Why is battery life on notebooks so poor when using Linux? Some have suggested disabling various hardware items such as bluetooth and running the screen at half brightness but XP doesn't require me to do this and still gives a reasonable battery life."
Drivers (Score:5, Informative)
I was able to get my X41 tablet to have good battery life (a bit better than windows actually), but it took some doing. Powertop is a godsend, it pointed me to the i915 intel drivers as the culprit. Disabling DRI made a huge difference.
Powertop (Score:5, Informative)
Re:Do you have non anecdotal evidence? (Score:5, Informative)
Re:Do you have non anecdotal evidence? (Score:5, Informative)
And I have plenty of anecdotal evidence that power management works really well with whatever OS the computer was intended to run, and is alright-to-crappy with any other OS.
My MacBook Pro runs decently in OSX, and drains quickly in WinXP.
My HP Compaq laptop runs really long in Vista, though its still alright in Linux. (haven't done a comparison, though... But Linux still whines when battery #1 is almost dead, even if I have battery #2 available, installed, and at 100%)
The crux of the problem is that Linux is *rarely* the "intended OS" for any of these platforms, so the hardware manufacturer never invests any effort to make sure Linux power management drivers work correctly on them.
Re:Poor choice for screensaver? (Score:3, Informative)
...the dual core CPU reduces speed when idle...
means that he is NOT running BOINC or other numbers-crunching software...
Consider your hardware (Score:5, Informative)
I have seen this on a 15" PowerBook (Score:4, Informative)
I dragged my old 15" Powerbook (1Ghz G4) out of retirement to have a look at Ubuntu, and while this may be a totally unfair comparison since the PPC build is hardly going to be the major focus of their optimising, but the PB did run much hotter under Ubuntu than it did under 10.4, and fan control was much less precise. It's not surprising, since Apple made the thing and obviously designed OS X around all the various controllers and sensors in it and Ubuntu has to run on anything you can throw it at, but that would be what I put this down to.
I was not sufficiently experienced at the time to do much to cure it, but I did install some software that had been written to make the fan control better which did help a little to keep it cool, but I'm not sure it would last long away from the power adapter.
Re:What about netbooks? (Score:2, Informative)
I have a Lenovo S10 with 6-cell battery.
I dual boot with Ubuntu 9.04 and Win7
Ubuntu: 4.5 hours
Win7: 6.5 hours
It also has that "Splashtop 'Instant on'" Linux distro on it. (Which takes about as long to boot as the other two). I think that matches the Ubuntu, but I've have to reboot to verify that.
Re:power saving tip: disable the optical drive (Score:4, Informative)
I may sound like a jerkwad here, but why waste all that battery power watching a dvd when you could watch the divx version off local storage?
That's not a jerkwad sort of suggestion. If one knows one is going on a flight/trip, it makes all the sense in the world to rip that video to the harddrive where battery performance is far greater than with a DVD spinning for a couple hours. I'd recommend handbrake. http://handbrake.fr/ [handbrake.fr]
Re:Consider your hardware (Score:5, Informative)
Distro Choice (Score:3, Informative)
1) Ubuntu Netbook Remix (Both Gnome and KDE)
2) Moblin
3) Puppy
4) Macpup Opera
5) Xubuntu
6) gOS
7) Damn Small Linux
Yep - either those who target netbooks or those which try to be resource friendly. If one can run on a much older system well then a newer system it should hum, plus not be such a big hit on the battery life.
Advanced Configuration and Power Interface... (Score:5, Informative)
Some have suggested disabling various hardware items such as bluetooth and running the screen at half brightness but XP doesn't require me to do this and still gives a reasonable battery life
Are you sure? My netbook dims the screen when I pull the power cord on both XP and Win7... though it might be the BIOS doing that.
Anyway my suggestion is checking if ACPI works as it should. AFAIK laptops are notorious for buggy ACPI implementations that are only tested with Windows. Linux now pretends to be Windows XP when doing ACPI stuff, before that they noped out some part of the BIOS to make it work with Linux but that wasn't reliable. Look into if you can change how Linux does ACPI and try that.
Re:Just one instance of a known problem... (Score:1, Informative)
Yes, open source really has a say on what goes on in companies drivers especially closed sourced ones... ::Rolls Eyes::
It simple really, many companies only do "Just Enough"(TM) to get linux workiing on a small market while focusing on performance in the much larger windows market. It only takes one bad driver to kill battery life.
Firefox may be one cause (Score:1, Informative)
The hackintosh community has noted that netbooks run hot with Firefox (all versions),
but stay cool when running Safari. This problem is discussed here:
http://mydellmini.com/forum/general-mac-os-x-discussion/6550-my-os-x-mini-gets-pretty-warm.html [mydellmini.com] ... but is not limited to mini9 hackintoshes. Other netbooks with heat issues run
hotter with firefox.
Perhaps firefox has a busy loop for event dispatching somewhere? I did a simple
test running down my battery, and firefox cuts it in half. (!) But that's just one data point.
Anyone know for sure?
Re:Powertop (Score:5, Informative)
+1 powertop will also give suggestions, you can permanently configure sutff.
on my Acer i also managed to get more battery life than windows by:
switching my DE to fluxbox
not running anything in the background (except kpowersave)
turning off unused peripherals (wireless chips eat power with their scans, webcams hold charge in their CCD, etc)
using buttons/keys over mouse where possible (I think most of the touchpad drivers run in software, thus prevents the CPU reaching lower sleep levels)
I have had the opposite results (Score:5, Informative)
While I can't say that my Dell laptop's power management has been piss-poor under Windows (I can't really say that I used Windows on THIS particular computer that much, but I did on previous Dell models) and the power management was pretty excellent especially when the Intel speedstep software was running. If it helps, I run Fedora and Fedora and Dell laptops have been getting along fabulously for at least the past 6 or 7 version releases.
But one thing about running Windows that has always been a complaint and that's it's estimation for "time remaining." Whether looking at file transfers or remaining battery life, Microsoft ALWAYS seems to over-estimate "time remaining" or has at least reported the most optimistic figure possible. What I'm getting at is that it is QUITE possible that the Windows battery life you are reading is either untrue or unrealistically optimistic.
I know on my Dell Mini 9 running XP and watching video on battery power initially claims I have like 3 or 4 hours battery remaining, but before the two hour movie is complete, it wants to die.
The biggest source of battery drain on my netbook is CPU processing. No doubt with my other notebook, it would be hard drive usage followed closely by processor/gpu usage. This leads me to the next suggestion when using Linux -- use the graphics driver provided by nvidia or ati. They manage power better because they have the "secrets" that the GPL drivers don't have access to. Remember that a GPU is still a processor and eats power when processing.
Power management on laptops is all about paying attention to everything that draws power and being aware of it. For example, if it generates heat, it's using power... usually lots of it and cooling systems draw even more power as a consequence. Dial that speedstep down WAY low when unplugged.
Re:Do you have non anecdotal evidence? (Score:5, Informative)
This is, of course a vast simplification, but it gets the point across. The linked to article also shows how to use laptop mode to address these issues and extend batterly life (although, it seems to me that there is a trade off in the ability of journaled file systems to perform correctly).
Turn Syslog off (Score:4, Informative)
No problem here... great power mgmt with Ubuntu (Score:5, Informative)
I'm surprised, my experience with Ubuntu 9.04 is very good on similar Thinkpad hardware. After upgrading from a decrepit IBM T42p to a Lenovo T61p (UXGA->WUXGA = similar screen size/power demands to the hi-res W500), I still get ~4:00 out of the Thinkpad extended battery.
Some ideas; perhaps these will be useful: .45A Seagate, and my experience was dramatic: 30-45min more battery time from that change alone. When I upgraded the recent hdd, I made sure to select one with less than .5A consumption.
- There is a bios setting on the Lenovo-era Thinkpads where you can force the screen to high brightness. My Ubuntu install manages this correctly (i.e. turns it on when on line power, off when on battery). However if yours does not kick the brightness to the normal range off line power, it'll kill the battery faster than any other factor. On high display brightness, you will be lucky to get more than 90min on battery.
- Hard drive power consumption does make a significant difference, and for that, Windows does tend to spin down the drive more frequently. With a high-load drive the difference can be pretty dramatic, but a more efficient drive closes the performance gap even if Linux isn't as aggressive with drive power management. For example, with the last upgrade to the T42, I replaced the old 1.1A IBM drive with a
- Check your display drivers. On the T61 with the default Ubuntu installation, the CPU load increased with the open-source video driver, because it's compensating for certain unknowns in the GPU by offloading to the CPU/being more inefficient. Loading the Nvidia driver not only increased performance (a lot), but (again) noticeably reduced power consumption.
In short, optimize, optimize, optimize.... and sometimes that means installing the right driver, not stripping things down.
Re:power saving tip: disable the optical drive (Score:3, Informative)
A Few More Pointers (Score:5, Informative)
It's sadly true that almost all Linux applications / distributions have not taken writing-to-disk into account to reduce power. On the other hand, video / 2G / 3G graphics acceleration in hardware makes a huge difference, which is why I would really like to see more companies offering more in terms of stable hardware acceleration.
Here are the general solutions (any unix-like OS) (Score:4, Informative)
Look in cron and disable stuff you do not use, especially locate.
Do not use the optical drive and make sure you are quiescing it.
Turn-off access time modifications for the hard disk.
Turn off fsck on boot.
Turn off periodic SMART status checking (on some drives this spins it up).
Tune the time to idle the drives and the periodic disk flusher (you have basically UPS with a laptop anyway).
Turn off swap.
Use a light simple window manager such as fvwm2 instead of something like gnome where lots of files are being accessed all of the time and you have many procs/threads running and the neat effects burn the battery.
Find the docs to your graphics drivers and tweak the tunables to use as little power as possible (this will give you much more than you likely expect).
Turn off bluetooth and wireless when you are not using it.
Don't use any of the crazy sound daemons.
You probably don't need wake-on-magic-packet for a laptop, turn it off, it helps a lot for some NICs.
Do you use multicast for wireless, most likely not, read the docs and figure-out how to get your driver to ignore that, it can conserve more power on some cards.
With some of the older chips USB was very power hungry in sleep (if that's your case tweak what you can so that it does as little as possible, likely turning off the wake on keyboard and mouse since you shutting and opening the lid should handle that).
Install a flash blocker and/or ad blocker and use gnash where you can instead of the adobe version.
Re:Nice title there buddy (Score:3, Informative)
I loaded the movies into a RAM disk and set the hard drive to power down, shut off syslog, and removed the DVD drive completely. Try that on a Windows box!
You mean like using RAMDiskXP [cnet.com] to do exactly the same thing?
Re:Do you have non anecdotal evidence? (Score:3, Informative)
Yeah, my Asus Aspire one lasts for about 3 hours on a charge under Linux.
Could you post the distro/tweaks you did to get that? Mine gets about 2 hours with Ubuntu Jaunty Netbook Remix...
Re:Firefox may be one cause (Score:3, Informative)
There is a common complaint about Flash video performance in Firefox. There is a tip/fix [downloadsquad.com] going around that supposedly fixes it because the problem seems to be that Firefox wants to save the tabs every TEN seconds so the user can start where he/she left off after shutting down the program or after a crash.
Save every 10 seconds? That seems a bit much and it certainly seems it could contribute to heat.
Re:power saving tip: disable the optical drive (Score:4, Informative)
I can point to a few hundred things which are easy in Linux and involve jumping through many hoops in Windows. Yeah, operating systems are different, and thus they have different benefits and problems.
Re:RTFM (Score:0, Informative)
... which the previous poster so eloquently ironized
It always cracks me up when Americans invent bad neologisms because they were unaware that better words already existed. Satirised? Mocked? Parodied?
Re:Do you have non anecdotal evidence? (Score:5, Informative)
There are very few modern models where battery life is given as different from XP. In those cases the difference is rather small (not like what the article poster is experiencing). In at least one of those cases, the Linux hardware configuration is different than the XP hardware configuration. (Different flash drive size, there may be other changes such as a different WLAN card. For example, the Dells that have Ubuntu preinstalled have a different hardware configuration than non-Ubuntu Dells of the exact same model number.)
For example:
1101HA is given as being available with either XP or Linux. Only two battery life numbers are given, one for each possible battery configuration.
The 1002H is XP-only and seems to be one of the worst performers in the 10" class (5 hours)
In my experience, the most common causes of lower battery life under Linux:
NVidia chipsets. The power management in their driver is one of their lowest priorities. If you want games, you're going to have to sacrifice battery life.
Sometimes the "ondemand" cpu speed governor can be a little flaky and step to high speed way too quickly.
Keep in mind that's Asus's own Linux distro which most people regard as not being that hot. It may be missing some power tweaks available to other users. With the exception of Nvidia-graphics based laptops, I've usually been able to get much better real-world battery life on a machine with Linux than Windows. (Exception being that I haven't gotten FSB clock changing working on the Ubuntu partition of my Eee 1000HE yet - downclocking the FSB is the core component of Asus's "Super Hybrid Engine" power management scheme.)
Re:What about netbooks? (Score:4, Informative)
Is it one of the new "Super Hybrid Engine" Eees like the 1000HE?
You need to figure out how to underclock your FSB - that's really all that Super Hybrid Engine does on XP. Ubuntu's power management doesn't touch the FSB by default.
I haven't gotten around to doing this on my 1000HE yet.
Re:power saving tip: disable the optical drive (Score:4, Informative)
Handbrake can't do a straight VOB rip.
Depending on your video chipset, you might trade off optical drive power for CPU power usage if you use Handbrake. Some vid chipsets accelerate MPEG-2 very efficiently but not MPEG-4 ASP or AVC.
Re:power saving tip: disable the optical drive (Score:1, Informative)
Because a hard drive has:
a. Smaller diameter (less inertia when spinning up/down)
b. Balance - CDs are not nearly as well balanced as platters
c. Lighter read mechanism (magnetic head vs laser)
d. Better bearings
e. Less thrust friction (the CD must be held in place by pressing it against something causing additional friction in CD drive bearings)
f. Less frictional losses in general. Platters are in a sealed, clean environment.
g. Higher data density (less spinning/MB)
h. Intelligent read-ahead mechanisms (some of this is in the OS, but still)
i. 32MB+ cache on the drive itself (assuming a newer drive)
Re:Do you have non anecdotal evidence? (Score:5, Informative)
Well, DUH, it HAS to be perfectly optimized for the hardware.
Battery management requires checking every single pin on your hardware and ensuring that you've set the i/o correctly for sleep mode.
If you have even one pin with a pull-up resistor set as an output, then you'll get lower battery life than the nominal case. If you have just random I/O on unused pins, then you're going to get greater drain than ideal.
I'll qualify that statement by saying I'm an Electrical Engineer with embedded experience. One of the products I worked on was a GPS / VHF tracker with a 12uA standby current. Another was a VHF tracker with an 8uA standby current. Slight modifications to the firmware would bring the standby current up to 50-100 mA. That's more than 1000x more standby current.
My experience dealing with Linux developers (and realistically, software developers in general) is that they're all terrible at determining the link between hardware and software. Look at the derision you get online towards C. Linux devs are worse -- if you're not running their exact hardware on a machine you bought in the last month, then it's your problem, not theirs. "Weird, it works here. Have you tried recompiling the drivers?"
It's fairly easy to map these pins, BTW. All you have to do is set everything to an output, set it to 0, and then turn everything to an input. Everything that's high has a pullup resistor. Do the same with 1 and everything that's low has a pull-down resistor. Now you know which pins must be inputs when you're not using them.
Of course, since you taught yourself programming with Ruby on Rails, you know all this, right? It's not like you'd have to have some low-level knowledge of the hardware in order to effectively make a complete synergistic hardware and software package.~
Re:As one of the few (non-tech) lawyers..... (Score:4, Informative)
Guy buys a laptop which has been designed and optimized to run under windows, which has been pre-installed. Any necessary configuration to optimize battery life was done when the laptop was imaged.
Now someone takes said laptop and installs Linux on it. That particular hardware combo may never have been tested before and no optimizations have been done on it.
It would be unsurprising to me if the latter situation didn't work very well.
I run Linux on my laptop exclusively, but getting the pm stuff optimized is a big pain. The amount of fighting to get broken drivers and BIOSes working is not for the faint of heart.
Your best bet for a Linux laptop would be a pre-installed version that's more than a windows laptop with Ubuntu slapped on it.
Otherwise you'll be in for a a lot of fiddling.
Re:Poor choice for screensaver? (Score:5, Informative)
A quick Google search shows that the basic kernel for all versions of Ubuntu has been tickless since 7.10. /boot/config-`uname -r`
http://www.ubuntu.com/news/ubuntu-server710 [ubuntu.com]
I know my system (karmic) does. You can check with:
$ grep CONFIG_NO_HZ
CONFIG_NO_HZ=y
Re:Linux is not for laptops. (Score:3, Informative)
Linux works equally well on Top500 supercomputers and $20 wireless routers.
Maybe the Desktop Environment needs some work, maybe the hardware manufacturers need to get with the program in the drivers arena, but the Linux operates the hell out of whatever you put it on.
Re:power saving tip: disable the optical drive (Score:2, Informative)
At least on some laptops it is worthwhile to disable the SD card slot. I know that in the case of some EEEPC's the SD card is on the same integrated USB as the webcam, and shutting that whole thing off actually nets a fair drop in power consumption.
Re:Do you have non anecdotal evidence? (Score:4, Informative)
That's nonsense. It doesn't explain why designed-for-linux netbooks like the Linux Eee systems perform as poorly as they do.
I would bet that the problem can be largely attributed to 1) vm.swappiness being set too high and (IMO every laptop user should set vm.swappiness = 0 unless they know a higher metric would help their specific operation behavior) 2) ext3 sucks horribly, 3) linux often defaulting to the 'standard' and ignoring/overriding hardware bugs which might be accounted for in the closed drivers (such as with the BIOS), 4) hard drive power management options/defaults are usually not very good and do not account for/override filesystem settings.
There might be something else to it, too. I've personally never had a laptop that got better battery performance in Linux than in Windows; it's always just been Part of the Deal of running Linux to get worse battery life, despite what I've heard others say.
Re:Poor choice for screensaver? (Score:5, Informative)
guy@guy-desktop:~$ grep CONFIG_NO_HZ /boot/config-`uname -r`
CONFIG_NO_HZ=y
guy@guy-desktop:~$
That's Intrepid on a desktop. We're tickless by default, laptop or desktop.
The GP who asked if the kernel is tickless asked a valid question, but it's been turned into a FUD campaign by the Linux bashers.
Re:Powertop (Score:5, Informative)
your wlan scans the surroundings
Windows has better ACPI stuff because most of the drivers are 3rd party, so while its not scanning the card sleeps, eventually NM+well supported cards will catch up, e.g ath5k now handles me turning the card on/off, this is a big improvement from custom rmmod scripts (if you want it sooner, go do it)
it has tons of background stuff active
The background stuff isn't "linux's" fault, its down to whatever distro/setup you have, e.g if doubt slackware/arch users bitch about battery life. For example, i run crap loads of background stuff that requires a net connection, it can't magically know that I've decided to watch a film on batteries without a net connection.
you have a colorful UI with FX
I think a lean KDE3 install might compete with XP, running fluxbox wasn't because the DE is particular efficient (which it is), it's because it didn't suit my setup.
Perhaps KDE4 might compete with Vista, but i don't know i ran vista once and it ate my batteries.
and full brightness,
Again changing brightness affects both OSes equally or do you think linux has some allergy to light?
you use the mouse
While the linux touchpad drivers probably aren't as good as the windows driver, my advice stands for windows too, using keyboard/button inputs uses much less cpu than a touchpad.
So what was the point of your post? To bitch about how the background processes and drivers in linux arn't as efficient as those in windows? How about you go fireup powertop and file some bug reports. If you'd understood the point of my post (which ill go out on a limb and say you had no fucking clue), it was that the problem doesn't lie in the kernel (although for the wlan scanning it may), but rather in the background processes (looks at pulseadudio, though it saves audio card power im sure it wastes more in CPU wakeups) and Desktop environment, which over time do actually improve (firefox is still a bad offender but its gone from ~100 wakeups/s to ~40 in 3.5), however if you want to see battery life improve quicker then do something (just filing bugreports helps [1] [lesswatts.org] bitching about it on slashdot does not!)
Re:As one of the few (non-tech) lawyers..... (Score:3, Informative)
Download a LiveCD and just boot up and click around. If it piques your interest, it's quite easy to resize your hard drive to create a Linux partition next to your windows partition and choose your OS at boot time.
Articles like this make things sound harder than they actually are. The great thing about linux is that common questions and problems are documented to DEATH on various how-tos and forums. The linux community isn't satisfied until there are 5 How-Tos to fix any given issue.
In Windows if you run into a problem you might just be screwed because MS didn't want it to work the way you want it to.
Re:Poor choice for screensaver? (Score:3, Informative)
Actually if I remember correctly it is Netbook Ubuntu or something similar to that. It isn't just Ubuntu compiled differently.
Drivers compiled on Kernel (Score:3, Informative)
Re:Poor choice for screensaver? (Score:3, Informative)
Because generally speaking using a tickless kernel is always a good idea, not just when you're on battery. If for some reason you're not using a tickless kernel it's because you specifically did not configure your kernel with it and who is the kernel to question you in that case? (any major distro will have tickless kernels these days and someone too inexperianced to properly configure their own kernel, shouldn't be configureing their own kernel)
As others have stated above, I have seen the exact opposite of what the summary is claiming.
Re:Poor choice for screensaver? (Score:5, Informative)
First, Microsoft doesn't "do it". Without specific drivers provided by the OEM, the power-save functionality doesn't work well on Win either. The fact that all OEMs provide these is simply a matter of scale, Windows is 90% of the market, after all.
Secondly, Apple controls the hardware. They can do what they like and make sure it works because it's a limited subset. You pay extra for that too.
What you're basically asking for is "why can't this free software made by volunteers be as instantly capable with any hardware on the planet as the big corporate monopoly that spends zillions on the same thing"?
Do you now see the idiocy of the question?
Hey, the fact that it works at all is the miracle here. Okay, so you might have to tweak it. Generally speaking, you don't have to, but there's always edge cases.
Also, the existence of differing distributions reflects different needs. There's stuff in any install of Windows that people often don't need. So why install it? Linux being customizable for the task at hand is a feature, not a drawback.
no problem here (Score:3, Informative)
I have an EEE and on an HP DV5, and I get about the same batter life under Windows and Ubuntu, both with the default installations.
Re:Poor choice for screensaver? (Score:4, Informative)
BOINC automatically goes idle when the notebook goes to battery under both Windows and Linux, unless one has changed the default configuration. I run it on my notebook, and have seen this often when unplugging it.
Re:Poor choice for screensaver? (Score:2, Informative)
Cause I have been using Linux exclusively for my servers, desktops and notebooks for years and I didn't know there was a "laptop" ubuntu.
Well then quite frankly you must be fucking blind not to see it at the top of Ubuntu's own front page.
Re:Poor choice for screensaver? (Score:5, Informative)
Re:Just one instance of a known problem... (Score:3, Informative)
Errr, ATI actually HAS opened up their documentation for some time now.
But like was said before, the devs are concentrating on getting things to work before making things more efficient.
Re:Poor choice for screensaver? (Score:3, Informative)
Such exclamations should be redundant really.
Complaints should include enough information to allow those that are
able and willing to address the problem and those that are not to
avoid the problem.
Anything less is hard to distinguish from a genuine troll.
Re:Poor choice for screensaver? (Score:2, Informative)
I have a Vaio and Sony basically don't care about respecting ACPI standards... That lead to an annoying and long-lasting screen backlight problem.
So devs have to guess and reimplement quirks that were designed for Windows while all along everything should just be following standards.
Anyway, the http://www.lesswatts.org/ [lesswatts.org] site has interesting things about reducing power usage on linux, including PowerTop which will tell you what is using up most cycles/power on your box.