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?

    • Jesus_666@lemmy.world
      link
      fedilink
      English
      arrow-up
      38
      ·
      11 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.

    • psycotica0@lemmy.ca
      link
      fedilink
      arrow-up
      4
      ·
      11 days 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
        6
        ·
        11 days 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.

    • asdfasdfasdf@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 days 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?

      • WolfLink@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        11 days 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.

  • LeTak@feddit.org
    link
    fedilink
    arrow-up
    57
    arrow-down
    1
    ·
    11 days ago

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

    • Technotica@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      11 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.

    • DrPop@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      10 days 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
        ·
        10 days 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
          10 days 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'
          

          }

  • JasonDJ@lemmy.zip
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    1
    ·
    11 days ago

    I’ve only used windows at work in the past 10 years or so but my windows experience with sleep was far far worse.

    My laptop would always wake up in my bag on my hour+ commute. The laptop would be scorching hot and the battery dead by the time I got to the office. Every time.

    Never experienced that in Linux.

    Recently I switched to a Linux computer at work and it’s much better in every regard.

    My personal desktop (runs arch (btw)), did have some trouble with sleep recently tho…I replaced my 5700G with a 5600X3D and it would refuse to wake from sleep, necessitating a hard shutdown (by PSU switch!)…but I think that was a bios bug. My bios was already very close to latest but I think upgrading that was what ultimately fixed it. Now it works fine.

    • Zacpod@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      11 days ago

      Every piece of shit windows laptop since they flipped from S3 sleep to “modem standby.” garbage. Thing wakes up in the bag at the slightest whiff of wifi. “Oh! Network! Want me to connect so I can install updates, delete all your pinned tabs, break a few apps, and infect notepad with AI slop vulnerabilities? No answer? That must mean you want that - doing it now, boss!” <melts in bag>

      Dell, Lenovo, and Surface laptops all do the same shit. I fucking hate windows.

      Dell support even told me, with a straight face, that if I didn’t fully shut down my laptop before putting in my bag that I’d void the warranty.

      • onlinepersona@programming.devOP
        link
        fedilink
        arrow-up
        5
        ·
        11 days ago

        Dell support even told me, with a straight face, that if I didn’t fully shut down my laptop before putting in my bag that I’d void the warranty.

        That’s insane, what the fuck? BTW, the owner of Dell is a right-wing dude who supports DHH. I’m not surprised they they have such shitty customer service.

        • Zacpod@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          11 days ago

          Yup. That was the last XPS I owned. Not that Lenovo is much better, morally, but their Linux support is WAY better. Should have got a framework. Next cycle.

    • whatstatersprecious@lemmy.world
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      11 days ago

      I’ve always had this Windows issue you described with ThinkPads. Never had a problem with Dells though. Drives me absolutely crazy

  • Baggie@lemmy.zip
    link
    fedilink
    arrow-up
    11
    ·
    11 days ago

    I once did a deep dive on sleep mode for some problem a friend was having. I’m now convinced it might be the worst thing I’ve ever seen in modern computing. It’s globally horrendous, poorly implemented, and causes random problems in unfathomable places. It’s amazing it ever works at all.

  • LeTak@feddit.org
    link
    fedilink
    arrow-up
    10
    ·
    11 days ago

    I just want the option to put my Linux laptop into S3 ACPI power State. Daim you modern W11 hardware and S0!!!

  • borokov@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    11 days 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
      ·
      10 days 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.

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    7
    ·
    11 days ago

    When Windows or Mac are put to sleep, the damn things can sleep for a week!

    When I put my Windows work laptop to sleep, it damn well can sleep for a week. In fact, it sleeps so well that you could fell a tree next to it and it still wouldn’t wake up.

    They should really rename that button to “coma”. “Sleep” implies you can wake it up.

  • parsimon@programming.dev
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    11 days ago

    I recommend using hibernate (suspend to disk): your computer will “sleep” for 10 years without draining. The only cost is about 7 seconds to boot on modern hardware. For short interruptions with instant wakeup, you can still use light sleep states.

    It combines perfectly with LUKS-encrypted root and swap partitions: your data is safe even if someone steals your computer and swakes it up.

    • Quailman@lemmy.world
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      11 days ago

      Hibernate doesn’t work with secure boot/kernel lockdown for $REASONS, a lot of folks can’t even use it. Supposedly if Linux can determine you’re resuming from an encrypted partition it will work, but I was never able to get it to work with a swap file on BTRFS on LUKS

      • deffard@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 days ago

        There’s only so much that can be done on the hardware/ firmware side, but his for me is the real gap that Linux can improve upon. Hibernate, disk encryption and secure boot/tpm unlock together have just worked for a long time on Mac and Windows.

        The kernel decisions seem hostile and hard code a big assumption that it’s always unsecure to restore from hibernate automatically. What’s more insecure is having to disable disk encryption entirely. Secure boot is often misunderstood, but for all its flaws it is better than nothing, and your average user does not want to manually enter a decryption key on top of their user login all the time.

        Because of this I feel a lot of software is not written and tested with hibernate in mind, so you also roll the dice on what works and what doesn’t when restoring today.

        Sleep for 1 hour and then auto hibernate after, in a working setup, meant this problem was solved - always enough battery to resume doing work, no user decision required, quick wake up if resuming a recent session.

        I’d love to see multi-user switch selectively suspending user processes and writing them to disk, so you can quickly restore state between users, and if one user left a browser or game running it’s not draining the battery on what are now known background tasks. No OS does this one well today.

      • parsimon@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 days ago

        True, kernel developers should resolve the Secure Boot issue with hibernation, but the development focus is on servers, not laptop computers. Also, hibernation should probably use a dedicated hibernate image file instead of requiring a huge swap partition. That being said, it works regardless of hardware capabilities if you turn off secure boot and just configure a LUKS-encrypted SWAP partition. You should figure this out before you install the OS.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      11 days ago

      Unfortunately, hibernate does not work on all devices. I believe, it depends on the motherboard and BIOS…

    • onlinepersona@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      11 days ago

      Hibernate with an encrypted swap and systemd boot takes forever for me. How do you manage in 7 seconds? How much RAM do you have?

  • majster@lemmy.zip
    link
    fedilink
    arrow-up
    5
    ·
    11 days ago

    Windows has same problems. Its hot bag syndrome. Issue lies at hardware and firmware level. FYI my T480 configured for deep sleep looses only 1% per day sleeping.

    I didn’t configure hybernation though.

  • the_riviera_kid@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    10 days 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
    3
    ·
    edit-2
    8 days 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)