Power Management on Lenovo T430s with Debian Wheezy
Since tp_smapi
does not work properly on T430s, I am using TLP this time. I still want some traditional tools
$ sudo aptitude install powertop
but not others:
$ sudo aptitude remove --purge laptop-mode-tools
To install, follow the instruction. In short, first update the APT source list by adding the following line to /etc/apt/sources.list
:
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main
and run
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 02D65EFF
$ sudo aptitude update
$ sudo aptitude install tlp tlp-rdw tp-smapi-dkms smartmontools ethtool acpi-call-tools</pre>
Upon reboot, TLP starts running.
I am impressed by the ease of installation and how effective TLP is on configuring T430s to start power saving from the get go. According to powertop
, T430s is already using just 7 - 8 W on battery. That’s several watts below I had been using on other ThankPads!!
Controlling the behavior of TPL is done by modifying /etc/default/tlp
. I mostly use the default except the following changes:
...
# Main battery (values in %)
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=90
# Ultrabay battery (values in %)
START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=90
...
# Radio devices to disable on connect
DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
# Radio devices to enable on disconnect
DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi"
DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
Note that in this configuration the battery charge thresholds are intentionally set lower than the factory default to prolong the health of batteries. When I wish to fully charge them, do:
$ sudo tlp fullcharge [ BAT0 | BAT1 ]
and the thresholds will be set back to the factory default. The settings revert to the custom configuration upon next reboot.
Enables RC6 Power Saving
Edit /etc/default/grub
and add the option i915.i915_enable_rc6=1
to GRUB:
GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.i915_enable_rc6=1"
After editing, update Grub:
$ sudo update-grub
This can save about 0.5 W of power!
Fan Control
I have not fine tuned this, but the fan can be controlled manually via thinkfan
:
$ sudo aptitude install thinkfan
Create (or edit) /etc/modprobe.d/thinkpad_acpi.conf
and add the line:
options thinkpad_acpi fan_control=1
Reboot. The fan can be controlled manually following this Wiki article.
Configuring System on Switch between AC & Battery
For regular daemons (like ssh
), TLP provides a way to start/stop based on AC status.
For other personal processes, KDE power management can also do some work by running a script upon dis/connecting with AC. In particular, the sound for the KDE system notifications should be disabled entirely, because they cause quite a number of unwanted interruptions according to powertop
. Also, I wish to start/stop programs like flux and Dropbox when on battery just to squeeze more juice. I create a script like this:
#!/usr/bin/env bash
##############################################################################
# This is a script to run when AC/battery switches. Ideally used
# within the power management configuration setting on KDE. Requires
# tp_smapi to be loaded for the detection of AC/battery.
USERNAME=johndoe
LATITUDE=37.78
LONGITUDE=-122.42
##############################################################################
# DO NOT MODIFY BELOW
statuspath="/sys/class/power_supply/AC/online"
if [ ! -f "$statuspath" ]; then
exit 0
fi
tag=pmpersonal
status=`cat "$statuspath"`
if [ "$status" = "1" ]; then
logger -t $tag "on ac"
logger -t $tag "start xflux"
for i in `pgrep ^xflux$` ; do kill -9 $i ; done
xflux -l $LATITUDE -g $LONGITUDE
logger -t $tag "start dropbox"
dropbox start
logger -t $tag "enable system notification"
kwriteconfig --file="/home/$USERNAME/.kde/share/config/knotifyrc" --group=Sounds --key="No sound" false
else
logger -t $tag "on battery"
logger -t $tag "stop xflux"
for i in `pgrep ^xflux$` ; do kill -9 $i ; done
logger -t $tag "stop dropbox"
dropbox stop
logger -t $tag "disable system notification"
kwriteconfig --file="/home/$USERNAME/.kde/share/config/knotifyrc" --group=Sounds --key="No sound" true
fi
Save this to a path like /bin/pmpersonal.sh
. Go to System Settings -> Power Management -> Energy Saving Settings. There, for each of “On AC,” “On Battery,” and “On Low Battery,” I can set different configurations. I can also specify “Run Script” option for each profile to enable/disable a few desktop related applications and settings. The script should be run on profile load.
Preload Daemon
$ sudo aptitude install preload
In /etc/default/preload
, uncomment the line reading
OPTIONS="-l /dev/null"
This should reduce disk activity.
Disabling Nepomuk, Strigi and Akonadi on KDE
I am not fond of these daemons. Disable them by going to System Settings -> Desktop Search and unchecking “Enable Nepomuk Semantic Desktop.” In ~/.config/akonadi/akonadiserverrc
, set:
StartServer=false
so that it doesn’t start at all. On powertop
, this shows up as a service running mysqld
constantly.