Bug 502459 - Powerdevil switches to "on battery" profile when plugged in but discharging due to weak power supply, which can cause undesirable effects
Summary: Powerdevil switches to "on battery" profile when plugged in but discharging d...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Power management & brightness (other bugs)
Version First Reported In: 6.3.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-05 17:34 UTC by Snake Scaly
Modified: 2025-04-15 16:14 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: Upower 1.90.9
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Snake Scaly 2025-04-05 17:34:39 UTC
SUMMARY
On a gaming laptop (Lenovo Legion 9 16IRX9) under heavy load (in my case playing Monster Hunter Wilds) KDE sporadically switches between On Battery and On Power Supply power management modes even though the power supply is connected all the time as indicated by the hardware power LED on the laptop.

STEPS TO REPRODUCE
1. Make sure the laptop is in the gaming mode by pressing Fn+Q repeatedly until the ring around the power button is red
2. Start a demanding game

OBSERVED RESULT
The system is switching to the On Battery profile every few seconds: screen dimming, performance dropping, fans spinning down, the electric plug pictogram disappearing from the battery icon in the tray. Then after a few seconds it is switching back to On Power Supply and keeps cycling.

EXPECTED RESULT
The system remains on the On Power Supply profile as long as the power supply is connected.

SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.3.4
KDE Frameworks Version:  6.12.0
Qt Version: 6.8.3

ADDITIONAL INFORMATION
When KDE switches to On Battery, `upower -d` reports that the power supply ADP0 is still online. However the battery BAT0 is either "not charging" or "discharging", probably because the power supply is at the limits of what RTX 4090 demands from it. I suspect that KDE wrongly interprets this as being on battery power. Probably as a workaround for buggy power supply reporting on other systems.

The cycling probably happens because normally the On Battery profile enables Power Saving, which reduces power consumption, the battery gets a chance to charge, which KDE interprets as being plugged in. And the cycle repeats.

My workaround for now is to set up the On Battery profile exactly the same as the On Power Supply. So even though KDE still thinks I'm unplugged, nothing changes (because the settings are the same), and everything keeps working because in reality I'm plugged in and there is enough power for the system to function at full performance.
Comment 1 Nate Graham 2025-04-07 19:12:10 UTC
During the time when it happens, can you hover the pointer over the battery icon in your system Tray? If you do, does it say something like "plugged in the still discharging"?

My theory is that the laptop is drawing more power than the power supply can provide, and the net discharge of energy is tricking powerdevil into thinking it's unplugged, and therefore inappropriately entering "on battery power" mode. If I'm right, then technically it is using battery power, but this isn't really what the user thinks of when they think about a laptop on battery power.
Comment 2 Snake Scaly 2025-04-08 00:06:29 UTC
When this happens, it simply says "Battery at 91%". `upower -d` says "discharging". When I exit the game, after a few seconds it says "Fully charged", upower reports "fully-charged", even though the same upower report still shows the battery is at 91%, probably because I checked "Limit the maximum battery charge" in the advanced power settings. So yes, it seems like the laptop is indeed drawing more power than the power supply can provide. I think it's normal for a beast machine like this, and in my opinion, it shouldn't switch to the "on battery" profile in the middle of a game session just because the power supply is a little underpowered. I assume Lenovo figured that the power supply was powerful enough to support a long enough gaming session.
Comment 3 Nate Graham 2025-04-08 16:38:09 UTC
Thanks, I had a feeling this is what was going on!
Comment 4 James Munyambu 2025-04-10 21:27:02 UTC
Hi, I have the same issue on my laptop regardless of charging method. I can charge via a 180W AC charger at full speed or USB-C up to 100W (tested with a 65W charger). I thought it was just under heavy system load but it also happens under light use, such as watching YouTube. Whilst charging via USB-C, my laptop battery fluctuates between 95-100% when full (something to do with battery management, it is normal behaviour), but the hardware (i.e. the laptop LED indicator) still treats it as charging. The OS however sees it as on battery, causing large drops in performance (under heavy use) and causing severe momentary (~1 sec) stutter regardless of load level. On AC power, I have no explanation other than it never goes below 100% but Plasma still alternates between charging and battery profiles.

System info:
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.9-200.fc41.x86_64 (64-bit)
Product Name: ROG Zephyrus G14 GA401QM
Comment 5 username981618 2025-04-14 11:29:52 UTC
I think I have the same issue. Not when gaming though but just normal office work with low CPU use. I'm plugged in and fully charged. But Plasma keeps switching between "discharging 100%" (with a ridiculously high battery time left) and "fully charged" and it always makes a sound when it changes.
Comment 6 James Munyambu 2025-04-14 23:10:13 UTC
(In reply to James Munyambu from comment #4)
> Hi, I have the same issue on my laptop regardless of charging method. I can
> charge via a 180W AC charger at full speed or USB-C up to 100W (tested with
> a 65W charger). I thought it was just under heavy system load but it also
> happens under light use, such as watching YouTube. Whilst charging via
> USB-C, my laptop battery fluctuates between 95-100% when full (something to
> do with battery management, it is normal behaviour), but the hardware (i.e.
> the laptop LED indicator) still treats it as charging. The OS however sees
> it as on battery, causing large drops in performance (under heavy use) and
> causing severe momentary (~1 sec) stutter regardless of load level. On AC
> power, I have no explanation other than it never goes below 100% but Plasma
> still alternates between charging and battery profiles.
> 
> System info:
> Operating System: Fedora Linux 41
> KDE Plasma Version: 6.3.4
> KDE Frameworks Version: 6.12.0
> Qt Version: 6.8.2
> Kernel Version: 6.13.9-200.fc41.x86_64 (64-bit)
> Product Name: ROG Zephyrus G14 GA401QM

Update: this seems to be an upstream regression in UPower v1.90.8 which has been fixed in 1.90.9. It's rolling out to Fedora 40-42 stable repos soon, idk about other distros. I don't notice the behaviour any longer, can others in this report confirm the fix works?
Comment 7 Nate Graham 2025-04-15 13:50:34 UTC
Thanks a lot for figuring that out!
Comment 8 Snake Scaly 2025-04-15 16:14:32 UTC
Yes, can confirm the fix. Powerdevil stays on the "On AC Power" profile even when the state is "plugged in but still discharging"