10 hours to fully charge my laptop battery - Asus ZenBook UX431DA

Hi everyone!

So this is quite strange and I'm not sure this was ever discussed here. Kind of new to FreeBSD so please take that into consideration.

So each time I plug my power cord it takes an abnormal amount of time to charge the battery. Like an hour per 10% charge, which in my honest opinion it's a lot of time! This doesn't happen if the computer is turned off, so it's not a battery issue. Also, if I try to boot into another OS (for example I tried to use Tails OS) it charges with no problem (I'm talking about less than 2h)! Ever weirder is that after I reboot from Tails OS without unplugging the power cable, after I login to FreeBSD the remaining time for charging is the same as Tails, so roughly 2h or less to fully charge!!! So I'm obviously missing something here.

Can anyone point me to the right direction? Is this some driver related thing?
Really appreciate your help!

Many thanks,
Juan.
 

SirDice

Administrator
Staff member
Administrator
Moderator
Might be because on FreeBSD the CPU is on "full blast", i.e. not throttling down when idle. That would suck a lot more power, resulting in less additional power to charge the battery. On one of my laptops running windows and playing a game the battery barely gets charged because there's isn't a lot of "surplus" power to change it, the CPU, graphics and screen are all on full blast and using up most of the power coming from the power brick.

Did you enable things like powerd(8)?
 
Hi! Thanks for the quick reply.

Yes, I did enabled «powerd(8). Actually I also tried powerdxx(). Figured I could lower power usage but no luck on that I'm afraid :/ it does work while on battery as I see some time gain but when it comes to charging that's a different story.

Ever weirder is that after I reboot from Tails OS without unplugging the power cable, after I login to FreeBSD the remaining time for charging is the same as Tails, so roughly 2h or less to fully charge!!!
But how can you explain this? I mean, this doesn't make sense at all...

Thanks!
 

SirDice

Administrator
Staff member
Administrator
Moderator
Battery state is just something you can read off of the battery itself. So if it's been charged on OS-A to say 50%, it's going to show 50% on OS-B too because that value doesn't change when you read its status. The speed at which it charges can be different between OS-A en OS-B though, if there are differences in the way power consumption is handled. The "time to charge" number is just a calculation based on some parameters.

Obligatory XKCD:
estimation.png
 
OP might also want to check some power drainers beyond powerd(8): Bluetooth, bittorrent, network scanners (like tcpdump(1) or security/snort), network servers like Apache, and other daemons that run constantly. Default installation of FreeBSD doesn't enable them, but if OP has something like that starting at boot, that can do a number on the battery.
 
In my humble opinion this sounds like a FreeBSD bug, especially since it's working properly elsewhere. I had a similar Asus VivoBook before that had some battery logic in place to never let the battery charge completely, so maybe they do something a little strangely. Perhaps a BIOS update would fix it, if available.
 
Thanks.
Battery state is just something you can read off of the battery itself. So if it's been charged on OS-A to say 50%, it's going to show 50% on OS-B too because that value doesn't change when you read its status. The speed at which it charges can be different between OS-A en OS-B though, if there are differences in the way power consumption is handled. The "time to charge" number is just a calculation based on some parameters.

Obligatory XKCD:
estimation.png
Thanks! Well, I get what you mean but maybe I wasn't clear enough about the change between OSs. Taking your example, what happens in my case is if I power up freebsd and start charging from 50% it takes 5h to fully charge. On the other hand, if I do the same after rebooting from the other OS it literally takes 1h. I know the "time remaining" is not 100% accurate so I did by watch and it does charge in one hour. I'm not talking about 30min difference here ;)
 
OP might also want to check some power drainers beyond powerd(8): Bluetooth, bittorrent, network scanners (like tcpdump(1) or security/snort), network servers like Apache, and other daemons that run constantly. Default installation of FreeBSD doesn't enable them, but if OP has something like that starting at boot, that can do a number on the battery.
Thanks! No network servers, nothing fancy going around... I would check that but what's bothering me is the sudden change from when I swap from OSs
 
Thanks! No network servers, nothing fancy going around... I would check that but what's bothering me is the sudden change from when I swap from OSs
In that case, I would suggest updating the laptop's BIOS. It is an awfully new device, though. FreeBSD tends to lag behind Linux when it comes to proper support for very recent hardware. Even on these forums, I've seen jokes about buying a laptop and waiting a couple years before installing FreeBSD on it. Going by your posts, seems like FreeBSD is trying to catch up, which is encouraging to me.
 
In that case, I would suggest updating the laptop's BIOS. It is an awfully new device, though. FreeBSD tends to lag behind Linux when it comes to proper support for very recent hardware. Even on these forums, I've seen jokes about buying a laptop and waiting a couple years before installing FreeBSD on it. Going by your posts, seems like FreeBSD is trying to catch up, which is encouraging to me.
Yeah, it's fairly new. And I know some support takes some time to be fully implemented. I have some unresolved issues like my Fn key not working the way it should (multimedia, sound, brightness, keyboard back-light, etc.) and although I found alternatives to use those (except keyboard back-light control) by using simple shortcuts using Super key, it tends to be somehow annoying to have a new computer and not be able to use simple stuff like that. And I get laptops are not "priority" but it would be nice to have this kind of stuff working :)
 
So there was a BIOS update available and all went well. I'll do some testing and see if it makes any difference.

Thank you all for the advises!
 
So the first thing I've noticed was an impressive +2h of battery on the battery status (obviously not 100% accurate these estimations but it's promising!)... now let's discharge half battery and plug the power cable to see if there's any changes.

Cheers and thanks once again! Fingers crossed 🤞
 
No use. It took a huge amount of time just to charge 1%. and I wasn't doing nothing.

View attachment 11851

Also, updating the BIOS gave me two news... a good and a bad. Good one is that now the battery almost doubled on duration. The bad one is that after the BIOS update my keyboard back-light just turned off. The problem is that I don't know how to change that on the command-line...
 
No use. It took a huge amount of time just to charge 1%. and I wasn't doing nothing.

View attachment 11851

Also, updating the BIOS gave me two news... a good and a bad. Good one is that now the battery almost doubled on duration. The bad one is that after the BIOS update my keyboard back-light just turned off. The problem is that I don't know how to change that on the command-line...
Ummm... woudn't the BIOS provide a way to control the keyboard backlight? I actually went through a similar experience about 10 years ago, lost the backlight on my laptop... in my case, the backlight somehow came back on by itself a few years later... go figga.
 
Ummm... woudn't the BIOS provide a way to control the keyboard backlight? I actually went through a similar experience about 10 years ago, lost the backlight on my laptop... in my case, the backlight somehow came back on by itself a few years later... go figga.
Just checked and nothing there to change... :confused: Still, I can live with that!


What I don't want is to either shutdown/suspend each time I want to charge in a fast way or wait 5 hours just to charge half battery 🤦‍♂️I even tried the following config on /etc/rc.conf:
Code:
## Power Managment
powerd_enable="NO"
powerdxx_enable="YES"
powerdxx_flags="-n min -a min -b min"
performance_cx_lowest=Cmax
economy_cx_lowest=Cmax
Nothing.... Anyway it doesn't make sense to have everything on minimum. What's the point? This is truly frustrating
 
Just checked and nothing there to change... :confused: Still, I can live with that!


What I don't want is to either shutdown/suspend each time I want to charge in a fast way or wait 5 hours just to charge half battery 🤦‍♂️I even tried the following config on /etc/rc.conf:
Code:
## Power Managment
powerd_enable="NO"
powerdxx_enable="YES"
powerdxx_flags="-n min -a min -b min"
performance_cx_lowest=Cmax
economy_cx_lowest=Cmax
Nothing.... Anyway it doesn't make sense to have everything on minimum. What's the point? This is truly frustrating
One battery-management strategy I can suggest is to charge it while you sleep. After 8 hours, you'd be fresh and ready to think your ass off. ;)
 
Well, I tryed to prevent devd(8) from launching /etc/rc.d/power_profile but it didn't make any difference.

Any ideas hot to "fix" this? I mean, if you think about it, after the BIOS update, powerdxx(8) does his job to idle the system and thus saving power. In theory if you don't change nothing on your cpu performance it should charge a lot faster if the system is on idle, right (just a thought)?
 
I know you've said that you've tried with different OSes, etc, but that 10% per hour is ridiculous!
I don't rule out a dying battery, but you may have a faulty charger. Swap with another one.
Faulty chargers sometimes (not always!) work, sometimes they don't. Drop in voltage is one sign.

Charges have few capacitors (filtering, ...) in them -- X-caps and Y-caps, etc.
Capacitors can die, but they won't drop dead necessarily. They could go leaky.

Drop in voltage is one consequence. You can measure the voltage of the charger with a mustimeter, though.
But it's easier to use another charger. By the way charger's voltage must match. (Amperage is different story!).
 
I know you've said that you've tried with different OSes, etc, but that 10% per hour is ridiculous!
I don't rule out a dying battery, but you may have a faulty charger. Swap with another one.
Faulty chargers sometimes (not always!) work, sometimes they don't. Drop in voltage is one sign.

Charges have few capacitors (filtering, ...) in them -- X-caps and Y-caps, etc.
Capacitors can die, but they won't drop dead necessarily. They could go leaky.

Drop in voltage is one consequence. You can measure the voltage of the charger with a mustimeter, though.
But it's easier to use another charger. By the way charger's voltage must match. (Amperage is different story!).
Hi vigole,

Thanks for the input. I'll check my charger voltage, although it seems strange that every time I swap to another OS this doesn't happen.

This is my readings for acpiconf -i 0 while on battery state:
Code:
# acpiconf -i 0
Design capacity:    6000 mAh
Last full capacity:    5182 mAh
Technology:        secondary (rechargeable)
Design voltage:        7850 mV
Capacity (warn):    518 mAh
Capacity (low):        207 mAh
Cycle Count:        215
Mesurement Accuracy:    99 %
Max Average Interval:    -1 ms
Min Average Interval:    -1 ms
Low/warn granularity:    60 mAh
Warn/full granularity:    0 mAh
Model number:        UX431
Serial number:        123456789
Type:            LIon
OEM info:        ASUSTeK
State:            discharging
Remaining capacity:    52%
Remaining time:        3:44
Present rate:        724 mA (5683 mW)
Present voltage:    7850 mV

And here while it charges:
Code:
# acpiconf -i 0
Design capacity:    6000 mAh
Last full capacity:    5182 mAh
Technology:        secondary (rechargeable)
Design voltage:        7850 mV
Capacity (warn):    518 mAh
Capacity (low):        207 mAh
Cycle Count:        215
Mesurement Accuracy:    99 %
Max Average Interval:    -1 ms
Min Average Interval:    -1 ms
Low/warn granularity:    60 mAh
Warn/full granularity:    0 mAh
Model number:        UX431
Serial number:        123456789
Type:            LIon
OEM info:        ASUSTeK
State:            charging
Remaining capacity:    51%
Remaining time:        unknown
Present rate:        442 mA (3469 mW)
Present voltage:    7850 mV

P.S.: odd thing not showing the remaining time while charging though....
 
I think your laptop is actually AMD Ryzen based? As far as I know their microcode updates appear in the linux-firmware tree without technical documentation of what they're supposed to fix, the port installing them to /usr/local/share/cpucontrol/microcode_amd*. Reading your laptop's manual, F7 (or probably Fn key + F7) is supposed to control your keyboard light, but I would be surprised if it works. I don't really know what other things to suggest. Some of these functions are probably supposed to be handled by the acpi_asus and acpi_asus_wmi drivers. At any rate, I'd report a bug.
 
Top