by jasmineaura on Tue Sep 25, 2012 5:33 am
Motion,
Powertop doesn't manage anything. It's name is akin to "top", a popular command-line tool to monitor top processes based on various usage variables (CPU/MEM/SWAP etc.). So all powertop really does is show you which processes generate "wake-up calls" -- what keeps CPU and/or Disks busy, and prevents them from idling to save power, along with educated-guessing of which processes/devices use most power. The more reliable method of using powertop is to run it after you've pulled the plug, to see actual battery drain rates, and power usage fluctuations as you use the comptuer, or just let it idle.
Recent versions (2.0) have a tabbed interface with the last tab being "Tunables" where powertop suggests some things to do in order to achieve less power usage. They can be toggled with the press of a key -- enter. This can be handy for further tuning power usage, but not all actually make a difference or help (depends on feature, and/or your hardware/software/kernel-version). The changes made via the Tunables tab are not permanent, meaning they're lost upon reboot. One could get a report of what it suggests (along with all other info) in HTML by running `powertop --html=/home/me/Documents/` (it will automatically create powertop-xxxxx.html file in the location you specify). The generated html report is also tabbed (provided you're using an HTML5 capable browser), and there you can click the Tunables tab as well and see all the same recommendations it gives, along with the associated commands to reach those ends (which is not shown in the standard command line interface).
So, briefly, if your laptop shuts down when on battery, then it must be one of the following:
1. Battery drained completely (no more charge left) and so the system literally lost power; bad shutdown. This could mean power-manager of your Desktop Environment (DE) isn't running. Ex. mate-power-manager, gnome-power-manager, xfce-power-manager, etc. Check your DE's "startup applications" (usually under preferences) and make sure one (and only one) of those is checked. If you're running alternate/custom setup, make sure to pick one you like and add it to your DE's startup list, or in .xinitrc in your home directory
2. Battery reached critical level, your DE's power manager got the signal notification from ACPI, and so it immediately decided to shutdown. This is *clean* shutdown, as opposed to *bad* shutdown caused by power-out as in #1. In this case, it is a matter of configuring your DE's power-manager to choose what happens when battery reaches critical battery level; recommended: hibernate, as opposed to suspend will still draw small amounts of battery power overtime.
3. You, the user, were idle (no keyboard/mouse/touchpad activity) and no programs were running or accessing the disk and the DE's power manager decided to shutdown the computer. This is unlikely, as defaults of the DE power managers in this case (idle timeout) are either suspend or hibernate.
So , if you're still having that issue and cannot figure it out, do tell which Desktop environment you're using when the shutdown happens, and whether it is bad shutdown (Battery drained completely), or clean shutdown (issued by some program). You can tell when you power-on your computer again, during bootup (or via `dmesg` after boot) to see warnings such as "filesystem was not cleanly unmounted on shutdown".
You can use a tool like "caffeine" to keep the computer active while on battery to drain it down completely, to once again see what happens then -- clean shutdown on critical level, or bad shutdown when it runs out.
Cheers