Basically every laptop I’ve owned I’ve had to disable sleep when the lid is closed as I often leave them plugged in and want background tasks like downloads or updates to be able to run while I’m not using the machine. However, I don’t think PC laptops have a way to switch to a super low power state and just run background tasks like downloads, alarms and notifications or running scheduled tasks without just being left on in regular power mode. Why is this not just a default feature of laptops, given that phones and tablets have been doing this kind of thing for the last decade or more?

Does anyone know if there are plans to make power management for laptops allow for running certain tasks in Windows or Linux in the future? My smug Apple using friend tells me his Macbook already does this, but is the lack of this feature on PCs software related or something innate to x86 vs ARM architecture?

  • d3Xt3r@lemmy.nz
    link
    fedilink
    arrow-up
    164
    ·
    edit-2
    1 year ago

    Why don’t laptops have proper low power states

    Actually, they do, it’s called the “S0” low power state, and it’s part of the ACPI standard. Microsoft calls this “Modern Standby” in Windows (and “suspend to idle” in Linux) , and it’s pitched to do exactly what you’ve described.

    The only problem is, the implementation sucks. Most users actually hate the S0 state because it consumes so much power - on some laptops, even the fans may continue to run on S0, and your laptop may overheat if you’ve closed the lid and chucked it in a bag, and it’s in the S0 state.

    Also, because Microsoft and Intel have been pushing this so much, the “standby” mode now defaults to S0 instead of S3 (which is full suspend-to-RAM). So many users actually actively seek to disable S0 and go back to proper S3 standby, via registry hacks etc.

    So why is S0 so bad? Part of this is due to the limitations, long history and the variable nature of the x86 platform. All the power-saving stuff was implemented as an after-thought - both at the hardware and software levels. Whereas ARM, at least the modern ARM ecosystem, was developed with mobile usage and power saving from ground up. An x86 PC is also made up of components from disjointed manufacturers, and we need all those components to implement the same standards so that it all works well as expected. So for instance, if a particular component isn’t capable of entering a low-power or active standby state, then it won’t - and you can’t do much about that, unless you’re Apple and have a tight control over the ecosystem.

    The second half of the problem comes with the software. All applications must be modern standby / S0 aware, if not, one of two things will happen: that app will keep the system awake, or the app will get suspended by the Desktop Activity Moderator (DAM). Either way, the app must be capable of running in the DRIPS phase (deepest idle runtime platform state), which rules out most Win32 apps (basically almost every app that’s not on the Microsoft Store).

    Finally, the reality is that most PC users don’t care about modern standby regardless - and why should they, when they’ve all got smartphones, which handles notifications well? Also, hardly anyone does large file downloads these days, and the people who do still download, wouldn’t care about doing it while on battery (and if they do, they can take manual actions to lower the power consumption, such as switching to a power saving plan and turning off the display etc).

    Ultimately, most people would expect a laptop to go into a fully suspended state when the lid so closed and they’re on battery, because if they’re on battery the #1 concern for them would be the battery life. So most people actively seek to disable S0 and see it as a hindrance.

    • MrFlamey@lemmy.worldOP
      link
      fedilink
      arrow-up
      16
      arrow-down
      1
      ·
      1 year ago

      Thanks for the excellent response.

      I wonder if Valve will try to implement it in Steam OS for the Steam Deck’s successor, as a lot of people complained about the lack of downloading while asleep after the Deck was launched. It would still need cooperation in hardware I assume, but they were able to get resuming games working, so it doesn’t seem like an insurmountable problem if there is enough desire from both gamers and Valve.

      • Vash63@lemmy.world
        link
        fedilink
        arrow-up
        13
        ·
        1 year ago

        I don’t think this would need to wait for a successor. The problems are software, not hardware. They would need to have games and SteamUI get suspended but leave other processes running, might be tricky and prone to bugs.

        • NeoNachtwaechter@lemmy.world
          link
          fedilink
          arrow-up
          6
          arrow-down
          2
          ·
          1 year ago

          The problems are software, not hardware.

          Of course hardware is part of the problem too.

          PC architecture does not allow, for example, that the network interface may feed any data directly to the harddisk. Every bit and byte must be input to the CPU and then output from there.

          Otherwise we could allow the CPU some real good sleep while other devices remain a little active.

          • bigdog_00@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            1 year ago

            Isn’t this the idea of having a chipset (Northbridge/Southbridge) on the board, to handle some of these IO tasks?

            Also, I recently saw the Cathode Ray Dude video on Dell’s Brain Slug, where down basically hijacked the system with a low-power ARM SBC. I almost wonder if something like this would be possible, it would obviously require a revision but it would theoretically allow for suspended downloads, invite notifications, etc. It would also be fairly expensive and complex though

            • NeoNachtwaechter@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              1 year ago

              Isn’t this the idea of having a chipset (Northbridge/Southbridge) on the board, to handle some of these IO tasks?

              Well, not in the way we are talking here. The bridges work under the CPU’s direct commands. When the CPU goes to sleep, they have nothing to do either.

              Maybe a PC’s CPU can do some short time limited sleep like microcontrollers do, and maybe that would be useful for such scenario’s. But even then the main problem remains that the CPU wants to be in control of everything.

    • qupada@kbin.social
      link
      fedilink
      arrow-up
      11
      ·
      1 year ago

      and the people who do still download, wouldn’t care about doing it while on battery

      Very much this; I’ve got a whole army of machines I can SSH into to launch a long-running download, which frequently additionaly cuts out a 2nd step of copying the file to where it needs to be after downloading it (a action which would normally cause additional battery usage on the laptop).

      And I thoroughly agree with you; I want the laptop to go to S3 sleep immediately when I shut the lid, and then pull it out of my bag a hours later with only a couple of percent of the battery consumed in the interim.

    • fiat_lux@kbin.social
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      Thankyou for answering some historical mysteries for me. It has always irritated me that I didn’t know why programs only sometimes drained battery while asleep - but it wasn’t always like that, and I couldn’t find a pattern in what programs affected it, and I didn’t know why a Linux dual-boot on the same drive didn’t cause the same issue. The backstory of this makes a whole lot of experiences make sense now.

      What is involved in an app being S0 aware and running on DRIPS? Is this a badly-educated-developers-requiring-permanent-network-connections issue or a Microsoft-proprietary-certificate-bullshit thing or something completely different? I’m mostly curious for if I ever dive into desktop application development what performance optimisations I should be keeping in the back of my mind.

      • d3Xt3r@lemmy.nz
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 year ago

        I haven’t developed a desktop app in ages so I’m probably not the best person to ask this, but my understanding is that if you develop a modern UWP app, then it’s automatically S0 aware, but you can also make use of WinRT APIs to execute background tasks during modern standby. The user can also choose whether or not to allow this activity.

        I’m not sure if the WinRT APIs can be called from a regular Win32 app though. For Win32 apps, as far as I’m aware, they should get suspended by the DAM automatically (and background services may get throttled), but Windows may choose to unsuspend/unthrottle these apps if it thinks some critical activities are happening. I never looked into what it deems as a “critical activity”. Personally though I always disable S0 so that my laptop suspends as you’d expect it to.

        Bottomline is, if you’re making a UWP app it should all just automatically work, maybe look into the WinRT APIs, and if you’re making a Win32 app you need to look more into the DAM. There’s some info on that here: https://learn.microsoft.com/en-us/windows/win32/w8cookbook/desktop-activity-moderator

        • fiat_lux@kbin.social
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          Thanks so much, this is extremely helpful. I’ve been separate from the entire Windows ecosystem for a long while, so a high level overview like this is perfect. I now have all the acronyms and names I need to research further instead of trying to figure out what acronym is responsible for what, which is always the most tedious part.

  • Blizzard@lemmy.zip
    link
    fedilink
    English
    arrow-up
    48
    arrow-down
    2
    ·
    1 year ago

    Why don’t laptops have proper low power states where useful stuff like downloads can run during sleep/with the lid closed?

    Wow, this is the exact opposite of what I want. If I tell it to sleep, it’s supposed to sleep, not run, download and install anything. If you want it to do that, you can set it to not go to sleep when you close the lid. What are you worried about exactly? Electricity bill because of a laptop?

    • jet@hackertalks.com
      link
      fedilink
      English
      arrow-up
      40
      arrow-down
      1
      ·
      1 year ago

      The number of times I’ve pulled a laptop out of the bag, that is secretly been running, and burning itself out, draining the battery, maybe starting a fire. I never went that to happen again. Closed means closed off means off. Don’t fuck with me just be off

    • MrFlamey@lemmy.worldOP
      link
      fedilink
      arrow-up
      6
      arrow-down
      5
      ·
      1 year ago

      Fair enough, but I hope it would be something that is able to be enabled or disabled by the user and easily configured to avoid using too much power or data. I was just unsure of why PC laptops seemed to apparently lack the ability to sip power when not in heavy active use, such as when the lid is closed. It’s not the electricity bill, but the battery running out when not on AC power, or the laptop getting hot and generally being inefficient when it’s supposed to be a mobile device that bothers me about just having it keep working as normal with the lid closed.

      • Blizzard@lemmy.zip
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 year ago

        It’s not the electricity bill, but the battery running out when not on AC power, or the laptop getting hot

        Ok, that makes sense

        I hope it would be something that is able to be enabled or disabled by the user and easily configured

        Options (choice) is always good and this would be the only scenario I’d approve. But if you’re referring to Windows, let me just predict the future: Microsoft will first introduce this advertising it as a feature and it will be enabled by default with possibly an option to disable it, and then, after some time they will take that option away because “they know better”.

        As for Linux, I’m still too n00b to have a say about it but I’m pretty sure there’s a way to keep it working in low energy consumption mode if you configure it that way (allow only the required processes to run, no need for GUI, etc.).

    • MrFlamey@lemmy.worldOP
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 year ago

      Intel did make efficiency and power cores separate parts of their CPUs a few years ago, and I wonder if AMD’s can do something similar. Perhaps if Intel and AMD would work with Linux Kernel developers and Microsoft on this feature we could see “power nap” like functionality in the future. Personally I’d like if whatever we had on PC was a bit more configurable than power nap seems to be though, allowing users to set allowable power budget, battery saving conditions and exactly which tasks can run in this mode as well as some power tracking features like on phones to see which apps are using the most.

  • linearchaos@lemmy.world
    link
    fedilink
    English
    arrow-up
    18
    ·
    edit-2
    1 year ago

    What you’re describing exists, just not for what you’re trying to do with it.

    (sO) modern standby has your box sit there in low power mode waking up occasionally to check for updates.

    I’ve attached one of my mesh central power logs from a laptop that’s allowed to run s0.

    But you can’t use it for torrent downloads and user apps. Even if it allowed you to try it wouldn’t work, s0 doesn’t save any power while the updates are installing They still need all the power to do the install and handle the crypto. They just shut back down when they’re done which isn’t how torrent clients work

      • linearchaos@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        From that perspective we’re already seeing substantial advantages coming from the new hardware on the market. They’re lowering the TDP of the entire processor to save power. He used to burn 50 or 60 Watts just to run some torrents now It’s nothing to have a laptop running on 15 or 20 Watts near idle.

        Your power savings don’t need to come from sleep they can just come from more efficient operation. Peer to peer has always been hard to make efficient.

      • linearchaos@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Microsoft has been trying to tackle that bear for years. In some cases, making sure to pull your power for a minute before you close the lid seems to solve the issue. Supposedly s0 is supposed to be nixed if you’re on battery, but the code that checks battery doesn’t always get called from s0.

    • kirklennon@kbin.social
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Apple introduced the “Power Nap” feature to do this stuff in 2012, support starting with the 2011 MacBook Air, and almost a decade before they started switching away from Intel. The chips are capable of it, at least in the right hands.

  • gibbedygook@sh.itjust.works
    link
    fedilink
    arrow-up
    16
    ·
    1 year ago

    That’s interesting, I never thought this would be a feature that someone would want.

    For desktops, standby totally makes sense. But for a laptop that’s meant to be carried around and runs on battery, I’m willing to bet in majority of use-cases, sleeping when closing the lid makes sense for the following reasons:

    1. Closing the lid usually means the user is packing it up and moving the laptop - in which case things like downloads won’t be reliable if you’re constantly moving out of wifi networks

    2. Again, if the user is moving the laptop, preserving battery life is important.

    3. Some laptops are designed so their airflow works best when open, so heat may be an issue. Not to mention you runt he risk of users putting it in their bag and then the laptop overheating.

    Of course its possible to detect when the laptop is plugged in vs not plugged in, but ultimately it just seems like your use-case is in the minority, so there isn’t much support for it - anyone who’s determined enough will find a way to disable sleep when the lid is closed like you did.

    one workaround is to perhaps set the screen to turn off after 5 minutes, and you can keep the laptop plugged in without closing the lid? The screen probably draws the most energy when idle - when you’re plugged in I’m willing to bet the energy consumption of a laptop with its screen turned off is pretty minimal.

    • MrFlamey@lemmy.worldOP
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      I can’t really argue with that. Downloading large files while on the move is going to be very unreliable, and you also don’t want it to happen on your mobile data. I guess I can also see why some of you guys are paranoid about things making the machine overheat, or an unscrupulous OS vendor using the feature to spy on users. Windows Update was one of the worst experiences I had with an OS trying to force my hand, and the thought it could “upgrade” when you think the machine is off would make it even worse.

      I was probably just annoyed that my laptop gets hot when the lid is closed and wondered why it can’t just do whatever the hell its doing more efficiently, and partly jealous of the way Apple seem to be able to implement all these nice features properly, but Microsoft just changes the wallpaper and whether app windows have curves on the corners or not in each update of Windows. Perhaps it’s time to try Linux again now I’m not forced to use software that is Windows only.

  • eerongal@ttrpg.network
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    1 year ago

    ARM vs x86 is part of the equation; ARM uses significantly less power than x86, but has a simplified instruction. x86 consumes more power but is more robust and has higher computing capabilities and higher workload efficiency

    The other half of the equation is OS level software that can restrict what is allowed to process during said low power sleep.

    In theory nothing stops x86 hardware from having something comparable, but it would probably use a lot more power than you’d expect.

    There are ways to make windows and Linux wake at certain times for actions via wake timers which isn’t quite the same, though

  • kryostar@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    You’ve answered your own question. It’s a PC laptop with a full fat processor and GPU. Certain x86 chips which have super low power states still don’t make use of it because of the billion softwares there may be installed which keep the processor from entering that state. Then there’s the motherboard issue. Not all of them support such states. Here’s a video from Wolfgang, it’s for PCs but the same applies for laptops.

    • what_is_a_name@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      As does Windows and Mac. The both have states that are “asleep” but connected to the internet. Whether they will keep downloading - it’s not a thing I have tested.

  • Whirlybird
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Windows on ARM is the answer. Unfortunately without an M1 like processor that can perfectly emulate x86 programs - which is potentially on the way from Qualcomm - it’s only a solution currently if you use windows store apps. We need more developers to compile their programs for ARM.

    My windows ARM galaxy book2 is like a giant mobile phone running windows. Notifications and updates etc can happen when it’s in “sleep” mode like a phone.

  • jasep@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    27
    ·
    edit-2
    1 year ago

    Because screw you that’s why

    Microsoft needs their telemetry dammit

    Edit: I thought the /s wasn’t needed, apparently I was wrong 💀