TLP icon indicating copy to clipboard operation
TLP copied to clipboard

[RFC] Auto-switching: preference to map profile to AC / battery

Open CatGamer23 opened this issue 4 months ago • 7 comments

Is your feature request related to a problem? Please describe.

On my setup, I prefer to be on PRF on AC, and SAV on BAT.

Describe the solution you'd like

Either:

  1. Add a 4th TLP_AUTO_SWITCH option, this one near-identical to 'Auto' mode, but switch to SAV on BAT, not BAL, or
  2. Change the 'Auto' mode to respect the TLP_DEFAULT_MODE (or add a new variable, like TLP_AUTO_MODE_ON_BAT or something) when using 'Auto', so that on BAT, it will be auto-switched to the user's preference.

Describe alternatives you've considered

While it's possible to gain the same result be manually changing all of the _BAT options to match the new _SAV options, it's a tedious extra step that would also effectively remove one of the BAT/SAV modes. It's a step that shouldn't be needed in the 3-mode system. It's a simple QoL feature that I believe would be rather useful. (At least for anyone who prefers/needs the extra battery life)

Additional context

I've looked all over the config, and from what I can tell, there is nothing that can mimic this ability, (except of course, changing all of the _BAT settings)

CatGamer23 avatar Dec 10 '25 05:12 CatGamer23

Hi, I expected requests like yours. So thank you for starting this discussion.

My main priority was to get the D-Bus API, including the third profile, out the door. Next, I would like to gather opinions from users for a while to understand what the best (and most comprehensible) implementation for this preference is.

To this end, I have formulated the subject of your issue in a more general way.

linrunner avatar Dec 10 '25 13:12 linrunner

what the best (and most comprehensible) implementation for this preference is.

What follows is my opinion regarding the changes starting v1.9.

I use a number of laptops and tlp to manage their power. Before v1.9 power saving was pretty straightforward: when power source is AC, use *_AC parameters; when power source is BAT, use *_BAT. I don't understand why this had to change starting v1.9 and introduce a third *_SAV parameters, where in the absence of aforementioned third parameter for the rest of the configuration is to default to *_BAT values. This is no longer straightforward.

Power source is only either AC or BAT (unless I'm not made aware of the emergence of a new one) and this perfectly aligned with *_AC and *_BAT in tlp. The introduction of *_SAV and the changes of certain *_BATdefault parameters that mimics *_AC doesn't seem to fit within this power source/profile relation. If there is a need to introduce some way to get performance while trading off battery life while on BAT then that would be the time to make changes in the default tlp configuration (which is by the way already very sensible in pre v1.9 given this dual relationship). Or set the profile to AC/Performance on-the-fly while on BAT which is now possible starting v1.9.

As to the implementation of this preference if we wish to keep the third *_SAV parameters, then perhaps it would be that when power source is BAT, give a configuration option that lets the user choose between *_BAT or *_SAV parameters to use in the configuration as stated by OP.

braveheartleo avatar Dec 10 '25 22:12 braveheartleo

I'm not quite sure I understand your comment @braveheartleo. To my knowledge (I may be wrong, as I haven't looked in-depth, but the config looks almost same, at least with a diff), the _AC and _BAT defaults are identical to what they were before, and with the newly added _SAV mode only adding extra defaults for higher power saving, as a higher cost to performance than _BAT was.

Correct me if I'm wrong, but from what I understand of your comment, you are stating that a 3rd mode is over-complicating matters, even though, the 3-mode system is almost universal in most distros, including Windows, and MacOS, thereby making it rather straightforward? The _SAV mode is only so that you can have an extra option, just in case (e.g. you'll be traveling and want to make sure the laptop will last the trip). Previously, you'd have to go in and change ~a dozen settings manually each time to get a similar effect.

I don't intend to offend, I'm just a bit confused with what it is you're stating, with the contradictory comment.

CatGamer23 avatar Dec 11 '25 06:12 CatGamer23

the _AC and _BAT defaults are identical to what they were before, and with the newly added _SAV mode only adding extra defaults for higher power saving, as a higher cost to performance than _BAT was.

My bad. I was thinking of pre-set parameter values prepended by # vs. default values when I wrote the comment, and you are correct, the defaults remain identical, save for the addition of these new defaults:

CPU_ENERGY_PERF_POLICY_ON_SAV="power"
AMDGPU_ABM_LEVEL_ON_SAV="3"

and the introduction of defaults for PLATFORM_PROFILE that were missing before v1.9:

PLATFORM_PROFILE_ON_AC="performance"
PLATFORM_PROFILE_ON_BAT="balanced"
PLATFORM_PROFILE_ON_SAV="low-power"

braveheartleo avatar Dec 11 '25 09:12 braveheartleo

https://fosstodon.org/deck/@linrunner/115701504774175270

linrunner avatar Dec 11 '25 14:12 linrunner

Changing or reassigning defaults was not an option. Nothing must change for existing installations and configurations during the update. Hence the initially fixed assignment of profiles for AC and battery power.

The goal here is to determine how to best bring together traditional users who say “two profiles are enough for me” and the world of three profiles.

@CatGamer23 @braveheartleo

linrunner avatar Dec 11 '25 15:12 linrunner

Makes sense, thanks for the clarification @linrunner @braveheartleo

CatGamer23 avatar Dec 11 '25 15:12 CatGamer23

What about something like this? A configuration option like: TLP_PROFILE_ON_AC could have PRF, BAL, SAV TLP_PROFILE_ON_BAT could have PRF, BAL, SAV

the default should not break backwards compatibility so would be TLP_PROFILE_ON_AC=PRF TLP_PROFILE_ON_BAT=BAL

Example configurations could be: example 1: TLP_PROFILE_ON_AC=PRF TLP_PROFILE_ON_BAT=SAV Now the most power saving profile would be enabled when the computer runs off battery power, allowing an intermediate profile to exist for some workloads that may need it on battery.

example 2: TLP_PROFILE_ON_AC=BAL TLP_PROFILE_ON_BAT=SAV This configuration might be used by someone who only needs the PRF profile on specific tasks and values fan noise and battery life.

example 3 would be the current implementation, where the most power conservative profile is manually activated and the user values performance. I think this should also work with desktop environments that enable profiles through there own power management.

Set2Minecraft avatar Jan 27 '26 13:01 Set2Minecraft

@Set2Minecraft I can imagine something similar. Let's see what other opinions come in.

linrunner avatar Jan 27 '26 13:01 linrunner

I apologize if my comment adds nothing but I would like to express that this:

example 2: TLP_PROFILE_ON_AC=BAL TLP_PROFILE_ON_BAT=SAV This configuration might be used by someone who only needs the PRF profile on specific tasks and values fan noise and battery life.

is exactly what I would prefer to be my settings and I was confused that this wasn't an option when this feature first got added. For context I come from using tuned with ppd support and I wanted to switch to TLP as soon as it added tlp-pd.

GravityShark avatar Feb 07 '26 10:02 GravityShark

I'm looking for the same thing, that the default profile on AC is “balanced” instead of “performance.”

TLP_PROFILE_ON_AC could have PRF, BAL, SAV TLP_PROFILE_ON_BAT could have PRF, BAL, SAV

A feature like that would help.

juanm4morales avatar Feb 09 '26 12:02 juanm4morales

Please no more “me too” posts for @Set2Minecraft 's suggestion. I got it already.

Are there any alternative suggestions or other use cases you want to report?

linrunner avatar Feb 09 '26 12:02 linrunner