Forcing it to idle appears to make it behave as it’s supposed to for the moment, I’ll see if the battery drain any
Here’s a screen recording showing a comparison of “Normal” and “Idle”
It doesn’t appear to change vram power states with idle mode, and the battery isn’t draining below 95% (At an unreasonable speed, anyway. settings estimates 24-48 hours of battery remaining.)
In that video, It looks a be a lot less stutter with “IDLE” set.
I have fixed various bugs in the EC firmware source code, so I don’t have any of the problems here.
As one can easily brick the whole laptop if not very careful installing it, I would not recommend anyone try it until I have got round to writing the install instructions.
For those interested in browsing source code:
I hope to finish the instructions next weekend.
After rebooting the laptop and applying the same things as earlier, it’s back to stuttering (While the laptop charging is forced into idle mode.)
The “sudo ectool idle” is not guaranteed to work.
Its basically fighting against the buggy EC battery charge code.
If the laptop needs charging, put it in “NORMAL” mode. let it charge, and then put it back in “IDLE” mode.
It really needs the EC bugs fixed, but the “sudo ectool idle” works some of the time.
Bad news everyone! The latest OEM driver update broke 140W (Baseus, used to work kinda well for months) gaming for me. The driver just crashes. With 180W is perfectly fine. We absolutely need a firmware fix for the power management. Bummer.
When the stuttering happens, what it the current charge level?
What is the charge limit level set in the bios?
For most of us, I believe it starts at 95%.
I have some video of this happening in the bug that was filed for framework. I can dig it up for you. EDIT: Screencast From 2024-12-20 13-34-29.mp4 - Google Drive
What we have found is that when it drops to 95% when gaming, the GPU power states go wild.
I assume you had 100% set in the BIOS as the battery limit.
What happens if you select “Battery Disconnect” in the BIOS and then try to play your game using the 240W charger?
Is it smoother?
I can test that for ya tonight
As for 100%, yes.
“battery disconnect” disconnects the battery until a power source is attached. So there is no way to have the laptop powered with that bios setting.
Steps to run a game with the a BIOS disconnected battery.:
- Connect PSU.
- Go into bios and set “battery disconnect”.
- Press F10 to save the BIOS settings.
- The laptop then switches off.
- Power on the laptop and let it boot into the OS. It will boot as if the battery was disconnected.
- Run games etc. but be careful not to disconnect the PSU, as the PC will shut off as the Battery is disconnected.
- You can reboot and the battery will still be disconnected.
- To reconnect the battery, unplug the PSU
- When you plug the PSU back in again, the battery will be connected.
On stock EC, no. It’s is not smoother on battery disconnect in most cases. Power saver mode behaves very smoothly, but balanced and performance don’t.
I have been playing with the EC firmware code, and have managed to extract a few more Voltage/Amps/Watts measurements from around the board.
E.g.
The “PD” is the USB-C PD PSU. Here my 180W PSU supplying 160 Watts.
The “ADP” is a buck converter that converts the 35V down to 20V before entering the Charger chip. So, here you see the same 160W of power, but voltage reduced to 20V with 8A.
The “BAT” is then showing that 65W is going to charge the battery.
The “SYS” is then showing it powering the CPU. Unfortunately, I have not found a current sensor for that part, but it will be something below 160 - 65 = 95 W.
There is also a “SysMaxV” setting, reported under “SYS: … Max: 17800 mV”.
It then gives some other info regarding whether it is in bypass mode or not etc.
The values from the battery BMS are below that.
Note: If it is in “BYPASS”, it is sending 20V to the CPU (not the SYS: 16.5V), but again, the amount of current going across the bypass is not measured.
If the “BYPASS” was off, it would be sending the SYS: 16.5V to the CPU.
PD: 35089.0 mV, I: 4644.00 mA, 162.95 watts
ADP: 19872.0 mV, I: 8064.00 mA, 160.25 watts
BAT: 16320 mV, discharge: 0 mA, 0.00 W, charge 3952 mA, 64.49 W
SYS: 16512.0 mV, I: Unknown, Max 17800 mV
control0: 0x1861
control1: 0x0303
NGATE: Off
BYPASS: On
BGATE: Normal / Off
BGATE: Normal / On
Reverse Turbo Boost: On
interfaces:0xffffffff
comm_init_dev being used /dev/cros_ec
Battery 0 info:
OEM name: NVT
Model number: FRANDBAT01
Chemistry : LION
Serial number: 0084
Design capacity: 5491 mAh
Last full charge: 5601 mAh
Design output voltage 15480 mV
Cycle count 82
Present voltage 16425 mV
Present current 2231 mA
Remaining capacity 3246 mAh
Desired voltage 17800 mV
Desired current 5491 mA
Flags 0x0b AC_PRESENT BATT_PRESENT CHARGING
interfaces:0xffffffff
comm_init_dev being used /dev/cros_ec
Charge mode = NORMAL (0)
Charge state change counter = 12
Battery sustainer slot = 0
Battery sustainer[0] = (55% ~ 60% ~ -1%)
Battery sustainer[1] = (0% ~ 0% ~ 0%)
Battery sustainer[2] = (0% ~ 0% ~ 0%)
Battery sustainer[3] = (0% ~ 0% ~ 0%)
I think for those playing games. If you want to stop it trying to charge the battery.
I think the best work around is to set:
ectool chargecurrentlimit 0
It will prevent it trying to charge the battery at all.
Set it back to normal behavior with:
ectool chargecurrentlimit 10000
The 10000 is an arbitrary value. It just needs to be above what the battery “Desired current” is likely to be.
The battery “desired current” overrides the “chargecurrentlimit” if chargecurrentlimit > Desired current.
The battery “desired current” is overridden by “chargecurrentlimit” if chargecurrentlimit < Desired current.
Using my new V/I/W EC firmware code I have discovered a few things:
With a FW 180W charger:
- Running stress-ng --cpu 16 causes it to draw 80W from the PSU.
- It can draw 160 or even 180W from the PSU if it is also charging the battery.
- Charger is in “bypass” mode.
With a 25W charger:
- Running stress-ng --cpu 16 causes it to draw 20W from the PSU and 20W form the battery. Making a total of 40W.
- In theory it should have been able to draw 20W from the PSU and 80W form the battery,
but it only managed 20W from the battery. - Charger is NOT in “bypass” mode. As expected.
With a 100W charger:
- Running stress-ng --cpu 16 cause it to draw 60W from the PSU.
- It is also charged the battery is can draw 85W from the PSU.
- Why can’t it draw 80W from the PSU for (1), like my 180W charger could?
- Charger is NOT in “bypass” mode. I would have assumed it would be, as it is 20V,5A charger.
If someone has a 240W PSU, please can they try:
sudo ectool chargestate param 3
interfaces:0xffffffff
comm_init_dev being used /dev/cros_ec
49168 (0xc010) # chg_status
sudo ectool chargestate param 4
interfaces:0xffffffff
comm_init_dev being used /dev/cros_ec
42926080 (0x28f0000) # chg_option
I think there is a windows version of ectool somewhere.
The param 3 and param 4 will tell me what mode the charger is in, and I would like to see if it is in bypass mode or not.
Here ya go:
$ sudo ectool chargestate param 3
114704 (0x1c010) # chg_status
$ sudo ectool chargestate param 4
50534497 (0x3031861) # chg_option
0x3031861
Means it is in bypass mode which is good.
Now only two left it could be:
- charging / discharging when it should not.
- signalling prochot and thus causing throttle when it should not.
I am still playing with the EC firmware to get enough info from it to narrow down the problem further.
Cause the ec sets the soft cpu (and the rest of the soc) power limits according to some arbitrary thresholds. You can override those with ryzenadj up to the max limits set by bios (and you can mess with those using smokeless umaf XD).
Ryzenadj at least on the 13 works quite well, the ec overrides the soft limits mostly just when plugging/unplugging a charger.
OK. I guess the next step in my play with the EC code is to capture logs of which cpu throttle messages it sends, and then track down the source of them and determine if they are valid or a bug.
Most of my work on it is not changing it’s behavior, but more getting it to report more information so we can find the bugs.
I have already found that the charger chip can get hot and has various current limiting thresholds and can signal the cpu to slow down. For example, it has one that would pretty much shut off the power if it hits 12A at 20V. Suspiciously close to 240W wouldn’t you say?