As far as I can see, it seems that the current Asahi kernel does support M1 CPU idle states, although it seems that it needs a patch which won’t go upstream.
However, I put the system into sleep a few times, but I felt that it drains the battery more than what I expected (but, actually it is a while that I did not do this and don’t know exactly what was the numbers).
At the time, I didn’t check the feature support page and guessed that maybe it is not completely supported yet. But, now I have doubts. Is there any TODOs about sleep state, or it is considered to be optimal already?
P.S. Anyway, thanks to all who are involved, it is really a great experience considering the fact that there is no support from Apple.
There is plenty of improvement left in that area. The current sleep support is s2idle (“s0ix” is what they call it on Intel), which means the system really just stays idle during sleep. That is fine on platforms that have low-power modes like this one, but it relies on the rest of the runtime power management to reduce power consumption, and only part of that is currently implemented.
Once that’s all at least as good as macOS idle, we will look into implementing “real” suspend to RAM, though it’s not clear yet exactly how much benefit that will bring at that point. E.g. it could bring sleep battery lifetime from 1 week to 2 weeks (random guess), but for most people that wouldn’t matter that much at that point. Improvements in s2idle help both sleep and normal runtime power consumption, which is why we’re focusing on that first (and also because s2idle is easier and most of this PM stuff is a prerequisite for full sleep to work properly anyway, plus there may or may not be some significant complications to making full sleep work, since it has interesting interactions with security-relevant parts of the hardware).
One thing to keep in mind is that the relationship between power improvements and sleep battery life is inverse, which is counterintuitive. If we’re currently using 1W of power in sleep, a reduction of 0.5W would double your battery life, while a further reduction of 0.4W would make it 10 times longer than the original. This makes it kind of hard to predict exactly where the gains will come and by how much. I sort of suspect we still have at least one “stupid” power hog somewhere we haven’t found which will give us a nice boost when fixed, but it’s just a guess.
Once that’s all at least as good as macOS idle, we will look into implementing “real” suspend to RAM, though it’s not clear yet exactly how much benefit that will bring at that point. E.g. it could bring sleep battery lifetime from 1 week to 2 weeks (random guess), but for most people that wouldn’t matter that much at that point.
Out of curiosity, what would prevent “real” suspend on Asahi from reaching the ~30 days of sleep macOS provides?
Thanks a lot for the explanation, I’m happy to hear that.
I just put it into sleep yesterday for 5:30 hours, and battery charge drop from 80% to 63%, so if the rate is almost same it seems that currently it won’t even last for 2 days.
Anyway, thanks a lot! Hope I can offer to help in some areas in future.
Nothing. Those were just random numbers.
That has nothing to do with the issue at hand. The battery drain is due to the way sleep is implemented and missing runtime-pm components and other kernel-related issues, not software waking up the machine. It isn’t even possible for Linux to wake up in the background on Asahi right now. Articles about macOS almost never will be applicable to us in any way.