In 8 hours it uses 20% of the battery. When Windows or Mac are put to sleep, the damn things can sleep for a week! This is the case with Linux on multiple laptops.

Is there some kind of manipulation going by ring -1 that detects Linux is running? Is Linux not respecting some procedure and kissing a step?

  • the_riviera_kid@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 hours ago

    From what I heard, the sleep mode on the steam deck is just the default linux sleep mode. It works almost flawlessly.

    I don’t think it’s quite true though because I can leave it in sleep mode for days and it just fires back up where it left off with almost no noticeable battery drain. If I put my desktop pc to sleep (bazzite) it acts like a stroke victim. IF it manages to wake up. Usually it just has to be restarted so I don’t waste my time and just shut it down now.

  • Safeguard@beehaw.org
    link
    fedilink
    arrow-up
    5
    ·
    14 hours ago

    I use CachyOS and enabled some serious battery saving techniques:

    s2idle (although stupid name) is the best option. And also install all the tlp stuff.

    Those things together made my machine incredible. (X13 gen3 and a P15 Gen1)

  • Linda R@nord.pub
    link
    fedilink
    suomi
    arrow-up
    22
    ·
    1 day ago

    On my Linux computer I just close the laptop’s lid and it goes to sleep, consuming almost no battery power. I can open it hours later and have basically the same amount of battery left as before.

    But some laptop manufacturers have proprietary systems in place for the sleep mode that are not supported in Linux because it would be a gargantuan effort when the laptop manufacturer refuses to coöperate.

      • stormeuh@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        14 hours ago

        Laptops with AMD chips are not necessarily better in this regard.

        From my anecdotal experience with an HP laptop (from work), with an AMD 7840HS, the blame is often also with the system integrator. That one has a bug in the power management system, where if you plug the charger in during sleep, the power state gets locked to some very low power sleep mode, until you either reboot, or plug the charger in while it’s not asleep.

        HP doesn’t want to look at this because they don’t support Linux, meanwhile AMD kernel devs claim that this is probably a BMC bug so they can’t fix it. Whatever the real culprit is in my case, the BMC can do so much these days that it wouldn’t surprise me if a lot of sleep issues are due to bad firmware.

        Either way, system integrators like HP refusing to support Linux is in part what allows Intel and AMD to ignore a lot of Linux-specific bugs. SIs have a lot of manpower to help diagnose and fix them, and they have leverage when reporting bugs to CPU manufacturers.

  • teawrecks@sopuli.xyz
    link
    fedilink
    arrow-up
    23
    ·
    1 day ago

    Worth noting that this is also an ongoing issue with windows. Only apple has actually solved this, and they do so by owning the whole stack. Each apple product has a specific OS, CPU, and motherboard that were all specifically designed with the end-product user-experience in mind.

    But for PCs, the OS, CPU, and motherboard are all designed and built by different companies, each only designed to be generically compatible with the other components. None of them are designed for a specific end-product, so features that require all of the components to play perfectly together for a specific end-user experience (like sleep state) often end up not quite aligning.

    None of this helps you, but I think it’s worth understanding why the problem exists and why it may just always exist. The best bet is that companies like System76 or Valve solve sleep states for specific linux-based products, and then the rest of us maybe hopefully see some benefit from that.

    But IMO this is just a trade-off. It’s like a pick 2 situation between Customization, Stability, and Privacy (where a reliabile sleep state is Stability). You can have stability and customization, but you’ll probably pay a lot, and the company who sold it will want telemetry data to improve the experience for others. You can have stability and privacy, but the product will be very locked down to a specific use case to ensure a stable experience.

    • green_link@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      7 hours ago

      It’s not that apple solved it, it’s that Microsoft purposely fucked it up.

      It’s called “modern standby” and if you put your laptop to sleep while it is plugged into power, some windows services and wifi aren’t actually put to sleep, and instead will ping windows update servers to download and install some updates while the machine is “asleep”.

      Even if and when you put the laptop to sleep while plugged into power and then remove power to say out the laptop in your bag. Those services that aren’t put to sleep never check to see if you are still on wall power or battery and keep doing what they do draining the battery

      Linus tech tips on YouTube did a whole deep dive into it. Some laptops you can disable modern standby through the command prompt but newer hardware doesn’t allow for it. The only real workaround is unplug your laptop for a few seconds before putting it to sleep.

      • teawrecks@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        5 hours ago

        As I understand it, apple products support the same update from sleep feature, except it works for all the reasons stated above.

    • zqps@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      8 hours ago

      Components like CPUs and mainboards are absolutely purpose-built for laptops. And precisely this has caused a host of issues from locked-down BIOS/UEFI to broken sleep to incompatibility with real-time audio processing via ASIO, and that’s just the ones I have personally experienced.

      The real issue here is an outdated x86 architecture that was never designed for efficiency, which is severely struggling to compete with Apple’s ARM-based M architecture, but which they can’t get rid of for compatibility reasons.

  • hexagonwin@lemmy.today
    link
    fedilink
    arrow-up
    7
    ·
    23 hours ago

    i use a kaby lake (7th gen intel i5) laptop, and sleep works well on all linux, freebsd, windows. i’m using s3 sleep, are you on a newer machine that only supports s0ix?

      • hexagonwin@lemmy.today
        link
        fedilink
        arrow-up
        3
        ·
        15 hours ago

        yeah, i think they started getting rid of s3 in favor of s0ix since 11th? 12th? gen. heard it’s shitty. :(

  • moth@anarchist.nexus
    link
    fedilink
    English
    arrow-up
    23
    ·
    1 day ago

    moth doesn’t know what CPU you use, but newer AMD chips don’t support S3. AMD removed that because they think modern suspend is better, an opinion that doesn’t seem to be shared by the consumers.

    • Jesus_666@lemmy.world
      link
      fedilink
      English
      arrow-up
      71
      ·
      2 days ago

      It also doesn’t help that ACPI is a badly-designed mess of a standard. I remember that in the 2010s one of Apple’s selling points was that their laptops had sleep and hibernation that worked every time. Heck, MacOS X could even decide intelligently when to do which. This mostly worked because they fully controlled the hardware, firmware, and software. Other laptop manufacturers could just take their best stab at implementing ACPI power states and hope their implementation matched Microsoft’s.

      Microsoft tried to solve the mess by introducing the S0ix ACPI state (aka “Modern Standby”), which was defined in a way that could actually be implemented without too much guesswork. Unfortunately, this was during the Windows 8 era when Microsoft decided that laptops should be more like smartphones so S0ix is much closer to turning your screen off on a phone than to actual standby.

      The system randomly waking up and deciding to do work is an explicitly intended feature because what if you get a Teams message while your laptop is in your bag? Sure, you might say that you’d either have Teams on your phone or wouldn’t immediately care but that kind of thinking won’t get you anywhere within Microsoft. Also, Windows actually has very little restraint about what it does when it wakes up so it might decide to install a heavy update or an application might decide it’s important enough to do work right now. While the laptop is in your bag. Cue you wondering if the laptop turned off because the battery’s empty or because it overheated.

      And to make things worse Microsoft specified that in order to be allowed to use Modern Standby, the device must not offer S3 (sleep/suspend-to-ram). Some manufacturers still allow you to enable S3 but it’s a legacy feature that’s even less well supported than before.

      • Ghoelian@piefed.social
        link
        fedilink
        English
        arrow-up
        21
        ·
        1 day ago

        The system randomly waking up and deciding to do work

        My work macbook did this by default as well, among other dumb things like leaving bluetooth enabled on sleep so my headphones would constantly connect to the laptop when on the train trying to listen to music.

        Thankfully the waking up thing is just a setting, but by default, imho, mac os’s sleep is also garbage.

        • prole@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          5
          ·
          1 day ago

          I’ve got Sony Bluetooth earbuds a few years back and I guess they have something called “multipoint” where they can connect to multiple devices at once. I had to Google why anyone would want that, but I guess it’s to make switching between devices faster.

          Sometimes I’ll be walking down the sidewalk with my earbuds in, connected to the phone in my pocket, and they’ll just randomly make the sound it makes when connecting or disconnecting. Like I’m connecting to the BT of a random house or business I walked past that I never explicitly paired with.

          I can’t exactly put my finger on why, but I find it very unsettling every single time and wish I could turn that feature off.

          • deffard@lemmy.world
            link
            fedilink
            English
            arrow-up
            4
            ·
            15 hours ago

            I could not work out why my Sony headphones were giving me a ding sound and then my listening was interrupted with ambient noises. I assumed Bluetooth connection requests at first, but for me it was the “speak to chat” feature that can be disabled.

            • prole@lemmy.blahaj.zone
              link
              fedilink
              arrow-up
              1
              ·
              6 hours ago

              Huh that’s interesting… I don’t think anyone around me was speaking at the time however.

              But if it happens again I’ll keep that possibility in mind.

    • psycotica0@lemmy.ca
      link
      fedilink
      arrow-up
      5
      ·
      1 day ago

      This is the one I was going to link.

      I have my laptop in s2idle mem_sleep most of the time because this boots quick and allows me to wake the computer by pressing a key on my USB keyboard plugged into a hub plugged into my dock into my laptop.

      And it gets from my office and back just fine on that. But if I’m traveling or something I’ll switch it to deep mode before I leave so it actually actually goes to sleep in my bag.

      It takes extra time and jank to boot, and I have to wake it up by opening the lid, but if I’m traveling that’s normal since I don’t travel with my dock or USB keyboard anyway.

      This is one of those cases where it would be nice if the tech always did what I wanted, but I do actually want different things at different times, and so I do actually benefit from the control of being able to choose.

      My hardware doesn’t support “shallow” sleep, for whatever reason.

      • dustyData@lemmy.world
        link
        fedilink
        arrow-up
        9
        ·
        1 day ago

        The reason is, as usual, that Microsoft lobbied hard to make their way the standard way of doing sleep modes. Then, when implementing it, they strong armed all the OEM to make hardware fit their nonstandard, slightly off center, way.

        So, now windows kind of work with all hardware, but open source is fucked because to make the hardware actually work requires reverse engineering whatever custom crap windows does.

        • The_Decryptor@aussie.zone
          link
          fedilink
          English
          arrow-up
          6
          ·
          1 day ago

          The sleep stuff is part of the ACPI standard, it’s all documented.

          It’s up to the motherboard/SoC to support it properly, and Microsoft has an “entire system view” of how Windows works and can integrate it deeply. Compare that to Linux, the companies involved mostly care about servers, and the distros are assembled by disparate groups that don’t have the hardware testing capability that MS or OEMs have.

    • asdfasdfasdf@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      Is that true for Mac and Windows too? Why do I need to differentiate the two on Linux but not the others? Why isn’t the default the better one?

      • MouldyCat@feddit.uk
        link
        fedilink
        arrow-up
        11
        ·
        1 day ago

        suspend to RAM (aka sleep) means the computer stays powered on in a very low-power state. Everything in memory is kept as-is, and it consequently draws a little power to keep the RAM active. This makes it very quick to enter this state and to wake up from it.

        suspend to disk (aka hibernate) dumps the RAM to disk, and then powers down fully. It takes a little while to dump all RAM to disk and also to restore it.

        So “the better one” depends on what works best for your particular circumstances. If you don’t know and want a big corporate entity to make those decisions for you, stick with Microsoft and Apple products. If you would rather take the time to find out what’s best for you, then go FOSS.

        • Viceversa@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          1 day ago

          “big corporate entity’s decision” sounds very valid for laptop hibernation.

          It would be nice for Linux to have the same as the default

      • WolfLink@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        It’s something to hassle with on Windows too. Less so on macOS because it’s easier for them to optimize everything when they control the whole software and hardware stack.

  • Taasz/Woof@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    27
    ·
    1 day ago

    No idea if this applies to a lot of laptops, but on my HP with an i5-8350U every Linux distro I’ve tried seems to come configured using s2idle instead of deep sleep, and battery will drain very quickly even in ‘sleep’ mode.

    If running cat /sys/power/mem_sleep returns “[s2idle] deep” then you can add mem_sleep_default=deep to your kernel args and it will actually go to sleep properly.

    On Fedora this was sudo grubby --update-kernel=ALL --args="mem_sleep_default=deep" but it varies by distro.

    Why it seems like every distro I’ve used has this set incorrectly I do not know, it’s baffling.

    • onlinepersona@programming.devOP
      link
      fedilink
      arrow-up
      7
      ·
      1 day ago

      Interesting. “s2Idle” sounds like it’s idling and wasting cycles when it’s supposed to be sleeping. I’ll try those commands.

      Also perplexing to me that idle is chosen as a default.

      • Dultas@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        15 hours ago

        Some modern laptops only have s2idle which is garbage. I had to re-enabling hibernate on mine and just use that instead of sleep now.

      • Taasz/Woof@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        21 hours ago

        I did some searching and it sounds like it just wakes up slightly faster, but even in deep sleep it’s still very fast.

  • LeTak@feddit.org
    link
    fedilink
    arrow-up
    103
    ·
    2 days ago

    Your system goes to sleep and wakes up? My system goes to sleep and then crashes. We are not the same

    • DrPop@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      23 hours ago

      My system goes to sleep and won’t wake up. Can’t figure out why. I just turned off the ability to sleep and turn my computer off when not in use.

      • LeTak@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        16 hours ago

        This is the magic of modernACPI Power States. Normally you would write everything to swap or keep the RAM powered. Nowadays we need always on (W)LAN and event management for updates , notifications and whatever. And if I don’t want that? Where is my Setting for Hibernstion Lenovo!!!

        • the_riviera_kid@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          4 hours ago

          Assuming you have windows, run this in admin powershell It should give you power options you didn’t even know existed.

          Apparently the formatting gets all screwed up with the default UI and I am too stupid to figure out how to fix it.

          Its appears properly if you use old.lemmy.world though.

          Copy and paste everything below this line .-------------------------.

          $sting77 = “HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings” $querylist = reg query $sting77 foreach ($regfolder in $querylist){ $querylist2 = reg query $regfolder

          foreach($2ndfolder in $querylist2){
          
          $active2 = $2ndfolder -replace "HKEY_LOCAL_MACHINE" , "HKLM:"
          Get-ItemProperty -Path $active2
          Set-ItemProperty -Path "$active2" -Name "Attributes" -Value '2'
          }
          
          $active = $regfolder -replace "HKEY_LOCAL_MACHINE" , "HKLM:"
          Get-ItemProperty -Path $active
          Set-ItemProperty -Path "$active" -Name "Attributes" -Value '2'
          

          }

    • Technotica@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      Mine too! Well one of mine, and I still don’t know why just this one. But hey, it’s not like Linux cares if it is crashing, it always comes back.

  • artyom@piefed.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    Windows definitely has lot of sleep issues. But yes Linux seems to be as bad or maybe a bit worse. I once shut down my Linux laptop and left it connected to power on my vehicle. When I returned, my vehicle was completely dead 😮‍💨

  • borokov@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    1 day ago

    When I put windows to sleep it just wake up in middle of the night to install whatever update, restart and slowly empty it battery until it die.

    • lemming741@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 hours ago

      I’ve found on my corpo dell-
      Disable wifi
      Sleep from start menu
      Wait until fan stops spinning
      Close lid

      I find my laptop suffocating itself in my bag every single time i don’t. This way, it only does that 1 in 10 times.

  • Maestro@fedia.io
    link
    fedilink
    arrow-up
    51
    ·
    2 days ago

    Windows doesn’t sleep. Ever. Sleep is now just a nickname for Modern Standby, which is just running in low power mode doing a whole bunch of shit. The amount of times I come back to my laptop and it has gotten stuck at a reboot is just embarrassing. I dual-boot and have Grub, so whenever Windows tries to reboot itself it gets stuck.

    People have gotten their laptops damaged because they thought they were sleeping and put them in a bag, when Windows decides to try to update itself while the fans are blocked inside the bad. Bam, heat damage.

    • hendrik@palaver.p3x.de
      link
      fedilink
      English
      arrow-up
      13
      ·
      2 days ago

      Shouldn’t modern laptops have temperature sensors and just deal with it in some way? I had this happen to me a few times with my old Thinkpad from 12 years ago. Threw it into the backpack in a rush and an hour later I’d pull it out, hot and doing something I didn’t want it to do… But it never suffered any kind of damage from that. Was just very annoying.

        • hendrik@palaver.p3x.de
          link
          fedilink
          English
          arrow-up
          9
          ·
          2 days ago

          Sure 😆 In the meantime I found a solution for all the Windows Update debacle. Bought a newer laptop, went home and just wiped the entire SSD before installing Linux. Now I don’t get any dual-boot or Windows update. Also goes to standby 100% of the time. ¯_(ツ)_/¯

        • dbdr@nord.pub
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 day ago

          I would expect overheating protection to occur at the hardware level: first downclock the CPU and forcibly just halt if heat gets critical for too long.

          • Ghoelian@piefed.social
            link
            fedilink
            English
            arrow-up
            8
            ·
            edit-2
            1 day ago

            Sure but the update can already have done some stuff, leaving your machine in a half-updated and maybe corrupted state. If downclocking doesn’t work there really isn’t a good solution here.

            Edit: oh wait there is, DON’T UPDATE WHEN SLEEPING. And on top of that, just don’t update without my explicit approval at all. Thankfully I run linux where, if it’s not the default already, it’s a config value away.

      • selokichtli@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Also, the failure gets registered forever, for example, in RAID disks you’ll never get a 100% healthy disk with such situation.