After writting extensively in [TRACKING] High Battery Drain During Suspend - #70 by Kimo_Bonnelycke about my similar but slightly different problem, I though I would create another thread to separate the two because the reason and fix is likely quite different.
The problem I’m talking about here is about the Framework laptop (11th gen at least), when going to s2idle sleep under Linux (at least), sometimes draw a “normal” 0.8w + epansion cards (1.5w for example with 2 USB-A), and SOMETIMES draw a much higher 3-7w, leading to the laptop getting very hot (especially when stored in a backpack) and of course the battery draining in a couple of hours.
I run Ubuntu 22.04 LTS, read the couple posts about battery optimisation already, I installed powertop, tlp, etc… Every tunable is “good” in powertop, I get a decent 5-6w idle with the laptop running, and when sleeping (s2idle) I measure a consumption of about 0.8w baseline (without expansion cards) at the USB-C plug, using an USB-C power meter while the battery is full.
In my first tests when it goes well, I let the laptop sleep for 3:30 hours, and the plug still reported about 1W consumption average (3.6Wh after 3h30min, with one USB-A card). This looks ok to me, it would mean the laptop can last about 55h in sleep. But unforunately, after I unpluged the laptop and resumed after 16h, the battery was almost empty, 48Wh had been consumed according to the laptop power statistics, this averages at 3W compared the 1W I saw earlier. Also the laptop was a bit warm (which makes sense as it has 3 times more heat to dissipate). I reproduced this problem twice back then (the first time I didn’t measure anything, I was just surprised).
I tried checking dmesg to see if the laptop was changing state (leaving s2idle or something like that) but unfortunately no, when the high consumption sleep state is reached, nothing different appears in dmesg, I see the normal s2idle state on sleep and the resume line when I resume, nothing else in between.
Another thing I tried is to measure the consumption (at the outlet) when this happens. To achieve this I put the laptop to sleep but plugged in like before, which gets me about 1w consumption when all is well, then I try unplugging, wait a couple minutes, plug again, wait for the top up charge if any and then read the consumption. In this try I made I got 1w at the first sleep, 1w after the unplug/replug, and the third time 7w !, the laptop is now sleeping (pulsing power LED) but quite warm and has a 7w consumption as opposed to the expected 1w. This is not the top-up charge because it’s been stable for hours. I did this test twice (resuming, make sure it’s fully charged, then sleep again and unplug/plug a couple times until I get something else than 1w and a warm laptop), and reproduced both times after just 2 or 3 unplugging (this takes time though, I have to let the laptop unplugged for hours sometimes, just unplugging/repluging quickly does not seem to reproduce).
I installed bios update 3.08 just in case as there was a fix about power management but unrelated, by lack of better options. As expected, 3.08 did not help with this problem, I reproduced easily after just 1 unplug (got lucky this time).
Somebody suggested Intel Has A Solution For Hot Linux Laptops Draining The Battery While Trying To Sleep - Phoronix which does sound like a possible cause, but I couldn’t manage to track in which kernel version this patch landed, it’s been quite some time already, I am up to date running 5.15.0-58 at the moment and can still reproduce.
A couple more users on [TRACKING] High Battery Drain During Suspend - #70 by Kimo_Bonnelycke confirmed they did see the same problem as me, which is good because first it means I’m not crazy, secondly it means it’s likely not an isolated hardware/software problem and might be reproducible by the Framework team.
Lately I tried using the option in the bios to limit the battery charge to 80% or 90%, to see if it would make any difference. I still reproduced the problem so it’s not “fixing” it. Though with the limit at 100% it’s even longer to measure because when we plug it in, it takes a long time for the battery to top-up until we can see the residual consumption. Whereas when limited to 80% it charges quickly and then stops so we can see more quickly if we’re stuck at 1w or 7w.
A couple more things I’ve noticed which may be interesting:
- Unplugging the laptop seems to be enough to (randomly) start the problem (go from 1w to 7w), and the easiest way I found to reproduce yet. But we must not replug too quickly though, so measuring is hard.
- Putting the laptop to sleep without touching the power cable can also start the problem.
- On the other hand, once we’re at 7w, unplugging/plugging does not help apparently, we can’t go back to 1w this way it keeps at 7w.
- Resuming and resleeping the laptop does fix the problem and allows it to go back to 1w
- When resumed, the laptop actually consume a little bit LESS power than while in this “weird” state (~6w idle, down to ~4w when the screen is off)
- The power button LED is still pulsing white as usual when I put the laptop to sleep, no matter if it’s consuming 1w or 7w.
- Tried with and without the USB-A cards, I can still reproduce without, though it seems harder, maybe its less likely or takes more time because of lower baseline consumption.
Hopefully I’ll be able to find a reproducible way, if that’s the case I’ll record a video.
In order to diagnose what part of laptop is draining the bogus extra 6w, I even went deeper down the rabbit hole and shot some thermal images of the motherboard using my cheap FLIR thermal camera. I normalized the thermal scale on most of them images so it’s easier to compare:
- Framework sleeping normally (s2idle, with only USB-C) at ~0.8w
- Framework sleeping with power issue at ~6.2w baseline
- Framework running idle at ~5w
It would be great is somebody from the team could acknowledge this problem and provide some leads as to what could cause this problem what can we do to help you fix it?