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?

  • Die4Ever@retrolemmy.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    28 days ago

    Kubuntu on my laptop sleeps really well, I can leave it in my backpack for days and it will lose less than 10%, better than when it was running Windows

  • majster@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    28 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.

  • parsimon@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    28 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.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      28 days ago

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

    • rockerface🇺🇦@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      0
      ·
      28 days ago

      I’ve found full shutdown and subsequent boot up on my current Bazzite setup takes less time then hibernate used to in Windows 10 on the same PC. Haven’t even felt the need to look into setting up swap (Bazzite uses zram by default).

      • MouldyCat@feddit.uk
        link
        fedilink
        arrow-up
        0
        ·
        28 days ago

        full shutdown and subsequent boot up on my current Bazzite setup takes less time than hibernate

        maybe, but a full shutdown and reboot does not restore all your apps, open documents, terminals etc exactly as they were.

    • Quailman@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      28 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

      • parsimon@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        28 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.

    • onlinepersona@programming.devOP
      link
      fedilink
      arrow-up
      0
      ·
      28 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?

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    28 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.

  • JasonDJ@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    28 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
      0
      ·
      28 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
        0
        ·
        28 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.

  • the_riviera_kid@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    27 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
    0
    ·
    27 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)

  • hexagonwin@lemmy.today
    link
    fedilink
    arrow-up
    0
    ·
    28 days 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
        0
        ·
        27 days ago

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

  • artyom@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    28 days 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 😮‍💨

  • Linda R@nord.pub
    link
    fedilink
    suomi
    arrow-up
    0
    ·
    28 days 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
        0
        ·
        27 days 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
    0
    ·
    28 days 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.

    • zqps@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      27 days 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.

    • green_link@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      27 days 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
        0
        ·
        27 days ago

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

        • green_link@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          26 days ago

          I’m pretty sure all Microsoft needed to do was put in a check to see if it was running on battery or not. And I remember seeing that they finally fixed it months ago.

          Modern windows is bogged down by decades old compatibility architecture. Shit programed in the 80s will still run on modern windows for the most part. All because corporations and businesses still run those programs or severs today and refuse to update or replace them. Look at the fucking US aviation industry. Billions of dollars in revenue and still run windows 95 level shit programs.

          Microsoft needs to pull an apple and rebuild windows from the ground up without any compatibility layers. Enough is enough.

  • Taasz/Woof@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    28 days 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
      0
      ·
      28 days 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
        0
        ·
        27 days 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.