3923 How to achieve longest possible battery life [Archive] - The FreeBSD Forums

PDA

View Full Version : How to achieve longest possible battery life


MikeyIckey
May 24th, 2009, 08:16
I'm thinking about loading FreeBSD on my laptop. I've read other posts about configuring the kernel to lower cpu usage and obviously I'd have to trim the processes that I'd never use. But my question is what else eats up battery life. I've heard dependencies will also have an effect. Any truth to that? In terms of desktop environments, which one will be the lightest on a laptop battery? I've recently found lxde (http://lxde.org/) so if anyone has any experiences with that I'd like to hear about it. Thanks again.

ale
May 24th, 2009, 09:47
But my question is what else eats up battery life.A light background.

DutchDaemon
May 24th, 2009, 15:03
Wild 3D/OpenGL screensavers.

MikeyIckey
May 24th, 2009, 16:52
A light background.

Do you mean the backlight on the monitor?

DutchDaemon
May 24th, 2009, 17:25
Some laptops have an ambient sensor (my HP Compaq has) which can dim the screen in darker surroundings. It's controlled via BIOS settings.

ale
May 24th, 2009, 17:37
Do you mean the backlight on the monitor?This is another thing, if hw supports it.
Being less sophisticated, I just mean a black background color for the desktop instead of a white or bright one.

MikeyIckey
May 24th, 2009, 17:51
This is another thing, if hw supports it.
Being less sophisticated, I just mean a black background color for the desktop instead of a white or bright one.

huh, really?! I'll remember that.

MikeyIckey
May 29th, 2009, 22:18
Sorry to continue with questions but is there any way that I can tell if a desktop environment will use lots of resources and eat up battery life? Thanks again everyone.

hydra
May 30th, 2009, 19:54
Which DE do you use ?

fronclynne
May 31st, 2009, 01:11
A particular desktop env will only drain the battery when using CPU time. Memory footprint is probably not a good indicator (eg evilwm, which is tiny, blows chunks on my amd64 dual core laptop, consuming 99% CPU after a few minutes of running).

For instance, twm has run for two seconds in 9 hours of uptime. I'm sure that some of the middle-weight stuff is just as good with most of the fant-C effects turned off, like jiggly windows, solid dragging, animation, dying moose noises when you click something.

If you're surfing the webs, blocking most of the rich media nonsense will save some CPU and thus battery. Or just use lynx.

(I would insert some sort of obtuse joke about how ones take more power than zeros, (so type everything in lowercase) but I fear that our non-native-english speakers might think I'm serious)

MikeyIckey
May 31st, 2009, 17:20
Which DE do you use ?

Right now, KDE 3 on my desktop. But I was thinking of LXDE for my laptop.

MikeyIckey
May 31st, 2009, 17:31
Thanks Fronclynne, I'll keep all of this in mind.

kpedersen
June 1st, 2009, 01:44
Hello,

I have noticed that my IBM laptop runs much warmer running FreeBSD than running Windows and as such must be using a lot more battery which is a shame. Windows even manages to use less battery with that daft aero effect which is admittedly quite impressive.

From a default install, what would be the best way to use less energy. I have done a lot of googling but I have yet to find something concrete. The only one which I currently use is...

in /etc/rc.conf
powerd_enable="YES"
powerd_flags="-a adaptive -b adaptive"

Is there anything to do with sysctl ... that needs to be done? Such as...

dev.cpu.<processor_no>.cx_lowest

I am not really that bothered about performance.

I would be greatful for any suggestions

Thanks,

Oko
June 1st, 2009, 02:17
Switch of the computer!

kpedersen
June 1st, 2009, 03:08
haha perhaps... though I do still want some performance.

And besides... Windows Vista manages to keep the machine cool whilst it is switched on :)

Any other suggestions?

trev
June 1st, 2009, 04:25
There's a lot of excellent information here:
http://forums.freebsd.org/showthread.php?t=172
and especially for laptops the link to:
http://lists.freebsd.org/pipermail/freebsd-current/2009-May/006436.html

kpedersen
June 1st, 2009, 21:17
Hello, Cheers for your replies.

These are the temperatures I am getting for my T23 laptop.

dev.acpi_ibm.0.thermal: 42 51 50 -1 -1 -1 -1 -1

I have powerd set in my rc.conf and also have set the cpu state to C3.

Are these temperatures a problem?

The fan rarely comes on unless I force it.

Thanks,

lambda
June 2nd, 2009, 06:48
I removed my modem from my Notebook, it consumes Power despite the fact, that it wasnt used.

Read the Mailinglist, http://www.mailinglistarchive.com/freebsd-current@freebsd.org/msg29239.html is a awesome source of information.

Use only one Memory Module instead of two, you may loose DualChannel performance but maybe save 1W.

With 7.X: Remove all USB Support from the Kernel, than set dev.cpu.0.cx_lowest to C4 or something. The old USB Stack prevents the system to go lower than C1.

Use powerd, and set the thresholds very conservative, so that the cpu only goes up on e.g. 75%.

Turn off you wlan card via the hard switch, if you dont need it.

lambda
June 2nd, 2009, 06:52
Reduce kern.hz to 100 with

/boot/loader.conf

kern.hz=100

instain
June 2nd, 2009, 14:28
huh, really?! I'll remember that.
That is true for CRTs, OLEDs, and some of the fancy intelligent LED backlit screens that actually reduce the backlight intensity when not required. Standard fluorescent and LED backlit screens use slightly more power to display a black screen compared to white.

knotabot
June 6th, 2009, 14:46
Maybe wait for lithium titinate batteries, by Altair, to make it to laptops.
Altairnano is the first company to replace traditional graphite materials used in conventional lithium-ion batteries with a proprietary, nano-structured lithium titanate – a process that delivers distinctive performance attributes, including power, fast charge/discharge rates, high round-trip efficiencies, long cycle life, safety, and ability to operate under extreme temperatures.
Altair Nano (http://www.altairnano.com/profiles/investor/fullpage.asp?f=1&BzID=546&to=cp&Nav=0&LangID=1&s=0&ID=10695)

knotabot
June 15th, 2009, 14:54
Another promising new battery technology already in use in cars:
A123 Systems (http://www.a123systems.com/products)

These batteries are 10,000,000 more conductive than standard lithium ion batteries.
They also pack more charge per volume.

Don't know if they are developing any for laptops though.

MikeyIckey
June 16th, 2009, 07:23
I've heard of those, but yeah, I don't think they have any for laptops just yet. Can't wait till they do though.

MikeyIckey
June 28th, 2009, 19:32
So this does extend the battery life. LXDE doesn't quite work(or i haven't gotten it to work yet) and xbacklight seems not to work with nvidia cards or drivers or both. I haven't been able to dim the backlight on the monitor. but all in all solved.

aragon
June 28th, 2009, 21:41
Another lite DE is Xfce. Liter still is no DE - rather use a lite window manager like Fluxbox, Blackbox, dwm, rat poison, etc. I've recently started using scrotwm (http://www.peereboom.us/scrotwm/html/scrotwm.html) on my laptop and like it very much - great for small screens and mouse-less systems, plus it has a tiny resource footprint.

The reference to Alexander Motin's Fighting for the Power (http://lists.freebsd.org/pipermail/freebsd-current/2009-May/006436.html) above is excellent, but mostly useful for FreeBSD 8.0. Which I highly recommend trying BTW - it is quite stable already, and the new power saving features are incredible. As good as or better than Windows XP!

If you leave you laptop unattended often, also be sure to enable DPMS in Xorg:

xset dpms 0 0 300

That'll turn off the backlight after 5 minutes of inactivity.

Another thing is ata(4)'s new spindown feature to switch off inactive hard drives:

atacontrol spindown ad4 600

That'll turn off /dev/ad4 after 10 minutes of no use.

One more tip: enable /tmp and /var memory file systems to reduce disk activity. In rc.conf:


tmpmfs="YES"
tmpsize="1024m"
varmfs="YES"
varsize="2048m"
populate_var="YES"


For /var you will probably still need your on disk var for persistent data. I mount this at /export/var and then symlink certain directories in my MFS /var to the same in /export/var.

In /etc/rc.d/var, the populate_var() function:


ln -s /export/var/db /var/db
ln -s /export/var/cache /var/cache
ln -s /export/var/lib /var/lib
touch /var/log/utmp

lme@
June 30th, 2009, 12:51
The atacontrol and xset commands are good candidates for adding to /etc/devd.conf.
Everytime you insert or remove the power cable from your notebook, devd gets an ACPI message. (0x00 and 0x01 IIRC). So if you plug-in the cable you can run atacontrol spindown ad0 300 and vice versa if you remove the cable.

0