Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery consumption S3 #4

Closed
Kabbone opened this issue Apr 19, 2020 · 13 comments
Closed

Battery consumption S3 #4

Kabbone opened this issue Apr 19, 2020 · 13 comments
Assignees

Comments

@Kabbone
Copy link
Contributor

Kabbone commented Apr 19, 2020

How is your battery consumption during S3 state? Mine was ~ 15%/5hours, so around 3%/hour. It's not too much in absolute energy if you look at the numbers (~0.8W), but relatively it still seems quite high.

@ijonglin
Copy link
Owner

That would line up with my expectations. I can run the experiment with the battery-graph utility and give you the direct graphs for the full numbers, but I have an original F5 with its standard battery 26 Wh and then one where I soldered in an extra 40 Wh battery in parallel. When I put them into S3, I'm getting 3%/hour on the standard configuration, and 1%/hour on HW-hacked configuration. There are many power settings in the BIOS, but didn't find a combination that seemed to consistently change these numbers -- (and then were subsequently lost due to battery wipes). The original is okay, but battery life is acceptable in S3, but the HW modified one makes my requirements happy. Powering off shows near zero leakage. So, although it's pretty good (c'mon 0.8W -- what am I expecting), I really solved that problem via HW and a larger battery, and just powering down when necessary. If you were to run the Windoze OS, the power during sleep is much better, but I have a feeling it's because of some run-time modifications that Windoze is doing because it's NOT captured in the DSDT. I'm not a Windows person, so I can't know what exactly it's doing, but I feel if I could know what it was doing, there's no reason that Linux couldn't do it. But that would require a level of Windows instrumentation that I do have time for. So, I solve this problem with HW. Except for the size of the battery, this laptop is perfect for me, so I soldered in new battery in parallel, modified the casing with 3-D printing, and added 230 grams of weight to triple its effective battery life.

To help you out, I can do the power-graphs and/or show into greater depth in the HW configurations. Add either one as a new issue and I can put some side time on it, if it'll help you.

@ijonglin ijonglin self-assigned this Apr 19, 2020
@ijonglin
Copy link
Owner

Note also you can expand the battery with an external battery supply (70Wh, and add 406 grams) and get the battery life to close what you design, but really the HW-hacked one is much more convenient and lighter -- it charges normally, but just has 3x capacity. However, the external battery supply looks TSA travel-ready, unlike the HW modified one.

@Kabbone
Copy link
Contributor Author

Kabbone commented Apr 19, 2020

ok, good to know. Then I'm at least not totally off with something, no need to do extra meassurements, thanks! My "solution" for the battery capacity was an additional 20000mAh powerbank which is PD capable.
I'm also just running Linux. I have to take a look at the WiFi, seems like it is really eating battery with my configuration.
I added enabled TPM to my DSDT to tinker with it a bit, but don't know if there will be a good use for it, perhaps signing kernel images for secure boot.

@ijonglin
Copy link
Owner

Here's the snapshots of all the bios screens that give me all functionality (including touchscreen).

https://photos.app.goo.gl/5NCNMQrbH3AhAviYA

If you believe the wifi is the issue, I suspect it has to do with Wifi driver shutdown sequence and/or the required power messages on the PCIE. There are some settings under the PCIE menu that related to ACPI. And I can do driver-mucking about, but the simple experiment that we both should do is to put the laptop in Airplane mode first, put it to sleep, and then see whether the drain is any less. If it is, then it's back to Linuxy, C code domain, which I can help with. If it doesn't, then it's the weird run-time Windoze magic and/or BIOS configuration. It's definitely working with this hardware -- the power when you're sleeping in Windows is much, much less, I don't know whether it's driver magic, BIOS settings and/or OS magic, or a potpourri combination of all of them.

@Kabbone
Copy link
Contributor Author

Kabbone commented Apr 19, 2020

ah, I didn't mean Wifi with suspend, I did my test with airplane mode ;). The wifi is quite power hungry during run time, but I will tinker a bit with the module parameters. I already did, but perhaps I screwed something up.

EDIT: but thanks for the settings, I will compare to mine, but at first sight it seems I have more options than you. Are you running BIOS version 3.06?

@ijonglin
Copy link
Owner

For BIOS:
sudo dmidecode

dmidecode 3.1

Getting SMBIOS data from sysfs.
SMBIOS 3.1.1 present.
Table at 0x79C11000.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: TECLAST
Version: tPAD 3.06
Release Date: 08/15/2018
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 4544 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 kB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Targeted content distribution is supported
UEFI is supported
BIOS Revision: 3.6
Firmware Revision: 19.2

@ijonglin
Copy link
Owner

ijonglin commented Apr 19, 2020

For Wifi, it looks like I sacrificed stability for power:

ijonglin@ijonglin-f5-fat:~$ cat /etc/modprobe.d/iwlwifi.conf
options iwlwifi wd_disable=0 bt_coex_active=0 11n_disable=0 power_save=0

ijonglin@ijonglin-f5-fat:~$ uptime
10:54:46 up 23 days, 19:27, 3 users, load average: 1.74, 1.93, 1.82

;-) I'm pretty sure that I forced it to power_save=0 to avoid S3 wake-up issues.

@Kabbone
Copy link
Contributor Author

Kabbone commented Apr 19, 2020

looks identical

dmidecode 3.2

Getting SMBIOS data from sysfs.
SMBIOS 3.1.1 present.
Table at 0x79C0F000.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: TECLAST
Version: tPAD 3.06
Release Date: 08/15/2018
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 4544 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 kB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Targeted content distribution is supported
UEFI is supported
BIOS Revision: 3.6
Firmware Revision: 19.2

@Kabbone
Copy link
Contributor Author

Kabbone commented Apr 19, 2020

I also checked the BIOS settings, we had smaller differences, especially for I2C devices.
But there were the same ones available :)

cat /etc/modprobe.d/powersave.conf options iwlwifi power_save=1 uapsd_disable=0 led_mode=3 options iwlmvm power_scheme=3 options iwldvm force_cam=0
btw did you find a solution for the sound crackling when the sound chip comes back from powersave?

@ijonglin
Copy link
Owner

There's another person over in Germany, who noted the same issue:
From another developer in Germany:

Once issue remaining for me is that the Realtek audio driver does not
know how to deal with this board and its amplifier implementation, i.e.
if does not switch off the speaker amp before going to sleep which then
causes a very audible "klack" several times - I am scared about my
speakers :) Once I have some time I need to just trial and error find
the GPIO but the Realtek codec driver is huge and this will take some
time to figure out.

That's the only hint I got. From back in my circuit design days, I feel like it's
power signal spike on a quick power shutdown that's being translated into a signal spike.
Once again, I don't hear this issue in Windoze, so it could be combination or a timing issue related to a combination of driver/BIOS/Kernel. I feel like if the ramp down on the voltage to the
audio was slow enough, this issue wouldn't happen, so that's MY hint. There are some weird voltage control settings in the BIOS, so it might be possible to do something there. IMHO, I wish it were just an driver issue, but I feel like it's a deeper issue because your significant upgrade of kernel hasn't solved the problem yet.

@ijonglin
Copy link
Owner

If you want create a different issue w.r.t. the audio click, feel free to create one and I can add the information that I've put together so far.

@ijonglin
Copy link
Owner

ijonglin commented Apr 19, 2020

Finally, as a last comment, for full disclosure, although I've enjoyed these many engineering conversations, a lot of these issue can be avoided completely by buying one of the OTHER offbrand laptops under the totally trustworthy names BMAX (which seems to have borrowed its trademark from the transformers). Linux and S3 work out of the box on these equivalent machines. However, it has the problem that it doesn't do click and hold -- it only supports double tap and hold, which drives me bonkers. That said, I've already paid for the crime and I'm happy with the physical click and hold on Teclast F5 and I'll consider moving off it in 3-4 years.

@Kabbone
Copy link
Contributor Author

Kabbone commented Apr 19, 2020

ah yes, I read this article/blog too. I remember I had a similar problem with another laptop like 10 years ago and it got solved by some driver quirks, but I can't really remember.

For me it's also not my main device, so it's main purpose is mobility which I luckily don't need too often. The current state is already fine for it's purpose :), but good to know there is another option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants