Recommended Posts

I've noticed a lot of distros really don't include many (or any) laptop power management tweaks by default. The only distro that seems to try to do this is ubuntu 12.04, which already does some of the stuff in this how to. When I recently ran powertop on my fedora 17 install and it reported relatively high battery discharge, and all the tunables were shown as "bad" I decided to use the same tweaks I had on my arch linux install, using pm-utils scripts. There are other ways to do this, such as laptop-mode-tools and jupiter, but I've had the best success with the following:

Note, that some of these scripts have varying levels of success on different hardware, you may want to look at them and tweak them a little bit if need be, or remove ones that don't work for you (for example, I found the pm-utils 'harddrive' script to be too aggresive for my taste, so I increased the battery APM to 128 and the spindown time to 3 minutes, which are the default settings ubuntu 12.04 uses). You can view the following log to see if the scripts are executing properly:

cat /var/log/pm-powersave.log

Download the upstream pm-utils source from here:

http://pm-utils.freedesktop.org/rele...s-1.4.1.tar.gz

Once extracted you can find various power saving scripts in: pm-utils-1.4.1/pm/power.d. Take the scripts you wish to use, and drop them into /etc/pm/power.d and make them executable. This will enable a good amount of the powertop recommended tunables automatically when you are on battery.

Note: your distro may or may not already have some of the above scripts located in /usr/lib64/pm-utils/power.d or /usr/lib/pm-utils/power.d Ubuntu does include and use some of these by default, but fedora didn't include any.

After doing this I did a few additonal things that didn't come with the included scripts, to get the remaining powertop recommendations set to 'good'.

I added a script called "device_pm" (Using a script I found on the arch forums: https://bbs.archlinu....php?pid=860231). to enable runtime pm for all my pci devices:


#!/bin/sh

device_pm() {
for dpcontrol in /sys/bus/{pci,spi,i2c}/devices/*/power/control; do
[ -w "$dpcontrol" ] || continue
echo $1 > "$dpcontrol"
done
}

case "$1" in
true)
echo "**device power management ON"
device_pm auto
;;
false)
echo "**device power management OFF"
device_pm on
;;
esac

exit 0[/Code]

I added a script called usb_pm (taken from the arch wiki: https://wiki.archlin...-utils_Settings) to enable usb autosuspend and disable nmi_watchdog:

[Code]
#!/bin/sh
case "$1" in
true)
# USB powersaving
for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 1 > $i
done
for i in /sys/bus/usb/devices/*/power/control; do
echo auto > $i
done
sysctl kernel.nmi_watchdog=0
;;
false)
for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 2 > $i
done
for i in /sys/bus/usb/devices/*/power/control; do
echo on > $i
done
sysctl kernel.nmi_watchdog=1
;;
esac

exit 0[/Code]

I added a simpler script for intel audio power saving (taken from a script on the crunchbang forums: http://crunchbanglin...ipt-for-debian/) that worked better on my machine than the pm-utils one:

[Code]
#!/bin/sh
# A script to enable intel audio power saving on fedora

case "$1" in
true)
# Enable some power saving settings while on battery
# Intel power saving
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
;;
false)
#Return settings to default on AC power
echo N > /sys/module/snd_hda_intel/parameters/power_save_controller
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
;;
esac

exit 0[/Code]

and lastly, increase the vm_writeback value on battery (taken from arch wiki: https://wiki.archlin...-utils_Settings)

[Code]
#!/bin/sh
case "$1" in
true)
# Less VM disk activity. Suggested by powertop
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
;;
false)
#Return settings to default on AC power
echo 500 > /proc/sys/vm/dirty_writeback_centisecs
;;
esac

exit 0[/Code]

And here are the results smile.gif

http://i.imgur.com/ZLXQw.png

http://i.imgur.com/GzFPI.jpg

Link to comment
https://www.neowin.net/forum/topic/1089443-how-to-power-saving-with-pm-utils/
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Bose QuietComfort Ultra Gen 2 headphones are down to lowest price in over a month by Taras Buria Bose's second-gen QuietComfort Ultra headphones are premium over-ear headphones with noise cancellation, but right now, you can save 16%, thanks to a discount that brought the headphones to a new lowest price in over a month. While the general look and aesthetics remain unchanged compared to the previous gen, the Gen 2 features redesigned wear-detection sensors, which accurately pause your music the moment you take them off. Additionally, the headphones now support lossless audio via a direct USB-C wired connection, letting you enjoy uncompressed sound when plugged into your laptop or phone. There is also spatial audio support (works wirelessly) for a more immersive audio experience and improved noise cancellation, which makes the QuietComfort Ultra go-to headphones for many users on long flights or other scenarios when they need to isolate themselves from the surrounding noise. The QuietComfort Ultra (Gen 2) also features Bluetooth Multipoint for seamless switching between two devices at once. As for battery life, you get up to 30 hours on a single charge (up to 23 hours when using spatial audio). Besides good audio quality and noise cancellation, the headphones should be comfortable to wear, thanks to the lightweight 250-gram design and soft protein-leather ear pads. The QuietComfort Ultra Gen 2 are available in four colors, and all five are now available at the lowest price: Bose QuietComfort Ultra Bluetooth Headphones (2nd Gen) - $379 | 16% off on Amazon This Amazon deal is US-specific and not available in other regions unless specified. This is a first-party seller link (at the time of article publishing); ensure that you also purchase from a first-party seller link only. If you don't like it or want to look at more options, check out the previous deals that we have covered, OR you can also visit Amazon US deals page. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • Started implementing weapons! Here's a little sneak peek! 👀 Everything was done inside of Unreal Engine using Control Rig!
    • Keep in mind Intuit has lobbied like crazy to keep taxes complicated so they can continue to sell tax software. They also got caught hiding their legally mandated free version so they could release a second one that pushed countless people into charges they didn't need to pay to file. Intuit leads the charge on inventing problems so they can sell you the solution and disrespecting you in the process.
    • Oddly, there was a time that UFC games were culturally relevant, largely because of the graphics and gameplay that was different than the norm. But it seems like as the sport grew in popularity, gaming outlets stopped talking about the games.
    • Microsoft Edge 149.0.4022.69 by Razvan Serea Microsoft Edge is a super fast and secure web browser from Microsoft. It works on almost any device, including PCs, iPhones and Androids. It keeps you safe online, protects your privacy, and lets you browse the web quickly. You can even use it on all your devices and keep your browsing history and favorites synced up. Built on the same technology as Chrome, Microsoft Edge has additional built-in features like Startup boost and Sleeping tabs, which boost your browsing experience with world class performance and speed that are optimized to work best with Windows. Microsoft Edge security and privacy features such as Microsoft Defender SmartScreen, Password Monitor, InPrivate search, and Kids Mode help keep you and your loved ones protected and secure online. Microsoft Edge has features to keep both you and your family protected. Enable content filters and access activity reports with your Microsoft Family Safety account and experience a kid-friendly web with Kids Mode. The new Microsoft Edge is now compatible with your favorite extensions, so it’s easy to personalize your browsing experience. Microsoft Edge 149.0.4022.69 changelog: Fixed an issue that caused the Downloads dialog to continue displaying the "Keep/Delete" prompt for .rdp files after the download completed. Stable channel security updates are listed here. Download: Microsoft Edge (64-bit) | 193.0 MB (Freeware) Download: Microsoft Edge (32-bit) | 170.0 MB Download: Microsoft Edge (ARM64) | 188.0 MB View: Microsoft Edge Website | Release History Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      agatameier earned a badge
      Week One Done
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      +Edouard
      175
    3. 3
      PsYcHoKiLLa
      139
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      76
  • Tell a friend

    Love Neowin? Tell a friend!