Introduction to TLP
TLP is a feature-rich utility of the command line for Linux, saving the battery power of the laptops without the requirement for delving deeper into logical details. The default settings of TLP are already used for battery life, so we may only install and forget it. TLP is customizable to fulfill our specific needs.
Note: TLP will take care of the bulk of the settings that powertop --autotune will.
Important: TLP is a pure utility of the command line. It doesn't include a GUI.
Working of TLP
What TLP generally does is pull kernel settings that impact power consumption.
Every kernel setting is of a volatile quality. The state resides in RAM at the time of runtime and the kernel gives no endurance for them. The kernel makes a default state and modifications have to be reused on all boots by a tool, i.e., userspace upon boot. TLP is the userspace tool.
Almost all kernel settings, TLP implements, are sent to user space that are the files /sys/ (sysfs nodes). The result of tlp-stat will display the paths.
Note: Not every sysfs node displayed by tlp-stat is actually affected by TLP if using settings, a few are shown for diagnostic or information purposes only.
TLP offers two independent groups of settings known as profiles, one for AC operation and one for the battery. It means that TLP must use the appropriate profile, not just at the booting time, but also at all times the power source modifies.
The actions of TLP are event-driven for achieving each of the above. The below events will let settings be used:
Important: TLP will not create adaptive or dynamic modifications to the settings behind the events is specified above. TLP will never alter the settings because of the battery charge level, CPU load, or else in particular.
Note: TLP doesn't monitor the above-mentioned events itself but depends on a variety of system daemons, such as NetworkManager, systemd, and udevd. Therefore, TLP doesn't contain a daemon and there's no permanent background process of TLP displaying up in the result of ps.
Features of TLP
The settings, i.e., power saving are organized into two different profiles, enabling us to adjust performance and savings independently for AC and battery (BAT) operation.
The settings for batting care are:
Settings of TLP
The introduction describes how the settings of TLP are formed, the parameter syntax applied and how to modify them.
The other sections specify every setting of TLP:
The introduction describes how the settings of TLP are formed, the Parameter Syntax, the Config File, and Making Modifications.
The 1.3 and higher versions of TLP
The 1.3 version of TLP introduced and increased the configuration scheme the settings are read from the below files in the described sequence:
The 1.2.2 and lower versions of TLP
TLP applies two different profiles of settings that are automatically used relying on the power source:
The parameters were completed neither with _BAT nor with _AC used for both profiles.
Two types of parameters are available:
Config files comprised of comment lines and parameters:
The line's content starting with a '#' symbol in the initial columns completely ignored:
#What is described here doesn't matter.
Clear lines are also ignored.
After parameters, comments are not permitted, the entire line will be ignored silently:
EXAMPLE="doesn't apply like it" # Parameter is informed in the front!
The values of the parameter including blanks should be enclosed within the double quotes:
The config file can be modified with a text editor (but root privileges are required).
Every modification should be activated by deleting the leading '#' symbol and will take impact only the below after saving a file
It will be set to 0 for disabling TLP (reboot required).
Default if unconfigured: 1
It defines the default operation mode (BAT or AC) of TLP when a power source can't be detected. Concerns a few embedded hardware and desktop only.
The 1.4 and higher versions
It manages how warnings of invalid settings are delivered:
Background tasks (resume, boot, power source change) report to the journal/syslog- 1
Shell commands informed to the terminal- 2
Combination of 1 and 2- 3
Default if unconfigured: 3
Timeout for the power saving mode of the audio (supports Intel AC97 and HDA). The value of 1 is suggested for the desktop environment of Linux with PulseAudio and the systems without PulseAudio might need 10. The 0 value disables power save.
Default if unconfigured:
1 (BAT) and 1 (AC) - 1.4 and higher versions
1 (BAT) and 0 (AC) - 1.3.1 and lower versions
N- the controller will remain active
Y- the power of the controller using the sound chip
Default if unconfigured: Y
In the 1.3 and lower versions, it is known as "Battery Features".
The aim of Battery Care on several laptops is to decrease the capacity loss because of the wear from the growing battery operation, i.e., to amplify the battery lifespan. It can be done by:
Battery Care doesn't consist of extra power saving.
Battery Care Vendor Specifics
The battery care support level relies on the laptop brand and vendor, TLP version, and Linux kernel version.
To use charge control recalibration or thresholds using TLP:
There are two different options to obtain kernel drivers:
Note: When the hardware doesn't have the capability or no applicable driver exists, the TLP battery care can't control it.
Controllers and Disks
Set the option, i.e., "Advanced Power Management Level". Some possible values lie between 1 and 255.
A few selected values are as follows:
1- Minimum performance/maximum power saving.
Note: This setting might lead to enhanced disk drive tear and wear due to excessive head uploading of read-write.
Default if unconfigured: "254 254" (AC), "128 128" (BAT).
Values for more than one disk are isolated with blanks.
Specifies the disk devices on which the below parameters act. More than one device is isolated with blanks.
Default if unconfigured: "nvme0n1 sda"
The device name's assignment by the kernel (sdb, sda) can possibly change if using the second disk that is in the Drive Bay.
This aspect enables to the shutdown of removable optical drives included in:
It is the device for an optical drive.
Default if unconfigured: sr0
0- the active optical drive
1- power off an optical drive
Default if unconfigured: 0
Installing TLP on Ubuntu
For Linux, TLP is a tool for Advanced Power Management. It provides a default configuration that is used for battery life. It's highly customizable to fulfill particular user requirements at a time.
TLP supplies isolate setting profiles for battery and AC power and can disable or enable WWAN and Wi-Fi radio devices under system startup. It gives a unified way for configuring the charging threshold and the battery recalibrate for every model which supports it (by acpi-call or tp-smapi) for ThinkPads.
On Ubuntu, there are three different ways of installing TLP. We can use aptitude, apt-get, and apt. In the below sections, we will specify all methods. We can select one of them.
Installing TLP with apt-get
We need to first update the database of apt with the help of the below command:
After updating the database of apt, we can now install TLP with apt-get by executing the below command:
Installing TLP with apt
We will update the database of apt with the help of the below command:
After updating the database of apt, we can now install TLP with apt by executing the below command:
Installing TLP with aptitude
We can skip this method if we already used the above methods. If we wish to follow this method, we might first require to install aptitude because aptitude is not by default installed on Ubuntu. We need to update the database of apt using aptitude with the help of the below command:
After updating the database of apt, we can install TLP with aptitude by executing the below command:
Uninstalling TLP on Ubuntu
We can run the following command for uninstalling the TLP package only:
Uninstalling TLP and Dependencies
We can use the following command for uninstalling TLP and all dependencies that are not required by Ubuntu:
Remove Data and Configuration of TLP
To remove data and configuration of TLP from Ubuntu, we can run the following command:
Remove Data, Configuration, and Dependencies of TLP
To remove data, configuration, and dependencies of TLP, we can execute the below command: