Most active commenters
  • GeekyBear(7)
  • vladvasiliu(5)

←back to thread

OpenGL 3.1 on Asahi Linux

(asahilinux.org)
512 points simjue | 28 comments | | HN request time: 0.257s | source | bottom
Show context
zamadatix ◴[] No.36213299[source]
From a follow up post on Mastadon https://social.treehouse.systems/@AsahiLinux/110497512340479...:

"Also in this update:

We now have a cpuidle driver, which significantly lowers idle power consumption by enabling deep CPU sleep. You should also get better battery runtime both idle and during sleep, especially on M1 Pro/Max machines.

Thanks to the cpuidle driver, s2idle now works properly, which should fix timekeeping issues causing journald to crash.

Also thanks to the cpuidle driver, CPU boost states are now enabled for single- and low-threaded workloads, noticeably increasing single-core performance.

Thermal throttling is now enabled, which should keep thermals in check on fanless (Air) models. There was never a risk of overheating (as there are hard cutoffs), but the behavior should now more closely match how macOS works, and avoid things getting too toasty on your lap.

Random touchpad instability woes should now finally be gone, thanks to bugfixes in both the M1 (SPI) and M2 (MTP) touchpad drivers.

A bugfix to the audio subsystem that fixes stability issues with the headphone jack codec.

New firmware-based battery charge control, which offers fixed a 75%/80% threshold setting. To use this, you need to update your system firmware to at least version 13.0, which you can do by simply updating your macOS partition to at least that version or newer. This new charge control method also works in sleep mode.

U-Boot now supports the Type A USB ports (and non-TB ports on the iMac), so you can use a keyboard connected to any port to control your bootloader.

And last but not least, this kernel release includes base support for the M2 Pro/Max/Ultra SoCs! We are not enabling installs on these machines yet as we still have some loose ends to tie, but you can expect to see support for this year's new hardware soon."

replies(6): >>36213477 #>>36214241 #>>36215165 #>>36216598 #>>36217305 #>>36226845 #
1. vanburen ◴[] No.36214241[source]
"New firmware-based battery charge control, which offers fixed a 75%/80% threshold setting. To use this, you need to update your system firmware to at least version 13.0, which you can do by simply updating your macOS partition to at least that version or newer. This new charge control method also works in sleep mode."

This is interesting, am I correct in thinking this a feature implemented by Apple and now supported by the Asahi team? Does that mean that macOS supports this charge control feature?

I really hope Apple brings the same charge limiting to iPhone as well.

replies(3): >>36214505 #>>36215639 #>>36218356 #
2. brynet ◴[] No.36214505[source]
> This is interesting, am I correct in thinking this a feature implemented by Apple

Yes, battery charge control is a hardware(/firmware) feature supported on other modern laptops as well, such as the Lenovo ThinkPads, but it's not a standard so it requires explicit driver and OS support.

OpenBSD recently added support for this as well for both of these implementations (Apple silicon and ThinkPads).

https://marc.info/?l=openbsd-cvs&m=168436150408382&w=2

https://marc.info/?l=openbsd-cvs&m=168458409622780&w=2

https://marc.info/?l=openbsd-cvs&m=168521616605492&w=2

I know certain Android/Samsung phones support this as well, not sure about iOS/macOS.

replies(3): >>36215114 #>>36215140 #>>36221992 #
3. londons_explore ◴[] No.36215114[source]
If your laptop firmware doesn't support it, here is one trick if you have a removable battery:

Put a piece of paper over one of the batteries middle contacts. That will make the firmware think the battery is overheating. It will then refuse to charge, but will still happily discharge.

You can do that to keep your battery at 80% while still on AC power. Handy if you operate from AC power 99% of the time, yet don't want your battery to die from being stored at 100% charge and hot for many years.

replies(1): >>36217476 #
4. Thews ◴[] No.36215140[source]
I am on macos 13.3.1 and have noticed this feature for at least a couple of months, maybe longer. It says Charging On Hold (Rarely Used On Battery)
replies(2): >>36217275 #>>36220004 #
5. GeekyBear ◴[] No.36215639[source]
> I really hope Apple brings the same charge limiting to iPhone as well.

This was added to iPhones in 2019.

> If your iPhone stops charging at 80%, it's most likely due to a feature Apple introduced in iOS 13 called Optimized Battery Charging. It aims to prevent over-stressing the battery and hence extend the battery life of your iPhone by limiting the charge to 80%.

Your iPhone learns your usage patterns and delays 100% charging until moments before you wake up in the morning.

https://www.makeuseof.com/why-your-iphone-stops-charging-at-...

replies(1): >>36217028 #
6. vladvasiliu ◴[] No.36217028[source]
It's a bit different, though. I don't often need my iphone to last multiple days on end. Yet, if I keep it plugged in as often as I'm sitting at a desk, it'll never go below 80%. If I get it below 80%, sooner or later, it will figure "i want to use it" and will charge it all the way to 100%. The lowest my battery ever got on this phone was 40 something when I was away for a weekend without a charger. It's very rare I use it a lot, so the "intelligence" clearly doesn't care how long the battery needs to last.

The way it's implemented on my mom's android, it always shows 80 or 85% (can't recall which one it is), even if she leaves it plugged in for the whole weekend.

On my HP laptop, if I activate the "battery saver mode" (as opposed to "AI"), it reports the maximum capacity as somewhere around 80% of the design capacity. I don't know whether Linux cooperates with this, but probably not. HP only talks about OS compatibility for the "AI" mode, which not only requires Windows but a specific HP app.

replies(1): >>36217124 #
7. GeekyBear ◴[] No.36217124{3}[source]
> It's a bit different, though.

Yes.

It learns your normal waking time (if you have one) and gives you a full charge before you wake up.

Which is what I want. A full charge for the working day, without needlessly shortening the batteries functional lifetime.

replies(2): >>36217246 #>>36218491 #
8. vladvasiliu ◴[] No.36217246{4}[source]
Sure, but if I know I won't drain my battery more than 10% that day, I can't tell it not to top it up more than 80%. That's the case for me 99.9% of days.

This also seems to work only if you've drained the battery below 80%. If it says 90% and I plug it in? It'll charge it fully right away.

replies(1): >>36217497 #
9. eisa01 ◴[] No.36217275{3}[source]
I can never get that to activate, even though I use my MBP 14" 100% at home...
replies(2): >>36222992 #>>36243992 #
10. mschuster91 ◴[] No.36217476{3}[source]
> Put a piece of paper over one of the batteries middle contacts.

Bad, very bad idea if you don't know what you are doing - depending on where the "smarts" in the BMS are, you may damage your battery or make your BMS think the pack is broken or prevent your BMS from recognizing a charge state mismatch (and in the worst case, a cell going undervoltage or reverse polarity) as you have a good chance that you cut off one of the cell balancer contacts. This trick only works with removable phone batteries.

replies(1): >>36220992 #
11. GeekyBear ◴[] No.36217497{5}[source]
That's not how Apple's implementation works.

It doesn't charge the battery over 80% at all, unless it detects that you have a normal waking time, in which case it charges fully right before you normally wake up.

Unfortunately, other companies copied the 80% charge bit without copying the part about figuring out if you have a normal waking time and giving you a full charge right before that.

For instance, Samsung's S23:

>Once you turn off the battery protection function, you'll be able to charge your battery up to 100%

https://www.samsung.com/ae/support/mobile-devices/battery-pr...

replies(1): >>36222804 #
12. cyberax ◴[] No.36218356[source]
> This is interesting, am I correct in thinking this a feature implemented by Apple and now supported by the Asahi team? Does that mean that macOS supports this charge control feature?

It does, but in a weird way. You can turn on "adaptive charging" and it will randomly decide to charge to 80%.

If you want to properly control it, just install the wonderful AlDente utility ( https://apphousekitchen.com/ ). Then you can manually control the max charge percentage. Mine is permanently set to 80% because I never really use even 40% of the battery on my M2-based laptop.

13. lonjil ◴[] No.36218491{4}[source]
My Sony Xperia 10 IV lets you set it to never charge above 90 or 80 %, as an alternative to it learning your habits. I have it set to 80%, and I've been unable to use it up in under 2 days. I've heard that iPhones have similarly good battery life as the 10 IV, so it seems, to me, that get quite far on 80%.
replies(2): >>36219748 #>>36220011 #
14. GeekyBear ◴[] No.36219748{5}[source]
> I've been unable to use it up in under 2 days.

Take up playing a resource intensive game like Genshin Impact and you can very easily drain the battery in a day.

> 60fps highest settings 100% brightness Low sound Home WiFi 3:20 total

https://www.reddit.com/r/SonyXperia/comments/onb3dw/genshin_...

15. windowsrookie ◴[] No.36220004{3}[source]
Optimized Battery charging has been available since Mac OS 11. Works on intel MacBooks too.

https://www.macworld.com/article/235001/macos-big-surs-batte...

16. pezezin ◴[] No.36220011{5}[source]
I bought the same phone recently, and for my light usage pattern (some texting, the browser, Google Translate, Google Maps, a calculator app, and the camera), the battery lasts almost 5 days!

I had completely forgotten how it is to own a phone that doesn't need to charge everyday...

17. londons_explore ◴[] No.36220992{4}[source]
Would an engineer really make a consumer design where a sliding contact failing open led to a safety incident?

Every laptop since the 90's has the balancing and protection circuitry inside the battery, not inside the laptop.

replies(1): >>36222961 #
18. ficklepickle ◴[] No.36221992[source]
I really want to try this out on my work ThinkPad since it stays plugged in effectively all the time. It requires a kernel module though, I'd need to get that approved first and I haven't got around to it.

Naïve me doesn't understand why it can't be done from userspace, but I'm sure there is a good reason...

19. vladvasiliu ◴[] No.36222804{6}[source]
> It doesn't charge the battery over 80% at all, unless it detects that you have a normal waking time, in which case it charges fully right before you normally wake up.

My iPhone disagrees with you. I go to bed and wake up at just about the same time. If I somehow managed to drain the battery below 80%, when I plug it in, it'll charge to 80 and then tell me that by the time I wake up in the morning, it'll be fully charged. Which is the case.

But the most common use case, for me, is waking up, leaving the phone plugged in (WFH). Maybe go for a walk around noon, snap a picture or two. Forget to plug it back in and get back to work. Plug it in as I go to bed at 95%. It tops right up, doesn't wait until the morning.

> Unfortunately, other companies copied the 80% charge bit without copying the part about figuring out if you have a normal waking time and giving you a full charge right before that.

But that's actually what I want. With very, very rare exceptions, I never need a full charge on my phone. Hell, until a few weeks back, I was rocking an iphone 7 with a battery in a questionable state (started bulging). That thing never went below 60% with my use patterns. 60% meant night out, so a hefty dose of maps use. Normal days, it didn't go below 85-90%.

I think the issue is that Apple expects that when you wake up in the morning, you unplug your phone for the day and actually use it a significant amount. Which isn't my case at all. If I don't leave my house, it'll stay plugged in. I usually forget about my phone since everything I need to do, I do on my computer. For the occasional phone call, I can either keep it plugged in (the cord is long enough) or it's already connected to my headset, so don't even need to go fetch the phone. If I don't go to work, it can stay plugged in for days on end (I don't always grab it when I go out).

replies(1): >>36225146 #
20. userbinator ◴[] No.36222961{5}[source]
Indeed, at worst you'll get a "no battery installed" and the laptop might not even try to discharge it.

The comment you're replying to is just paranoic FUD. Which removable laptop battery has external balancing contacts!?!? They're all +/-/data.

replies(1): >>36223399 #
21. MobiusHorizons ◴[] No.36222992{4}[source]
It’s in settings under battery
22. mschuster91 ◴[] No.36223399{6}[source]
I'm a corporate firefighter assistant. If there's one thing people should not be messing around with, it's Li-Ion batteries. These things are dangerous enough even without people messing around with their control and management systems.
23. GeekyBear ◴[] No.36225146{7}[source]
> that's actually what I want

Why protect your battery's ability to hold a full charge over a longer lifespan if your battery is constantly throttled to a partial charge anyway?

replies(1): >>36225743 #
24. vladvasiliu ◴[] No.36225743{8}[source]
Because it's my understanding that charging and keeping it all the way full shortens significantly its battery life compared to 80-85%. I would rather not have to dick around plugging and unplugging the phone to not have it be full all the time. Plus, that also counts as consumed cycles.

I've used my old phone for a good six years. I've swapped its battery some three years ago, and it would've needed a new one now, had I continued using it.

If that phone is any indication, my current one should be in service for at least as long. If I can avoid having to swap its battery, it's a win in my book.

It can also sometimes happen that I foresee being away from an outlet or otherwise need as much charge as possible. In those situations, I'd just deactivate the battery saver feature and let it charge to 100%. So if the remaining capacity is closer to its original one, again, it's a win.

replies(1): >>36225819 #
25. GeekyBear ◴[] No.36225819{9}[source]
> Because it's my understanding that charging and keeping it all the way full shortens significantly its battery life compared to 80-85%.

If you don't charge fully until just before the user's normal wakeup time you aren't keeping it all the way full all the time.

You protect the battery lifespan and get a full charge at the beginning of the day, instead of having a battery that constantly holds less charge.

replies(1): >>36226234 #
26. vladvasiliu ◴[] No.36226234{10}[source]
> If you don't charge fully until just before the user's normal wakeup time you aren't keeping it all the way full all the time.

You keep repeating this and seem to ignore my observation that if the battery isn't drained below 80% when I plug it in, it will recharge it fully immediately. It will not wait until the user's wake-up time.

And in my case, it's rare that the battery falls below 80%, so whenever I plug it in, it gets recharged fully right away.

So, in practice, it's all the way full all the time.

replies(1): >>36228301 #
27. GeekyBear ◴[] No.36228301{11}[source]
> in my case, it's rare that the battery falls below 80%

Yet year after year, surveys show that more battery life is the feature people want in a phone the most.

> 9 out of 10 phone users have low-battery anxiety

https://electrontogo.com/blog/9-out-of-10-phone-users-have-l...

Intentionally throttling the battery's ability to charge no matter what is going the wrong way.

28. hedgehog ◴[] No.36243992{4}[source]
In my experience for it to take effect you need either a predictable window of plugged in time (it will delay charging until it needs to to hit 100% by when you normally unplug) or just to use your compute almost exclusively plugged in (at which point it will start letting the battery drift down to 80%). If you regularly unplug to work on the couch or whatever you may not ever see the effect directly unless you wake up an hour early to check the charge state of your laptop.