# How to achieve longest possible battery life



## MikeyIckey (May 24, 2009)

*another question regarding battery life...*

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 so if anyone has any experiences with that I'd like to hear about it. Thanks again.


----------



## ale (May 24, 2009)

MikeyIckey said:
			
		

> But my question is what else eats up battery life.


A light background.


----------



## DutchDaemon (May 24, 2009)

Wild 3D/OpenGL screensavers.


----------



## MikeyIckey (May 24, 2009)

ale said:
			
		

> A light background.



Do you mean the backlight on the monitor?


----------



## DutchDaemon (May 24, 2009)

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 24, 2009)

MikeyIckey said:
			
		

> 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 24, 2009)

ale said:
			
		

> 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 29, 2009)

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 30, 2009)

Which DE do you use ?


----------



## fronclynne (May 31, 2009)

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 31, 2009)

hydra said:
			
		

> Which DE do you use ?



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


----------



## MikeyIckey (May 31, 2009)

Thanks Fronclynne, I'll keep all of this in mind.


----------



## kpedersen (Jun 1, 2009)

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 (Jun 1, 2009)

Switch of the computer!


----------



## kpedersen (Jun 1, 2009)

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 (Jun 1, 2009)

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 (Jun 1, 2009)

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 (Jun 2, 2009)

*Remove unneeded Devices*

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 (Jun 2, 2009)

Reduce kern.hz to 100 with

/boot/loader.conf

```
kern.hz=100
```


----------



## instain (Jun 2, 2009)

MikeyIckey said:
			
		

> 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 (Jun 6, 2009)

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


----------



## knotabot (Jun 15, 2009)

Another promising new battery technology already in use in cars:
A123 Systems

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 (Jun 16, 2009)

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 (Jun 28, 2009)

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 (Jun 28, 2009)

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 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 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@ (Jun 30, 2009)

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.


----------

