The Linux operating system is really great since it is stable, robust, modern, user friendly and therefore it can easily compete with the established operating systems and even surpass them at some points. But linux is not equally strong at all points. One of the areas that deserves more attention is battery life when running on a laptop. Most Linux distributions are out of the box not really optimized to get the most out of your laptop. On a desktop you don’t need to improve battery life of course, but on your laptop you should give some attention to optimize your power consumption, so you can use your machine as long as possible during the day. Up till this very moment it has never been possible to squeeze as many hours out of a Linux based laptop as compared to macOS and Windows based machines. But things can be improved with an application like TLP. So let’s see How to improve battery life on Linux laptops with TLP.
Note: This blog post is an improved version of one of my earlier blog posts on TLP and TLPUI from late 2018.
What is TLP
As already said in the introduction most Linux distributions are not really optimized to get the most working hours out of your laptop battery. You need a dedicated application that gives you advanced power management capabilities on every controllable aspect in your machine.
TLP is a very extensive software solution, but the nice thing is that it offers out of the box a default configuration already optimized for most machines. But on top of that default settings there is a lot to adapt to fulfill your specific needs. TLP gives you all the required functions to tweak your components like the processor, hard disks, wireless components, network devices and graphics and sound devices. Think about processor frequency scaling, power aware process scheduler for multi-core and hyper-threading, wifi power saving mode, hard drive advanced power management, audio power saving and Input/Output schedulers. And if you have a Lenovo Thinkpad, TLP provides some additional Thinkpad specific options like calibration of the battery.
TLP has a lot of options for you to configure, but the core is not really user friendly as it needs to be configured via the command line. But luckily there is an additional graphical user interface available as well. TLPUI is a great graphical user interface for TLP power management for Linux.
How to install TLP on Debian/Ubuntu-based Linux distributions
A lot of Linux based distributions already have TLP and TLPUI available in their software repository. So it is wise to first have a look in your Software Manager before doing a manual installation. Below steps are based on Linux Mint, but can easily be used for other Ubuntu based distributions.
Installation via Software Manager
On Linux Mint do the following:
1) Search for “Software Manager” in the search bar in your Application Menu.
2) Start Software Manager.
3) Search for “TLP”.
4) Click on TLP.
5) Click on Install.
Installation via PPA
If TLP is not in the repository of your Ubuntu based distribution or if you want to use the most recent version of TLP than we have to do a side step to the command line to install it via the official PPA.
1) Start a terminal session via the keyboard combination Ctrl + Alt + T.
2) To add the TLP PPA type the following command followed by enter:
sudo add-apt-repository ppa:linrunner/tlp
3) To update your system type the following command followed by enter:
sudo apt-get update
4) Install the packages tlp, tlp-rdw, tp-smapi-dkms and acpi-call-dkms via the following command:
sudo apt-get install tlp tlp-rdw
5) ThinkPads require an additional command:
sudo apt-get install tp-smapi-dkms acpi-call-dkms
As we are not going to use the command line to setup and use the TLP application we now go directly to the installation of TLPUI.
How to install TLPUI on Debian/Ubuntu-based Linux distributions
Installation via Software Manager
On Linux Mint do the following:
1) Search for “Software Manager” in the search bar in your Application Menu.
2) Start Software Manager.
3) Search for “TLPUI”.
4) Click on TLPUI.
5) Click on Install.
Installation via PPA
If TLPUI is not in the repository of your Ubuntu based distribution or if you want to use the most recent version of TLPUI than we have to do a side step to the command line to install it via the Linux Uprising PPA. The website www.linuxuprising.com is a great and informative website on everything Linux related and I highly recommend it.
1) Start a terminal session via the keyboard combination Ctrl + Alt + T.
2) To add the TLPUI PPA type the following command followed by enter:
sudo add-apt-repository ppa:linuxuprising/apps
3) To update your system type the following command followed by enter:
sudo apt-get update
4) Install the packages tlp, tlp-rdw, tp-smapi-dkms and acpi-call-dkms via the following command:
sudo apt-get install tlpui
How to use and setup TLP and TLPUI
1) Open your Application Manager, search for “TLPUI” and start the application.
The following screen will be shown to you.
Here we see two main tabs, Configuration and Statistics.
As already mentioned TLP gives you a generic out of the box optimized configuration that should work great with your laptop. After installing TLP my Dell Latitude E7450 gives me on average 1.5 hours longer battery life than before installation, which is in my opinion incredible. But you can change the settings of a lot of components to adapt it to your personal situation and preferences.
The configuration screen gives you the option to change some general settings and change settings for Audio, Disks, Graphics, Network, PCIe, Processor, Radio, Radio Device Wizard, USB and Thinkpad Battery. So let’s go through all of them.
General
Here we have the options to enable TLP and set the TLP default mode for AC or Battery.
Audio
Here we can set the audio save mode and enable or disable the audio controller.
Disks
This Disks related part gives a very extensive list of options that can be manipulated. Think of disk idle seconds that sets the time the laptop mode has to wait before doing a sync, settings per available disk, disk spinning settings, link power management, seconds of inactivity before suspension and settings for optical drives.
Graphics
Here all settings are focused on radeon graphics cards, like focus on clock speed and performance or on battery life.
Network
WiFi power savings mode and LAN wake on settings.
PCIe
PCI Express Active State Power Management performance focussed or power saving focussed. Inclusion or exclusion of PCIe components.
Processor
CPU scaling settings, CPU scaling frequency, Performance settings in different AC and Battery situations, CPU Boost enabling or disabling, adapt number of cpu cores and hyperthreading to the load.
Radio and Radio Device Wizard
Settings for radio devices like Bluetooth, WiFi and WWAN.
USB
Options to suspend USB, blacklist or whitelist certain USB devices.
Thinkpad Battery
When you use a Thinkpad laptop these are extra options for you. You can set battery charge thresholds so charging starts only in specific situations.
Final words
There is a lot to write about TLP. If you want more details of everything TLP has to offer, please have a look at the TLP website:
https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
In my opinion TLP and TLPUI are great additions for your Linux based mobile experience. In my case, I get an average of one hour extra usable working time on a battery charge, but sometimes I get more than two hours extra compared to the situation when I was not yet using TLP. That’s up to 25% more than I get without TLP! Give it a try and see what you can squeeze out of your laptop battery.
Enjoy!