Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did someone do a deep dive on why battery life is so awful on Linux? Or is it some Ashai's driver's inefficiencies that causing this?




Each controller and subcomponent on the motherboard needs a driver that correctly puts it into low power and sleep states to get battery savings.

Most of those components are proprietary and don't use the standard drivers available in Linux kernel.

So someone needs to go and reverse engineer them, upstream the drivers and pray that Apple doesn't change them in next revision (which they did) or the whole process needs to start again.

In other words: get an actually Linux supported laptop for Linux.


> In other words: get an actually Linux supported laptop for Linux.

40% battery for 4hrs of real work is better than pretty much any linux supported laptop I've ever used


One of my favorite machines was the MacBook Air 11 (2012). This was a pure Intel machine, except for a mediocre Broadcom wireless card. With a few udev rules, I squeezed out the same battery performance from Linux I got from OS X, down to a few minutes of advantage in favor of Linux. And all this despite Safari being a marvel of energy efficiency.

The problem with Linux performance on laptops boils down to i) no energy tweaks by default and ii) poor device drivers due to the lack of manufacturer cooperation. If you pick a machine with well supported hardware and you are diligent with some udev rules, which are quite trivial to write thanks to powertop suggestions, performance can be very good.

I am getting a bit more than 10 hours from a cheap ThinkPad E14 Gen7, with a 64 Wh battery, and light coding use. That's less than a MacBook Air, where I would be getting around 13-14 hours, but it's not bad at all. The difference comes mainly from the cheap screen that is more power consuming and ARMs superior efficiency when idling.

But I prefer not to trade the convenience and openness of x86_64 plus NixOS for a bit more battery range. IMHO, the gap is not sufficiently wide to make a big difference in most usage scenarios.


The need to tweak that deeply just to get “baseline” performance really stings, though, particularly if you’re not already accustomed to having to do that kind of thing.

It’d be a gargantuan project, but there should probably be some kind of centralized, cross-distro repository for power configuration profiles that allows users to rate them with their hardware. Once a profile has been sufficiently user-verified and is well rated, distro installers could then automatically fetch and install the profile as a post-install step, making for a much more seamless and less fiddly experience for users.


Not trying to discredit your idea, but I feel like you're misrepresenting the amount of optimization apple does by calling it baseline.

It's generally the most optimized system down to the fact that Apple controls everything about it's platform.

If that's considered baseline, then nothing but full vertical integration can compete


While you are correct, for any user this is completely irrelevant, right? I have the choice between picking up an MBA or a different laptop. One comes with a reasonable expectation of battery life. The other is a gamble

For some laptops, this applies in comparison to Windows, too though (see elsewhere in thread for examples).

The advantage of Apple is that they deal with a tiny amount of hardware. Vertical integration enables aggressive optimizations.

I agree that in case of Linux, a udev rule generator would be a fantastic step ahead in terms of usability.


> 40% battery for 4hrs of real work is better than pretty much any linux supported laptop I've ever used

Not sure what "real work" is for you, but I regularly get more than 12 hours of battery life on an old Chromebook running a Linux and the usual IDEs/dev tooling (in a Crostini VM). All the drivers just work, sleep has no detectable battery drain. It's not a workstation by any means, but dual core Intel's are great for Python/Go/TypeScript


Out of curiosity, does Google contribute the drivers for Chromebook hardware to Linux upstream or do they keep it for themselves? Could it be that they just choose the hardware that works very well out of box with Linux?

I have no idea if there's upstreaming, but the Chomium OS repo is open source so you could check.

I don't know if that would help the wider Linux laptop community, because Chromebook OEMs can only select from a small list of CPU & chipset hardware combinations blessed by Google


What's the bar here? My Thinkpad X270 gets about 16 hours under Ubuntu with swaywm.

If we really want to get pedantic, its internal battery means the external pack is hot-swappable, so I can actually get several days on a "single charge." Good machine for camping trips.


[flagged]


Please don't cross into personal attack, name-calling, or cross-examination. This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html.

I see how the GP comment could be provocative, but on this site we want responses that dampen provocation, not amplify it.


>In other words: get an actually Linux supported laptop for Linux.

For a lot of people the point is to extend the life of their already-purchased hardware.


Linux might work with your hardware, but it might not work well.

If your vendor is hostile like Apple, it will be hard to make it keep on working.


Is apple really hostile, though?

For the boot process, apple went out of its way to support booting alternative OSs without compromising on security.

And mind you, most other laptops are no friends either. E.g. the often beloved ThinkPads have a bunch throttling issues on non-windows OSs.


> Is apple really hostile, though?

Yes. The existence of a proprietary escape hatch is not evidence of goodwill.

> ThinkPads have a bunch throttling issues on non-windows OSs.

That is an ACPI issue. Intel Macbooks also exhibit this behavior on Linux and BSD, and it's not even close to how incomplete power management is on Asahi.


Whataboutism doesn't make a vendor non-hostile.

Noone is doing that with ARM MacBooks.

Yet. Plenty of people have with Intel ones - I’m one of them. My first experience with Linux was on a 2016 MBpro. And inevitably people will do the same with the silicon Macs, likely using Asahi it seems.

Why are some of y'all so hostile to this idea?


It's not inevitable. That's not what that word means.

Intel Macs supported Linux because they used Intel's Linux drivers and supported bog-standard UEFI. There are no preexisting drivers or DeviceTree files published by Apple for Linux. There is no UEFI implimentation, just a proprietary bootloader that can be updated post-hoc to deny booting into third-party OSes.

> Why are some of y'all so hostile to this idea?

I would love for Linux to support as many ARM devices as possible. Unfortunately, it requires continuous effort from the OEM to be viable. I've bought Qualcomm, Rockchip and Broadcom boards before, none of them have been supported for half as long as my x86 machines are. Nevermind how fast ARM architectures become obsolete.

It feels like Apple is really the only hostile party here, and they coincidentally decide whether or not you get to use third-party OSes.


It is inevitable. I guarantee you there will be people who run Linux on their silicon Macs. I don’t know how you could possibly hold a stance that no one ever will.

Apple is very hostile to it. It won’t stop everyone though. It’ll continue to be niche but it’s happening.


It's not inevitable. It's fragile. Go boot up your old iPad; that should be well-studied, right? We ought to know how to boot into Linux on an ARM machine that old, it's only fair.

Except, you can't. The bootloader is the same iBoot process that your Apple Silicon machine uses, with mitigations to prevent unsigned OSes or persistent coldboot. All the Cydia exploits in the world won't put Linux back on the menu for iPhone or iPad users. And the same thing could happen to your Mac with an OTA update.

It is entirely possible for Apple to lock down the devices further. There's no guarantee they won't.


> with mitigations to prevent unsigned OSes

There is literally an apple-developed way to boot securely into alternative OSs. How would asahi work otherwise?

Also, if only apple is hostile, where is my Xbox/ps/switch/any random Android tablet/million other device's running Linux?


> There is literally an apple-developed way to boot securely into alternative OSs

This is not a good thing! You do not want a proprietary bootloader as your only way to launch Linux, it's not a safe or permanent solution. Apple Silicon could have implemented UEFI like the previous Macs did, but Apple chose to lock users into a bootloader they controlled. This is markedly different from most ARM device bootloaders which aren't changed by an OTA update in another OS partition.

> if only apple is hostile

I did not say that at any point in my comment. Forgeties original claim was that Apple Silicon would eventually have support comparable to Intel Macbooks on Linux. I am telling them point-blank that it is impossible, because Apple and Intel have fundamentally different attitudes towards Linux.

> where is my Xbox/ps/switch/any random Android tablet/million other device's running Linux?

Your Switch and Android tablet is already running the Linux kernel. The past 2 generations of Xbox and PS chipsets have upstream support from AMD in the Linux kernel, so you really only need a working bootloader to get everything working.

Ironically, this does mean that the Nintendo Switch has more comprehensive Linux support than Apple Silicon does.


Sure, the kernel. But you surely know that android abstracts away the drivers, so without the proprietary drivers you are back to square zero - it's not "GNU/Linux".

But you didn't say GNU/Linux, which surely you know is an arbitrarily high bar for any hardware to attain.

My point still stands, Apple does not trust their customers.


Sigh.

Apple cannot lockdown the Mac. You can’t have a development machine that is incapable of running arbitrary code. Back when they still did WWDC live they said that software development was the biggest professional bloc of Mac users. I’m certain that these days development is the biggest driver of the expensive Macs. No one has ever made a decent argument as to why Apple would lock down the Mac that would also explain why they haven’t done it yet.

Passivity isn’t hostility. There isn’t any evidence that Apple is considering locking down the Mac. They could have easily done that with the transition to their own silicon but they didn’t despite the endless conspiracy theories.


Apple can lockdown the Mac. You might not think it is likely, but without UEFI there is no path of recourse if Apple decides to update iBoot. How do you launch Asahi if Apple quits reading the EFI from the secure partition?

> They could have easily done that with the transition to their own silicon

They already did, that's what my last comment just outlined. Macs do not ship with UEFI anymore, you are wholly at the mercy of a proprietary bootloader that can be changed at any time.


Again, why haven't they done it yet? It's because you cannot lock down a development platform. Yes, they could do it but it doesn't make any sense. You haven't articulated why they would do it only that they could.

Why people continue to think Apple will treat the Mac like the iPhone I have no idea. Will Microsoft take the same approach with Windows as they did with Xbox? Different product, different strategy.


[flagged]


[flagged]


They made significant changes to the bootloader with the explicit goal of allowing boot of third-party operating systems.

Unless you can find a way to implement U-Boot on Apple Silicon, they can make more significant changes with no easy opt-out.

That's an admirable goal, but, depending on the hardware, it can run into that pesky thing called reality.

It's getting very tiresome to hear complaints about things that don't work on Linux, only to find that they're trying to run it on hardware that's poorly supported, and that's something they could have figured out by doing a little research beforehand.

Sometimes old hardware just isn't going to be well-supported by any OS. (Though, of course, with Linux, older hardware is more likely to be supported than bleeding-edge kit.)


> It's getting very tiresome to hear complaints

This is very true. I've been asked by lots of people "how do I start with Linux" and, despite being 99.9% Linux user for everything everyday, my advice was always:

1. Use VirtualBox. Seriously, it won't look cool, but it will 100% work after maybe 5 mins mucking around with installing guest additions. Also snapshots. Also no messing with WiFi drivers or graphics card drivers or such.

2. Get a used beaten down old Thinkpad that people on Reddit confirm to be working with Linux without any drivers. Then play there. If it breaks, reinstall.

3. If the above didn't make you yet disinterested, THEN dual boot.

Also, if you don't care about GUI, then use the best blessing Microsoft ever created - WSL, and look no further.


I've never gotten along too well with virtualization, but would second the ThinkPad idea, or something similar. Old/cheap machine for tinkering is a good way to ease in, and I think bare metal feels more friendly.

I'd probably recommend against dual booting, but I understand it's controversial. I like to equate it to having two computers, but having to fully power one off to do anything* on the other one. Torrents stop, music collection may be inaccessible depending on how you stored it, familiar programs may not be around anymore. I dual booted for a few years in the past and I found it miserable. People who expected me to reboot to play a game with them didn't seem to understand how big of an ask that really was. Eventually things boiled over and I took the Windows HDD out of that PC entirely. Much more peaceful. (Proton solves that particular issue these days also)

That being said, I've had at least two friends who had a dual boot due to my influence (pushing GNU/Linux) who ended up with some sort of broken Windows install later on and were happy to already have Ubuntu as an emergency backup to keep the machine usable.

*Too old might be a problem these days with major distros not having 32bit ISOs anymore


I went 100% bazzite back in April/May, no windows, and I couldn’t be happier. The pc I built is basically 90% gaming/movies/hanging with friends, 10% browser tasks. Very easy to live this life if you don’t have particular professional needs IMO. When I was doing more freelance editing this really would not have been an option as resolve studio does not work well on Linux.

WSL supports GUI apps now. They open up just like any other GUI app on Windows.

I've tried this once for IntelliJ to work around slow WSL access for Git repos. Was greeted by missing fonts and broken scaling on the intro screen. Oops. But probably I was just unlucky, it might work well for most.

1. Linux isn't a panacea for depreciated hardware, and it never will be.

2. If your priority is system lifespan, you are already using OEM macOS.


1. I dunno about a panacea, but it's pretty great for old hardware. My 2011 desktop still runs Alpine Linux just fine.

2. By all means start with macOS, but eventually Apple will stop supporting your machine. And y'know what will still work and get updates then? Linux.


> but it's pretty great for old hardware

Which old hardware? You're circling around to the grandparent's point again; Linux support is hardware dependent.

> And y'know what will still work and get updates then?

No, I don't. Depreciated iPads lay dead in piles, and they don't run Linux for shit. You want me to believe the M4 will graduate to the big leagues?


Never said it was “panacea for depreciated hardware.” I’m saying it’s a common use case.

Every thread about Linux inevitably someone says “it gave new life to my [older computer model].” We’ve all seen it countless times.



It's a common use-case for x86 machines that implement UEFI. Taking the iPhone and iPad into account, it is a nonexistent use-case for mobile ARM chipset owners.

I know you may have a particular axe to grind here, but Android devices are not a whole lot more likely to let you boot a vanilla linux distro. Apart from a handful of explicitly linux-compatible smartphones, the boot loaders tend to be pretty locked down, and the drivers all propietrary too

>taking the iPhone and iPad into account

This post is about the MacBook Air M2. The discussion has been about silicon MacBooks - laptops - from the start.


Apple does tons of optimizations for every component to improve battery life. Asahi Linux, which is reverse engineered, doesn't have the resources to figure out each of those tricks, especially for undocumented proprietary hardware, so it's a "death by a thousand cuts" as each of the various components is always drawing a couple of milliwatts more than on macOS.

It absolutely is not awful. You are doing something wrong then. It's not as good as on macOS of course but it's still great. I get 8-10 hours.

Exactly. This myth keeps being perpetuated, for some reason.

I'm typing this from a ThinkPad X1 Carbon Gen 13 running Void Linux, and UPower is reporting 99% battery with ~15h left. I do have TLP installed and running, which is supposed to help. Realistically, I won't get around 15h with my usage patterns, but I do get around 10-12 hours. It's a new laptop with a fresh battery, so that plays a big role as well.

This might not be as good as the battery life on a Macbook, but it's pretty acceptable to me. The upcoming Intel chips also promise to be more power efficient, which should help even more.


Eh it's pretty awful. I get 8 hours, yes, but in Linux, those 8 hours are ticking whether my laptop is sleeping in my bag or on my desk with the lid closed or I'm actively using it. 8 hours of active use is pretty good, but 8 hours in sleep is absolutely dreadful.

For optimal battery life you need to tweak the whole OS stack for the hardware. You need to make sure all the peripherals are set up right to go into the right idle states without causing user-visible latency on wake-up. (Note that often just one peripheral being out of tune here can mess up the whole system's power performance. Also the correct settings here depend on your software stack). You need to make sure that cpufreq and cpuidle governors work nicely with the particular foibles of your platform's CPUs. Ditto for the task scheduler. Then, ditto for a bunch of random userspace code (audio + rendering pipeline for example). The list goes on and on. This work gets done in Android and ChromeOS.

Asahi doesn't yet support all the CPU power states etc. This is a known limitation, not sure how easy it is to reverse engineer though.

This is the case with most (all?) laptops running Linux regardless of hardware unfortunately.

This doesn't match my experience. My previous three laptops (two AMD Lenovo Thinkpads, one Intel Sony VAIO) had essentially the same battery life running Linux as running Windows.

You're lucky, my thinkpad x13 gen 2 AMD gets 5 hours on modern Fedora vs. 9 or 10 on Windows.

I also have an X13 Gen2 AMD. My idle power consumption is 2.5W to 4W depending on brightness. This ends up in 12h-15h (machine/battery ist 2y old I think).

I think you can improve your power settings.


I have an AMD thinkpad and get maybe 1/4 the battery life on Linux as I do when I boot inti Windows, did you have to do any tweaking to achieve that?

I typically install and enable tlp [1], but that's it. Some distros/DEs might have it out of the box, but on Arch I had to do it myself.

[1] https://wiki.archlinux.org/title/TLP


TLP, as mentioned. Also powertop for more in-depth view of what's happening on power consumption front.

Does that mean that Windows's battery life suck equally on these devices?

I think MacOS was implied...

Have you ever put MacOS on a PC laptop? Terrible hardware support and the worst battery life of any OS.

I used to hackintosh every laptop I could get my hands on that could do it, and always saw better battery life on OS X vs. Windows.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: