And it’s crap across the OSes. On Linux laptops don’t wake up from sleep, on Windows they keep waking up when nobody asks for it.

In our home office room there’s three laptops. My private one running Fedora, my work PC that sadly runs Windows and my wife’s laptop also running Windows.

My work laptop and my wife’s laptop keep waking up wasting electricity, and my private laptop needs a hard reset to wake it up every second time.

That feature should be stupid simple, yet it doesn’t work across the board.

Rant over.

  • iopq@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    2
    ·
    edit-2
    7 days ago

    My laptop uses 0.07w sleeping, draining about 1.8% of the battery per hour. I would say that’s acceptable with 32GB RAM s2idle

    Framework 16 on NixOS

  • athairmor@lemmy.world
    link
    fedilink
    English
    arrow-up
    39
    ·
    8 days ago

    And it’s crap across the OSes.

    Never had these problems with MacBooks. It’s probably one advantage of the OS and hardware being made by the same company.

    • d00phy@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      ·
      8 days ago

      Agreed. For all the downsides people point out with Mac’s, they handle this and battery life quite well. My daily driver is a Mac, and everything I connect to runs some flavor of Linux. Then there’s the Windows 11 thing my work foists upon me.

  • SheeEttin@lemmy.zip
    link
    fedilink
    English
    arrow-up
    27
    ·
    8 days ago

    The problem is it’s not stupid simple, it’s actually fairly complicated. Each piece of hardware and its driver must be suspended. The GPU is a particularly tricky one. Its processor must be suspended, and the state saved. In the kernel, the driver must suspend its execution, and likewise save its state. Then on resume, each half has to reload and begin execution again. And if there’s any mismatch in the resumed states, the GPU and/or driver crash and probably take the kernel with it.

    Now do that for the Wi-Fi, Bluetooth, sound card, USB, disk controller, and every other device.

  • diffusive@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    2
    ·
    8 days ago

    I researched this in (checking notes) 2009 or so… things may have slightly changed since (and my memory is fading away)

    At the time there was a standard for sleeping. Microsoft was part of the standard… and then they decided to implement in a different way (classic Microsoft, of course).

    Hardware producers then adjusted to windows because… well… we were dozens of us using Linux on laptops.

    This created issues in Linux because there were some purist developers that wanted to follow the standards, others that were more pragmatic and wanted to implement the windows way. In the end nothing worked.

    Fast forward to today, windows waking up constantly I guess it’s broken as expected because it wants to allow background processes to do stuff. Linux not waking up sounds still the issue from 2009: there are multiple levels of sleep and the deepest was the most problematic. If I have to guess your laptop wakes up just fine if the battery is full and you left closed for few minutes… while it doesn’t when the battery is low-ish and/or you left sleeping for a longer period

    • glimse@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      1
      ·
      8 days ago

      It’s waking up because another device on the network (probably router) is pinging it

      Disable “Wake on Magic Packet” and the Windows sleep issue goes away

      • diffusive@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 days ago

        This kind of stuff must happen at hardware level… wake on lan is in hardware.

        Ethernet cards keep in getting packets (arp at very least) even if they are not directed for them. If the OS needs to check all packages it would be always on

        That said… wake on lan is also a waste of energy if you don’t need (why powering the Ethernet cards?)

        • glimse@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 days ago

          The setting I am suggesting gets disabled keeps the card powered during sleep so Wake on LAN can work on a hardware level.

          The OS isn’t checking the packets. The NIC gets a packet and wakes up the OS.

          I am not defending it, just explaining how to stop it from happening. A lot of people who know what Wake On LAN is don’t know about Wake On Magic Packet

  • hardcoreufo@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 days ago

    I have an old Dell XPS 13 sleep works great on for Linux probably can sleep a week or two and still have charge left when I open the lid. I have a newer framework and it’s dead in 2 days while “sleeping.”

    • Baron von Fajita@infosec.pub
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 days ago

      Newer Dells have removed the s3 deep sleep. I believe the cutoff is between Intel 11th gen and 12th gen in (at least) Latitudes. I have a i7 12th gen that sucks at sleep, but an i5 8th gen that sleeps well.

  • chunes@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    7 days ago

    First thing I do on any OS, but especially linux, is turn off every sleep-related option permanently. I don’t care anymore. I won’t fight with it.

    • funkyfarmington@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      7 days ago

      In 35 years of experience I’ve never got it to work correctly on any OS except IOS. I’ve only met ONE tech who claimed it worked for them, and that was in the 2000’s. He couldn’t demonstrate how exactly.

      I do the same thing, turn that shit off because it does not work.

    • zalgotext@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      ·
      7 days ago

      Yeah I don’t bother with sleep either, I just turn all my stuff off when I’m done with it. With the advent of SSDs and M.2 drives, it takes about 10 seconds for my desktop to boot from fully powered off. I can wait that long lol

      • flexacarn@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        Trouble is you’ve then got to re-open all of your apps again. As a developer I have about 10 different things open (including zellij sessions and panes). I’ve started just leaving my computer on 24/7. How much does it cost me per month? Better not think about it!

  • Treczoks@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    edit-2
    7 days ago

    wakes up when nobody asks for it.

    Wrong. You might not have asked for it, but it is not your computer, it’s Windows’ computer. Microsoft decides when it wakes up.

  • GreenKnight23@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    2
    ·
    edit-2
    7 days ago

    my guess is because the CPU power levels are fucking trashed because of all the patches they have to run at runtime. before Intel went all “wild west” with their security practices to improve performance, sleep worked just fine for me.

    keep in mind, this was before uefi too, so it might also have a hand in the problems.

  • BrightCandle@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    8 days ago

    In my case its because Sony messed up the bios in more ways than one and refuses to correct the problems. They work around it with their own drivers witin Windows and leave it like that, but it also breaks Linux functionality as a result.

  • Chloé 🥕@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 days ago

    weirdly i have the windows problem on linux with my laptop: never have I had it not wake from sleep, but sometimes it starts overheating while on sleep and drains the battery super quick

    many times ive put my laptop on sleep in my pouch, taken it out and hear the fans blasting, the laptop is burning hot and the battery lost 40% in 20 minutes

  • illusionist@lemmy.zip
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    2
    ·
    edit-2
    7 days ago

    Never had I problems with sleep. Neither with arch, suse, fedora nor ubuntu. Neither with Gnome nor with kde.

    Not even with windows.

    Must be the hardware (brand).

  • AllHailTheSheep@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    8 days ago

    ACPI is weird and sometimes hardware dependent, so it’s really hard to support it on every device. that’s my current understanding at least.