Battery life on my HP-envy is down right horrible in Linux - Fedora 16 by default results in only about two hours of operation before it shuts down (and is about 60c) when compared to the almost 5 hours of running time in Windows 7. Here are some tweaks to improve it to 5+ hrs with minor use and minimal wifi:
Prerequisite packages:
Install the following:
-
sudo yum install pm-utils tuned
-
sudo chkconfig tuned on
Install Jupiter and get it configured
-
wget http://sourceforge.net/projects/jupiter/files/jupiter-0.1.2-1.noarch.rpm/download
-
sudo rpm -ivh jupiter-0.1.2-1.noarch.rpm
It should startup automatically, however, you can verify this with a reboot or by running the following command (not as root):
gnome-session-properties
Edit the kernel parameters:
-
sudo vi /etc/default/grub
-
-
GRUB_TIMEOUT=5
-
GRUB_DISTRIBUTOR="Fedora"
-
GRUB_DEFAULT=saved
-
GRUB_CMDLINE_LINUX="rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8 acpi_osi=Linux video.brightness_switch_enabled=1 video.use_bios_initial_backlight=0 pcie_aspm=force i915.i915_enable_fbc=1 i915.i915_enable_rc6=1 modeset=1 usbcore.autosuspend=1 hpet=force"
Install the new grub parameters by running the following commands:
-
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
-
sudo grub2-install --boot-directory=/boot /dev/sda
-
-
# Note: your drive may have another device name. Check for it with mount command output.
Create the powersave profile
This section creates the powersave profile which will be activated when the laptop is on battery. I have taken this from numerous sources and made it look like the following with my own additions.
-
#!/bin/sh
-
# Power saving script
-
-
# List of modules to unload, space seperated. Edit depending on your hardware and preferences.
-
modlist="uvcvideo"
-
# Bus list for runtime pm. Probably shouldn't touch this.
-
buslist="pci spi i2c"
-
-
case "$1" in
-
true)
-
-
# Couple of simple screen tweaks
-
xgamma --gamma 0.75
-
xset dpms 0 0 120
-
-
# Lower power using ethtool
-
ethtool -s em1 wol d
-
-
#Turn off watchdog
-
echo 0 > /proc/sys/kernel/nmi_watchdog
-
-
# Turn on multithread power savings
-
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
-
-
# Turn ondemand powergovener
-
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
-
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
-
echo ondemand > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
-
echo ondemand > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
-
-
# Hard drive parameters for better savings
-
echo "30000" > /proc/sys/vm/dirty_writeback_centisecs
-
hdparm -B1 /dev/sda
-
-
# Disable cd-drive polling
-
hal-disable-polling --device /dev/scd0
-
-
# PCU link power management
-
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
-
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy
-
-
# Enable laptop mode
-
echo 5 > /proc/sys/vm/laptop_mode
-
-
# Intel power saving
-
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
-
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
-
-
# Set backlight brightness to 50%
-
echo 5 > /sys/devices/virtual/backlight/acpi_video0/brightness
-
echo 5 > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness
-
-
# USB powersaving
-
for i in /sys/bus/usb/devices/*/power/autosuspend; do
-
echo 1 > $i
-
done
-
-
# Turnoff bluetooth
-
rfkill block bluetooth
-
-
# audio
-
amixer set Line mute nocap
-
amixer set Mic mute nocap
-
-
# usb stuff
-
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
-
for i in /sys/bus/usb/devices/*/power/level; do echo auto > $i; done
-
-
# SATA power saving
-
for i in /sys/class/scsi_host/host*/link_power_management_policy; do
-
echo min_power > $i
-
done
-
-
# Disable hardware modules to save power
-
for mod in $modlist; do
-
grep $mod /proc/modules >/dev/null || continue
-
modprobe -r $mod 2>/dev/null
-
done
-
-
# Enable runtime power management. Suggested by powertop.
-
for bus in $buslist; do
-
for i in /sys/bus/$bus/devices/*/power/control; do
-
echo auto > $i
-
done
-
done
-
;;
-
false)
-
#Return settings to default on AC power
-
-
hal-disable-polling --enable-polling --device /dev/scd0 # or whatever your CD drive is
-
echo 0 > /sys/devices/system/cpu/sched_mc_power_savings
-
-
echo 0 > /proc/sys/vm/laptop_mode
-
echo 500 > /proc/sys/vm/dirty_writeback_centisecs
-
echo N > /sys/module/snd_hda_intel/parameters/power_save_controller
-
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
-
echo 10 > /sys/devices/virtual/backlight/acpi_video0/brightness
-
-
for i in /sys/bus/usb/devices/*/power/autosuspend; do
-
echo 2 > $i
-
done
-
for i in /sys/class/scsi_host/host*/link_power_management_policy
-
do echo max_performance > $i
-
done
-
for mod in $modlist; do
-
if ! lsmod | grep $mod; then
-
modprobe $mod 2>/dev/null
-
fi
-
done
-
for bus in $buslist; do
-
for i in /sys/bus/$bus/devices/*/power/control; do
-
echo on > $i
-
done
-
done
-
;;
-
esac
-
-
exit 0
Run the following:
-
sudo chmod a+x /etc/pm/power.d/powersave
-
sudo /etc/pm/power.d/powersave true
-
sudo pm-powersave true
If you have any other suggestions - let me know!
Comments
Winning!
Submitted by Matt Clarkson (not verified) on
Just got a HP Envy Beats 2002ea. It wasn't working with gnome 3. Your solution has solve this problem and improved my battery life. Thanks!!!
Good Post
Submitted by Face (not verified) on
it is actually highly content. You have spent long time for this post. It's a very useful and interesting site.
Excellent
Submitted by Conradv (not verified) on
You saved my Envy!
Add new comment