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."
Poor choice for screensaver? (Score:3, Insightful)
Is your screensaver running SETI?
Probably not a good idea if you want to conserve battery life.
Re: (Score:3, Informative)
...the dual core CPU reduces speed when idle...
means that he is NOT running BOINC or other numbers-crunching software...
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:5, Insightful)
Re:Poor choice for screensaver? (Score:5, Insightful)
Re:Poor choice for screensaver? (Score:5, Insightful)
And people expect an average computer user to want to use Linux when they have to make sure their kernel is compiled right to do basic power management?
No, you expect the average computer user to install the mobile or laptop version on a laptop, which come premade specifically with optimizations like these.
One size does NOT fit all.
Re:Poor choice for screensaver? (Score:5, Insightful)
But why should the average user have to worry about tickless
after all other OSs figure out your hardware and install the right options. A distribution could worry about the user experience and take care of this automatically or, at worst, ask you if you are installing on a battery powered system.
There is utility in having one entity responsible for the ease of installation and not punting it to the varying knowledge/skill levels of the user.
If Microsoft and Apple can do it....
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.
Re:Poor choice for screensaver? (Score:5, Insightful)
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?
No, I don't see the idiocy of the question. The answer gives an important insight into one reason why Linux isn't more successful on the desktop.
Users of computers don't care that Linux is partly made by volunteers. They want their computers to last as long as possible on a battery. They don't want to hear excuses about how Apple and Microsoft have better access to the hardware suppliers than the Linux developers. The fact is they do have better access and that leads to better power management.
I'm afraid you just have to find a way to deal with it. In fact, bleating that it's not fair because Linux developers are volunteers may make things worse. You're basically saying Linux is amateur. People want their software to be professional.
Re:Poor choice for screensaver? (Score:4, Insightful)
Linus not liking ACPI is no reason for other people to not write patches to make the kernel more efficient under battery power.
Re:Poor choice for screensaver? (Score:4, Insightful)
I bet if you installed Windows Server 2008 on your laptop the battery life would kinda suck to; Server OSes tend to expect they'll be running balls to the wall ready to spawn new processes by the hundreds, not conserving a few mAHrs of battery life.
Re:Poor choice for screensaver? (Score:5, Interesting)
The last time I installed XP on my laptop I had lost some, but not all, of the OEM-supplied driver disks, and it ended up taking me a total of about eighteen hours of solid graft to get it to work. Incidentally, I grew up on Windows, and have only really gotten into FOSS stuff in the last three or four years, and the last time I installed Ubuntu (which took about twenty minutes) it had already configured my screen to the right resolution, got the wi-fi and bluetooth working, got the frickin' bog standard ethernet adapter working, and suggested that I might want to download the right drivers for my GPU by clicking OK and typing my password.
When people say these things, I always have to wonder whether they have ever actually installed Windows. Maybe it's just me, but it takes longer for XP or Vista to simply copy the base installation to the hard drives than it does for me to set up Ubuntu, and I still have to look up which packages I need to install to listen to MP3s or watch DVDs.
Re:Poor choice for screensaver? (Score:5, Insightful)
Would you? Really? 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. Or suse. Or redhat.
Actually, I still don't know that. But I will take your word for it that something like that exists in some niche under a rock. Everything does. Linux distros are like porn on the net, if you can think of it, someone has done it. And heck, there are probably even supported ones from the three distros above maybe. Just I never heard of them because I haven't cared enough to look.
Which brings us to the odds of "the average computer user" having heard of them: Zero. Zip. None, Nil.
Plus, they have absolutely no conditioning for it, coming from either Mac or Win, where you don't need a magic special install to make your laptop work with your OS. You just do it.
So basically this isn't negating the OP's point, but instead reinforcing it. It is just another reason for people who aren't geeks to say: linux, I tried that but my battery life cut in half, so I put Win back on my machine.
Ubuntu - Inspiron 1720 (Score:5, Insightful)
Re:Poor choice for screensaver? (Score:5, Insightful)
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: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:Poor choice for screensaver? (Score:4, Interesting)
Agreed. Simple web browser usage used to compare Linux and XP shows a 25% _increase_ in battery life under Linux. This was mostly doing research and reading emails. Flash sites tend to draw down the battery so I hold off on those until back on AC power. this was with a work issued laptop from Dell. I don't recall the model.
Re:Poor choice for screensaver? (Score:5, Informative)
Re:Poor choice for screensaver? (Score:5, Funny)
Good old Linux community, where posting "I have this problem..." gets you the response "YOU DO NOT HAVE A PROBLEM! POST PROOF OR RETRACT!"
Re:Poor choice for screensaver? (Score:5, Insightful)
My biggest objection to using Linux (and a major reason why I tell less technical friends/family to avoid Linux) is because of posts exactly like this.
My first Linux install was Slackware (if I remember correctly)...back in 1998. That's 10 years. And for all 10 of those years, my experience with Linux has been like this...
Linux Community: 'This new version of Linux is totally great. Easy to use, great hardware support, best Linux ever. Totally better than Windows!'
Me: "Ummm, that's cool and all - but I have a problem with X"
Linux Community: "*I* don't have a problem with X! I don't even believe you have a problem. Where is your proof? It's totally not a problem with Linux, if it's even a real problem at all."
Me: "Umm...okay. Well...all I want to do is be able to X (where X was get on the internet, hear sound, use a wireless network card, have decent battery life - all of which were or are problems). Here's more information....
Linux Community: "You are using Y? Y is worthless. Everyone knows Y isn't supported in Linux because of XYZ. You either need to write your own driver or get a real Y."
Me: "Can you tell me, specifically, what Y I should buy?"
Linux Community: "*I* have ABC and it works great. But it's more than just what is on the box, it's the chipset and stuff. It's kind of hit or miss.'
Me: 'Wtf? This sucks....I'm going to run Windows'
Linux Community: 'N0ob.'
*six months later*
Linux Community: "Great news! We've totally made it so you can do X"
Me: 'Wait, last time you told me you could do X, and that it was easy, and free, and better than Windows. When I said I had problem doing X, you all told me I was crazy and to RTFM!'
Linux Community: 'Oh well....yeah...in the past, we've had some problems with X. Some users couldn't do X at all, but now we've totally fixed it! Now Linux is is totally great. Easy to use, great hardware support, best Linux ever. Totally better than Windows!''
--------
You get the idea. Months after getting flamed for complaining about how my wireless network adapter doesn't work in Linux, the Linux community raves about how they've improved wireless support.
I've had plenty of problems with Windows....but when I have a problem with Windows, at the very least, people *believe me*.
Re:Poor choice for screensaver? (Score:5, Insightful)
Actually, I've had the same exact issue you detailed here with Windows, OSX, BSD, AIX, Solaris, and Linux.
Nothing works right 100% of the time - to quote three dead trolls in a baggie "It ain't the hardware guys, it just that every OS sucks".
Everyone knows that every app works on the developer's machine...
Re:Poor choice for screensaver? (Score:5, Funny)
Can you prove you got poor or non-existing support for Linux? Show us screen-shots, chat logs, and e-mail exchanges, or we won't believe you.
You want to hear about poor support? Try calling Microsoft tech support. They completely suck. I once called Microsoft tech support and I was on hold for 13 hours, and then I got connected to some loser who can't speak English. Of course I only called to swear at him, so I yelled abuse at him and hung up. But I had to wait 13 hours first. That sucks. If you want to yell abuse at a Linux support person, you can call Linus himself any time of the day or night, and he'll thank you for your suggestion.
The Linux community is great. I think you don't have any problems getting support for Linux, or if you do, it is because you are rude, stupid, and useless.
power saving tip: disable the optical drive (Score:5, Insightful)
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?
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:power saving tip: disable the optical drive (Score:5, Insightful)
Go a step further - if you have enough RAM, copy the file to a RAM disk and let the disk spin down.
Re:power saving tip: disable the optical drive (Score:5, Funny)
Go a step further - read a book.
Re:power saving tip: disable the optical drive (Score:5, Funny)
Jerkwad.
Comment removed (Score:5, Funny)
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:5, Insightful)
This post is exactly what is wrong with Linux advocates. Instead of answering the question - why does Linux die when watching DVDs where other OSes don't - the GP blames the user and suggests another, harder way to do the same thing.
Re:power saving tip: disable the optical drive (Score:4, Interesting)
Re:power saving tip: disable the optical drive (Score:5, Insightful)
What is there not to understand? Install Windows XP, measure battery life. Install Ubuntu, measure battery life. Find why Ubuntu sucks more power for the same job.
All this "provide your config" babble is just cover-up. Windows XP has superior battery life, out of the box and with tweaks. Battery life is one of the most important metrics for mobile devices, so it isn't far fetched to conclude that desktop distributions of Linux are inferior on mobile devices. Now get to work and stop the scapegoating.
Re:power saving tip: disable the optical drive (Score:4, Interesting)
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:power saving tip: disable the optical drive (Score:5, Insightful)
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?
This is something that I see repeatedly when it comes to criticizing Linux. "I want to do X, and it doesn't [work as well|work at all]". Reply: "Why would you want to do that? That's not a good thing to do. You should do this instead." So in this: "I want to play a movie from disk, and the battery won't last." The response: "Don't play it from disk." This might be solving the user's immediate issue (if he has time/inclination to rip the disk ahead of time, and assuming that the battery isn't dying even when the DVD is not in use), but it also neatly avoids the need to address the actual problem (crap battery life).
I don't know that "jerkwad" is the right word, but "typical" surely is.
Re:power saving tip: disable the optical drive (Score:5, Insightful)
Once you the movie ripped to a file, just copy it to a flash drive (or a SD card if your notebook has a reader). Then you don't have to worry about either the DVD drive or the hard drive motor using up power (assuming you have a traditional hard drive to begin with as many netbooks use flash-based ones now).
Re: (Score:3, Informative)
RTFM (Score:5, Funny)
In order to solve your problem, you need to set the RANDOMLY_DISCHARGE_BATTERY flag in the kernel source to "0" at compile time. Ubuntu, as well as other "desktop" distributions, set this flag to "1" by default for some reason, but simply installing the source packages and recompiling your kernel will fix the issue.
Honestly, a simple well-tailored Google search and a few measly days of sifting through the docs would have given you this answer without having to waste everyone else's time.
hah! (Score:5, Funny)
He only wasted you time and informed me and about everyone else who didn't know this. Thanks eln!!
Re: (Score:3, Funny)
Re:RTFM (Score:5, Insightful)
No... (Score:5, Funny)
Re: (Score:3, Funny)
If you actually bothered to THINK about it - all operations of a computer are random power discharges.
therefore, it's not an option on compile - the compiler automatically puts it in without you needing to say so! That's the POWER OF LINUX!
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: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)
Re:Powertop (Score:4, Insightful)
But the problem still is: On windows, it has tons of background stuff active, you use the mouse, you have a colorful UI with FX, and full brightness, while your wlan scans the surroundings, and you *sill* get nearly as much battery life. Something is wrong there...
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: (Score:3, Interesting)
Yes, what kind of moron doesn't know about things that aren't installed?
Consider your hardware (Score:5, Informative)
Re: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.
Just one instance of a known problem... (Score:4, Insightful)
This is just the same problem Noted in XKCD [xkcd.com].
Good battery life is not cool. Open source software, especially a mutt like linux, is all about cool.
Good battery life requires annoyingly huge amounts of microoptimizations and chipset-dependent tricks. Which is most definatly NOT cool.
Re:Just one instance of a known problem... (Score:5, Insightful)
No, power saving is all about very detailed specs on how a chip can be powered down while in different states. Oh sure from the user side it might look like a simple low-high slider but in practise it's dynamically changing clock speeds, voltages, disabling parts of the chip and so on. I've been following the AMD open source driver development and basicly for full power management you'll need a whole new documentation package. They're still working on making it work right under full speed before power management will be a big priority.
Re:BIOS (Score:3, Interesting)
Really? I wondered why since most laptops have myriad settings in their BIOS for power management that they say to turn off BIOS power management when using software power management. I always wondered what exactly was the advantage of using software power management at all. I mean why not turn off software power management and use the BIOS settings exclusively? Are these 'microoptimizations' the reason?
Re:Just one instance of a known problem... (Score:5, Insightful)
This is just the same problem Noted in XKCD [xkcd.com].
Good battery life is not cool. Open source software, especially a mutt like linux, is all about cool.
Good battery life requires annoyingly huge amounts of microoptimizations and chipset-dependent tricks. Which is most definatly NOT cool.
Incorrect, at least in this case.
This problem has nothing to do with whether it is cool or not to squeeze and extra hour or two out of your notebook... This problem has to do with hardware support.
Linux developers continue to have trouble getting access to the hardware they need. Hardware developers are frequently unwilling to divulge the necessary secrets for F/OSS developers to write good drivers... And those same hardware developers are frequently unwilling to devote the time/money/effort necessary to write good drivers themselves...
So you wind up with half-crippled hardware under Linux. You get video cards, motherboards, hard drives, motherboards, etc. that won't properly spin down or hibernate or sleep or whatever.
Other folks in this thread have mentioned that this particular notebook ships with an ATI video card. ATI has notoriously crappy Linux support. This is a video card we're talking about... Geeks love video cards. It doesn't get much cooler than 3D graphics - look at all the time and effort going into projects like Compiz [compiz-fusion.org].
I can almost guarantee that if ATI would open up their documentation you'd see better battery life just as quickly as folks could code it.
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.
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.
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.
No problems (Score:5, Funny)
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.
Buggy DSDT in BIOS (Score:5, Interesting)
You can fix a lot of these issues by following the instructions in one of the links below to decompile that portion of the BIOS, and recompile it using the Intel compiler. It isn't easy, and certainly isn't something an user should ever have to do. It did fix a lot of the power issues with my HP laptop though (Running hot, not booting on battery power unless a key was pressed, hibernation).
See
http://www.osnews.com/thread?230516 [osnews.com]
http://ubuntuforums.org/showthread.php?t=1036051 [ubuntuforums.org]
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/272247?comments=all [launchpad.net]
In this instance, you can blame MS's poor compiler for Linux's poor battery life.
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.
As one of the few (non-tech) lawyers..... (Score:5, Interesting)
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: (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
Never seemed all that bad to me (Score:3, Interesting)
Just my own experience, but I've never seen differences in battery life that are this extreme. Linux has always been worse, but never more than about 10% on the laptops I've used, with one exception.
The only time I've seen a huge difference is on an HP laptop that I currently use as an SVN/Trac/CUPS server. The machine has a BIOS bug that prevents me from using ACPI in Linux, and HP never released a patch to fix it. The only way to keep the machine stable in Linux is to boot "acpi=off, noapic, nolapic". With no real power management, it drains mighty fast, even with all the hardware that gets disabled booting this way (webcam, wireless, etc).
On the other hand, a few years ago I owned a wonderful Sager laptop. With two double capacity batteries and a regular capacity battery, I could get a full 20 hours of battery life from the three (8 hours for double, 4 for regular) running Linux (Gentoo at the time), which was within 1 hour of the average total when I ran XP.
Linux does have worse battery life, for a number of reasons, but the difference doesn't seem significant on most hardware. It all seems to depend on hardware quirks in your machine.
ACPI is a clusterfuck, that's why (Score:5, Insightful)
It is notoriously hard to work with power management features of notebooks, because it is hard to find a really ACPI-compatible BIOS. Most of them are broken in some way, or require undocumented voodoo and magic values to behave. There is really no solution to this unless: a) Manufacturers get their shit together and ship functioning hardware, not hardware that accidentally happens to work under Windows (systemic approach); b) Linux gets more mindshare and those issues get sorted out on a per-device basis (band-aid approach). a) is very unlikely, since shipping functioning hardware brings no obvious reward to the manufacturer. Therefore we can only hope for b).
Note that this is not limited to ACPI. In almost every area, there are hardware products that do not comply with specifications they are supposed to comply with, lie about supported features when probed, have bogus device descriptors, reuse the product ID of a different device, do stupid things when supplied valid commands it doesn't expect, etc.
Missing The Point? (Score:5, Insightful)
I think many of the posters here, who all have great ideas and suggestions, are missing the point of the OP.
Why is an out-of-the-box XP machine performing better than an out-of-the-box Linux machine?
The Linux community shouldn't be saying "try this" or "tweak that" or "install this device driver" or "switch your hardware"... they should be working on building those into the next revs of the OS and making them part of the default configuration (or at least an easy prompt like XP offers).
I get far more with Linux... (Score:4, Interesting)
Well, perhaps it's the distro? Or the hardware. On my Dell Vostro 1000 with a 6 cell battery, I get at absolute maximum 4 hours of battery live on WinXP. On a slightly stipped-down Mandriva Linux I've managed to squeeze 6 hours of use out of it while watching movies. Of course, you could say this isn't an _entirely_ fair test as I was running both the system and the movie from a USB flash drive, but considering I did nothing special in the installer, just told it to install to the flash drive, I'd say it's fair - if you could install Windows to flash that easily I'd run it from one too. Plus with my full version of Mandriva 2009.1 using KDE4 I still get at least as much battery life as I get on XP - and it actually last longer than XP does for gaming (specifically World of Warcraft).
Re:Do you have non anecdotal evidence? (Score:5, Informative)
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).
Re:Do you have non anecdotal evidence? (Score:5, Interesting)
XP's default file system is NTFS, and NTFS is journaled, so I don't think Linux gets an easy out there...
Re: (Score:3, Insightful)
Which is not multi (4+) core servers, but rather cheap laptops and netbooks.
And, anyway, lower power consumption and better efficiency will probably also benefit the "big iron".
Re: (Score:3, Insightful)
Oare we talking notebooks or netbooks? Linux on my netbook had a lot more battery life then XP or OSX on the same netbook. Win 7 may beat it or be close. haven't fully tested it yet. It could also be that the SSD drive is liked more by Linux then XP for me.
But have others have said, are the power saving setting turned on? I thought those were turned off by default. Is it even a fair test? Are both machines the same? Both OS set to turn the same things off?
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: (Score:3, Insightful)
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: (Score:3, Interesting)
When it *is* the intended OS, it's usually a highly customized version/distribution that's optimized perfectly for the hardware, too. My Dell Mini 9, for example, gets about 5.5h of battery life with the Dell-branded Ubuntu installation. When I wiped it and installed another distro of my choice
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:Do you have non anecdotal evidence? (Score:4, Insightful)
Sounds like you are simplifying the situation alot. Yes thats how you do power management on tiny microcontrollers, but that has nothing to do with power management on a typical PC.
Video card have ways to stop clocks in certain areas of the chips, this is the main way power is saved, same with CPU's. These devices don't have I/O pins in the same way microcontrollers do, usually all the buses are tri-state and there is no need at all to 'set' something to input or output or high or low, you simply high impedance the whole bus connection.
What you are talking about has nothing to do with programming on modern computers, you can't just tell your video card what pins to set as output and input, you have to talk to it over a bus, and it runs its own firmware/bios that may have calls that make it disable clocks in certain parts of its chips and high empedance certain bus lines etc. Knowing what these commands are and how to talk to chip when the manufacturer doesn't release any details, just a windows binary driver is the whole problem in the first place.
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: (Score:3, Insightful)
Hardware specifically designed for the OS...
As far as I know, Windows does not tailor it's code to all Dell, Lenovo, Gateway, HP, and Asus laptops.
Come on, you refute your own argument. Hardware manufacturers do design their laptops to play well with Windows, in general. It is only recently that they have even considered installing linux as a feature. Most of them are probably still way behind on making their hardware play well with Linux. The main complaint I always hear about Linux is about having to do fancy things to make drivers work. So all comparisons are valid.
Re: (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:What about netbooks? (Score:5, Interesting)
On my Samsung NC10, Windows gives me about 6.5 to 7 hours of battery life, Ubuntu about 4.5 to 5.
XP netbooks (Score:5, Insightful)
Linux is a popular choice for netbooks, where battery life is paramount.
You mean "was", until Microsoft decided to keep Windows XP alive in the North American market for a few more years at bargain-basement prices per copy.
Re:What about netbooks? (Score:5, Interesting)
I get 10 hours on winxp on my eeepc, and 7.5-ish on eeebuntu.
I'd love to know what to do to optimize eeebuntu more, since that's what I need for work.
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:Say what? (Score:4, Insightful)
And I get 7-8 hours on ubuntu with my netbook. ... but I get 10 hours in WinXP, and that's the point. We need a comparison.
Re:Ditch Linux (Score:5, Insightful)
We need a -1 TrollFeeder option
Re: (Score:3, Funny)
Re:Well duh (Score:5, Funny)
Because linux is fucking terrible for desktop use.
The battery life on my desktop is just fine.
Re:Well duh (Score:5, Funny)
Because linux is fucking terrible for desktop use.
The battery life on my desktop is just fine.
Really? Battery life on my desktop sucks. It dies as soon as I remove the power cord.
Re:Well duh (Score:5, Interesting)
er, don't know about dead, and I wouldn't say "long live windows 7", but I will admit the battery power options are very impressive on Windows 7. Not only can you change the obvious like cpu speed, but you can go all the way down and adjust how long the CPU fan should be on if you're on battery, and it can change according to which battery profile you choose. It has more options than I've ever seen on any program, even more than NHC [pbus-167.com].
Re: (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: (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: (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.