Showing posts with label power management. Show all posts
Showing posts with label power management. Show all posts

Logging and Graphing Power Consumption of Embedded Linux Systems -- Busybox and GnuPlot analyzing the Kindle 3

Diposkan oleh Unknown on Sunday, May 15, 2011

Actually this should've been really easy. A small script loop on the kindle to log the battery consumption and then plug that data into gnuplot. But it turned out gnuplot afaik doesn't support to output the difference between values. Thanks to apo_ from #gnuplot I've got it running with the help of awk now. The great thing is that this script runs in busybox and can hence easily be adapted for pretty much any kind of portable devices including Android phones, Kindles, Tablets, Notebooks, Netbooks, etc. And that's how it looks.
Kindle 3 Battery Consumption
Measurement points are marked with an x.

Read more »
More aboutLogging and Graphing Power Consumption of Embedded Linux Systems -- Busybox and GnuPlot analyzing the Kindle 3

Charging Devices During Suspend Using your Notebook's USB Port with Linux

Diposkan oleh Unknown

You probably have done this before: Plug your phone or mp3 into your Notebook's USB port to charge it. E.g. the Kindle usually only comes with a USB cable and no seperate charger. Did you know you can do this even when your system is in standby mode? I will show you how - without the need to modify anything but software!

Read more »
More aboutCharging Devices During Suspend Using your Notebook's USB Port with Linux

Minimal Powertop as Bash Script esp. for Embedded Environments

Diposkan oleh Unknown on Thursday, May 5, 2011

I wrote this for my kindle and android devices. It's a nice, easy script though and should be great especially for embedded environments, where you have a shell but not all of the powertop dependencies. It works wonderfully on my notebook and netbook, but you may have to slightly adjust the path names to work on your system.

It turns out that this wasn't needed for either, as the kindle comes with powertop preinstalled. But it can't work on either of my devices, as timer_stats are disabled in their kernels.
I do wonder: Why do they disable the timer_stats? Is the overhead of timer_stats too high? Let me know how you use it!
Read more »
More aboutMinimal Powertop as Bash Script esp. for Embedded Environments

Is the Linux Desktop getting slower and more bloated?

Diposkan oleh Unknown on Friday, April 22, 2011

In his "failure of logic" post "K. Mandla" writes that the Linux Desktop is not getting faster even though all the hardware around it is getting faster, pointing to an article with the same argument 10 years ago. The ensueing discussion was much too abstract for my taste. ("Why are clouds?" "What clouds, where?") But if you split up the question you get answers:

Read more »
More aboutIs the Linux Desktop getting slower and more bloated?

0.4 Watt Less During Audio Playback - (Updated:) Power Performance: Pulseaudio + Interrupt-Less Alsa

Diposkan oleh Unknown on Saturday, April 16, 2011

(Skip to the update)
Ok, so with some help from Pierre-Louis from Intel I've managed to get it working and do some performance/power tests. But let me start at the beginning: Recently, pulseaudio not only switched to a more power efficient (and otherwise) timing system, as far as I understand a callback API. It also provided the infrastructure to use ALSA devices without causing any interrupts ("period wakeup disabling"), so you CPU can stay longer in standby mode (e.g. "C6 residency"), saving you power and avoiding playback glitches at the same time. See here and here or more background information. With kernel 2.6.38 the first driver (snd-hda-intel) supports this infrastructure out of the box, the snd-hda-intel driver. This combination is what I tested for power efficiency...
Read more »
More about0.4 Watt Less During Audio Playback - (Updated:) Power Performance: Pulseaudio + Interrupt-Less Alsa

Pulseaudio Power Efficiency

Diposkan oleh Unknown on Sunday, March 20, 2011

Using pulseaudio in combination with alsa is already more power efficient and avoids many interrupts on current systems. In my experience the interrupts created by hda_intel decreased from 60-80 down to 6 per second. The sleep residency increased from about 3 ms to about 8 ms. This already makes a difference of about .25 Watts. I wonder if and how the difference will be with the new patches that went into 2.6.38, disabling even more interrupts.

Update: Also check how to save 0.4 Watts and more with pulseaudio and alsa.
More aboutPulseaudio Power Efficiency

Saving 2 W power by Making Sure Laptop_Mode oesn't destroy your HD

Diposkan oleh Unknown on Wednesday, December 22, 2010

Laptop_mode is actually a great thing, as it activates a few powerful power saving modes in Linux, most importantly disk power saving and delayed writes. But if you use it with out of the box settings, there are two major bugs in Laptop Mode Tools, which could cause your disk to crash and are the reason it's normally disabled. Now let me show you how to work around them and easily save 2 W of power:
Read more »
More aboutSaving 2 W power by Making Sure Laptop_Mode oesn't destroy your HD

What to do if you mobile has battery problems

Diposkan oleh Unknown on Tuesday, December 21, 2010

Sometimes mobile phones with Li-Ion battery have a problem that causes them not to provide anywhere near the expected run time. A possible problem is that not all cells are charged equally. This can happen especially if you have not charged your phone until it said it's full the first time you charged it. But it can happen in any case.

Now a great workaround for this problem is to follow this guide posted on the xda-developers forum: You fully charge the phone. (until it says it's full) and then power it off and then:

1. Wait until it shows its fully charged.
2. Unplug the phone and wait for it to turn off lights and display.
3. Replug the phone and go to No. 1. (Repeat about 10 times)
More aboutWhat to do if you mobile has battery problems

Make your Android power efficient in any situation (for free!)

Diposkan oleh Unknown on Monday, December 13, 2010

In the following post I will explain how to use cpu tuner, a completely free and open source app for android. All you need is root and some time. It's a follow up on and summary of my various related posts you can mostly see below ("related posts") on working with governors to increase power efficiency in Linux. This is of course something that a) Linux and b) Android and c) your phone manufacturer should already have done. But as they didn't...

Read more »
More aboutMake your Android power efficient in any situation (for free!)

What can Governor Adjustments do for your Battery Mileage?

Diposkan oleh Unknown on Thursday, November 25, 2010

After my previous post about Android saving power with Linux governor tweaking, I did some governor tweak testing on my netbook with a tweaked phoronix test suide (pts) and came up with these results:

The first two show the power usage in Watts, the third shows the frequencies used during the test.


Read more »
More aboutWhat can Governor Adjustments do for your Battery Mileage?

Reduce Power Consumption Extend Battery Life of your Android with CPUfreq Governor Tweaks

Diposkan oleh Unknown on Wednesday, November 24, 2010

CPUfreq is the part of the Linux kernel that changes your CPU's frequency to save power or increases it to make your system run faster. Obviously the settings you use there are essential for you performance and battery consumption. I read an extensive article by IBM some time ago analysing the different Linux cpu frequency governors. It makes lots of fancy tests and has great diagrams etc. What it boils down to is that these are the perfect setttings for low power at high performance in Linux. (Also check out this article where I tested these settings on my netbook.)

Read more »
More aboutReduce Power Consumption Extend Battery Life of your Android with CPUfreq Governor Tweaks

Atom Power Usage Reduced with kernel 2.6.36

Diposkan oleh Unknown on Monday, October 25, 2010

As expected, the intel_idle driver includes ATM-C4 and ATM-C6 CPU power saving modes in kernel 2.6.36, even if your BIOS doesn't announce them. Check it out!

I'm sure it'll lower your power consumption by at least 0.5W on average loads. Of course there might be no difference at all if your BIOS already supports them. But often the BIOS disables the states when the AC adapter is plugged in. They still work, though, when using intel_idle. This makes your netbook less power hungry and more importantly: quieter. For some netbooks this will definitely be a big difference in run time as well.

Let me know how it works for you in the comments.
More aboutAtom Power Usage Reduced with kernel 2.6.36

Disabling Fsync in Laptop_Mode

Diposkan oleh Unknown on Saturday, October 23, 2010

There are several libraries that help you to disable fsync temporarily so your hard disk doesn't always spin up to save your notebooks battery. Of course that is not very flexible as you need to preload the libraries meaning you have to restart the programs.

Read more »
More aboutDisabling Fsync in Laptop_Mode

New Low Power Record - Power Management Progress in 2.6.35

Diposkan oleh Unknown on Sunday, August 8, 2010

I just wanted to test how low the system can go in it's power usage with the power management framework of kernel 2.6.35 and the results amaze me. A test just showed that the system can save an additional 0.8 watts with the new kernel. Before the minimum battery usage without wifi was 5.6 W. Now in kernel 2.6.35 this has gone down another 0.8 W to 4.8 W - or 8.3 hours with just over 70 % battery. This is amazing. Even with wifi active the system now goes down to about 6 W - significantly increasing the amount of time you can be online surfing on battery. I wonder how much energy recent kernels save on other systems.
More aboutNew Low Power Record - Power Management Progress in 2.6.35

Fixing Suspend for the MSI Wind U110 in 2.6.34 and 2.6.35

Diposkan oleh Unknown on Wednesday, August 4, 2010

The MSI Wind U110 suddenly stopped going into suspend more in newer kernels starting at 2.6.34. A kernel developed found where the issue is located. Actually the system did go into suspend mode, but it came right back immediately.

The issue is very easy and quickly solved, though, with a single simple command:
echo LID | sudo tee /proc/acpi/wakeup

Now I can go into suspend again, and the system still comes back from suspend as expected, nice! :)

Unfortunately for some reasons this does still not mean that suspend is working in Ubuntu 10.04 for me. Probably an issue related to the updated Xserver in 10.04. Though I can suspend and resume now, X crashes and restarts after resume.
More aboutFixing Suspend for the MSI Wind U110 in 2.6.34 and 2.6.35

Backlight Control on MSI U110 Netbook

Diposkan oleh Unknown on Sunday, June 27, 2010

I've managed to get the backlight working roughly as well! All I needed to do was to load msi-laptop with the parameter force=1. The problem is that there is so far very little scaling, I can only set brightness to 0 (very dark) or 1-8 (all "very bright"). Check for updates to get it working well with KDE.

I've contacted the driver developers and I hope we can make some progress on the drivers soon.
More aboutBacklight Control on MSI U110 Netbook

Saving 33% or 3 Watts of Power with your Netbook (here a Poulsbo system)

Diposkan oleh Unknown on Friday, June 11, 2010

I've tried around a lot to see how much more power I can save on my system. An easy step with lots of success was to configure the laptop tools to run automatically. Check /etc/defaults/acpi-support and looks for LAPTOP_MODE, set it to true. Then you have to go to /etc/laptop-mode/ and configure first laptop-mode.conf and then the additional settings in the conf.d subdirectory. This could already save me at least 1 watt of power with very, very little hassle.

Poulsbo
I've tried around a lot with my X system, because it can draw a lot or little power depending on its settings. E.g. if you reduce the backlight you can save at least 2 watt power. Unfortunately the backlight controls on my system don't work - I'm happy I've managed to get the driver to run at all. (Check my special article on the MSI Wind U110 for more on that.) Hence at least for now I need to set my backlight to the level I want before booting Linux.

But I did find out that disabling vsync saves quite a substantial amount of power, I think about 0.5 watt. Most of the savings come from the cpu staying in idle longer on average then (about 22 msecs instead of about 4-8 ms). The catch is that with that setting enables, xvideo and vaapi no longer work after standby. Browsing is still fine, but probably no youtube, either. The whole system hangs when an application tries to use xv. So I had to disable the setting again - which actually was the step to put my netbook in a lower power mode than the carefully customized windows installation can manage, too bad.

If I pass it or any options (except debug) to the psb module during load, or load it myself during boot, X or suspend won't work at all or properly or properly after standby.

In the xorg.conf I have the standard settings for psb:
Option "AccelMethod" "EXA"
Option "DRI" "on"
Option "MigrationHeuristic" "greedy"
Option "IgnoreACPI" "yes"

Ralink Wifi
Another big one was the wifi adapter. Disabling it saves about 1.5-2 watts power, but of course I wanted to be able to have it running and save energy as well. I installed the newest driver from ralink's homepage. The important step was to go into the os/linux/ directory and edit the config.mk file to enable HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y, otherwise NetworkManager would no longer work with it. Then I studied the documentation and found the command "iwpriv ra0 set PSMode=Fast_PSP" put my card into a low power mode which still keeps a good and rather fast connection - better than in Windows, there this powersaving mode does not exist and the MAX_PSP is unusable.

Last Hint
A last additional hint is to kill knotify4.

Conclusion
In the end my system runs with 5.7 watts in a full KDE 4.3.2 X session. With mplayer and VAAPI I can now watch movies for at least 8 hours. A great demonstration of how far Linux has already come in saving power.

The only thing missing now is a working backlight control and a working XVideo without vsync would be great. Ok, an SSD would be great, too. So let me know if you have one you no longer need! ;) Or if you know how to fix the backlight control on a poulsbo system.

Maybe I should try to compile the IEGD driver for my system.

Update
I've manged to get it all running, including no_vsync, and videoacceleration before and after suspend. The trick is to do a double console switch after resume. Then VAAPI still works even after the suspend and resume - at least with xserver-xorg-video-psb version 0.36.0-0ubuntu1ppa9.10+1.

Update2
I've managed to get the backlight working roughly as well! All I needed to do was to load msi-laptop with the parameter force=1. The problem is that there is so far very little scaling, I can only set brightness to 0 (very dark) or 1-8 (all "very bright").

Update3
Check out this article with more general advice including how ensure your battery lives long and prospers. Backlight is fixed by now, I've written a patch for the psb driver (in testing at the ppa right now). With recently kernels, the power usage dropped down to 4.8 Watts without wifi! This means it lasts much longer in Linux than in Windows now.
More aboutSaving 33% or 3 Watts of Power with your Netbook (here a Poulsbo system)

Power Naps for your Linux System

Diposkan oleh Unknown

I've always wanted a tool that can automatically suspend my system automatically once all the jobs (mencoder scripts, updatedb, etc.) are finished. Then I could start tasks, leave my system alone and trust that it would take care of going into standby itself. Most software only checks for keyboard and X input, which exactly doesn't help for my scenario. But now there's "powernap".

It's included in normal Ubuntu repositories and in its default configuration it suspends your system if no activity is detected for 5 minutes. What's still confusing me is that it by default checks for activity of initd. This does not seem to make much sense and I think a long list of typical software would be a much better alternative. Also I wonder whether it would also detect mouse and keyboard inputs, which might be nice and useful. But it's a good start in any case and you can set it up to run for your purposes.
More aboutPower Naps for your Linux System

Over 9 Hours of Video on Battery with the MSI Wind U110

Diposkan oleh Unknown on Tuesday, December 29, 2009

After I've managed to set up the video acceleration, it was time to test if it's really as power efficient as claimed. I just tried that with some SD and HD video. HD video wouldn't play properly of course, so it's silly to compare battery times.

But with SD video and vaapi, I managed to get down to 6.1 watts (9.1 hours). Without vaapi it was around 6.3-6.5 watts (8.5 hours).

I used a few tricks to achieve this:
  1. disabled wifi and bluetooth.
  2. lowered the display brightness to minum (still good though). This has to be done before boot in 2.6.31.
  3. moved the system to an SDHC card. While the power in standby is the same (5.7 watts both with only SDHC or only hard disk), the active power is much lower with the SDHC (only +0.5-2 watts instead of 3-5 watts).
  4. used by powersave script to optimize the kernel settings for low power mode:
echo cpu
echo 1 | tee /sys/devices/system/cpu/sched_smt_power_savings
echo 1 | tee /sys/devices/system/cpu/cpu*/cpufreq/ondemand/ignore_nice_load
echo 95 | tee /sys/devices/system/cpu/cpu*/cpufreq/ondemand/up_threshold
echo 50 | tee /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
echo

echo usb
echo 2 | tee /sys/module/usbcore/parameters/autosuspend
echo auto | tee /sys/bus/usb/devices/*/power/level
echo

echo misc
echo 1500 | tee /proc/sys/vm/dirty_writeback_centisecs
echo 0 | tee /sys/block/sdb/queue/rotational
# broken echo 10 | tee /sys/module/snd_hda_intel/parameters/power_save
# not better echo 1 | tee /sys/module/psb/parameters/disable_vsync

killall -q hald-addon-storage knotify4 NetworkManager
hciconfig hci0 down
More aboutOver 9 Hours of Video on Battery with the MSI Wind U110

More About Being a Good Citizen in an Open Source World

Diposkan oleh Unknown on Monday, November 17, 2008

After looking into the source of Android, Metthew Garrett tells us about his disappointment with the underlying code. And with his example of iPhone vs. Android a heated debate was of course not far:

Who is the worse open source citizen, Google, Apple or nobody? And I posted a little comment as well:


Google is to blame for doing open source(Linux), but the wrong way(hotfix instead of a good solution).
Apple is to blame for doing open source(BSD), but the wrong way(bad or no community "backfeed").

What's worse is a matter of taste. I also think Apple is the worse open source participant. They give back so little to the community it makes me sad. (Then they restrict the app store in ways that prevents competition, etc.)

Google does not do much for the community, though it says it tries. But honestly, if you would put their effort into relation with what money they make through open source software, it's really very sad, too. And the companies PR departments would be silly if they wouldn't make sure it looks like a serious effort.

But they both gain a lot and give a little. Google may state what they wish - considering their resources they give little. They could employ at least a few expert kernel hackers pro bono. Otherwise they will get an identity crisis a little like Ubuntu currently: People want to know they are part of bringing things forward.

And this shows the problems with current open source licenses in my view: The companies still don't really have to give useful "back-feed" to the open source projects (far from being in relation with what they gain).


What if the EU would decide that every device must come with open source drivers? Or if someone wrote a license that requires at least 1% of the profits from the open source project to flow back into the project? It would of course be very good for the projects. But in a second step I am convinced it would be at least as useful from a macroeconomic point of view:

Less development effort would be duplicated and the code quality would constantly increase.

Of course the big problem with this approach is finding out how much money is made with a project. That would be the job for courts to decide. And currently I can't think of any really good measurement possibilites. But then with 1% of the profits I'm sure it would not hurt a company anyway.
More aboutMore About Being a Good Citizen in an Open Source World