Jaa


Prepare software for modern standby

When a system enters modern standby‐‐that is, when the screen turns off‐‐its software and applications must be made ready to enter its long term, low power sleep state. Please see Modern Standby states for a higher level overview of this behavior.

A system enters modern standby when the display turns off. This will occur in response to:

  • the user pressing the power button
  • the user closing the lid
  • the user selecting Sleep from the power button in Settings
  • the system idling out

Software preparation phases

Following the display turning off, the system will begin quiescing software activities to enter modern sleep. Microsoft defines modern sleep as entering the low power phase indicated below. Within modern sleep, explicitly allowed, value-adding software activities can run intermittently, but the system will aim to spend most of the time in its lowest power state, known as deepest idle runtime platform state (DRIPS).

Windows transitions through a set of phases to prepare apps and system software for achieving low power. The phases are sequential—each phase is a set of activities that must be performed before the phase can be completed and the next phase entered.

The purpose of these phases is to stop or reduce as much software activity on the system as possible. This reduction in activity gives more opportunity for the hardware to enter low-power modes, thereby extending overall battery life.

The following table describes each phase of preparing software for modern sleep.

Topics Description Tasks performed Exited when... Typical duration (seconds)

No-CS phase

Note  This is also the phase where the device waits for the sleep timeout to elapse and power requests to expire.

The system is waiting either to idle out or for outstanding power requests from applications. It has not yet begun quiescing activities.

  • The system waits for the sleep timeout to expire.
  • The system waits for power requests to expire. These can be held by applications to keep the system active. Power requests will block the NoCS phase indefinitely on AC power, and for up to 5 minutes on DC power. Audio and mobile hotspots are allowed to run indefinitely.

    All outstanding power requests have been cleared by applications or the maximum time-out has been reached.

    • Typically, less than one second.
    • If the system is on battery power, outstanding power requests will cause this phase to block for a maximum of five minutes. The applications with power requests can be inspected by running Powercfg.exe with the /requests option.
    • If the system is on AC power, outstanding power requests will cause this phase to block indefinitely or until the power request is cleared by the application.

    Connection phase

    The system is checking for remote desktop connections.

    • Determine if remote desktop session(s) exist.
    • Begin tracking outstanding power requests.

    There are no remote desktop sessions connected.

    • Zero seconds if no remote desktop sessions are connected.
    • Phase will last until all remote desktop sessions are disconnected or have timed out.

    Process Lifetime Manager (PLM) phase

    The system suspends Microsoft Store apps that are in the foreground.

    • Suspend all foreground Microsoft Store apps.
    • Check for communications app activity.

    All foreground Microsoft Store apps have been suspended and no audio playback is occurring.

    • Typically, less than five seconds.

    Maintenance phase

    The system executes maintenance tasks.

    Wait for maintenance tasks to complete if running (most common on AC power).

    No system maintenance tasks are running.

    • Typically, less than one second on DC power.
    • The system is most likely to block on maintenance phase on AC power.

    Desktop Activity Moderator (DAM) phase

    The system pauses desktop applications to reduce their power consumption during standby.

    The system suspends desktop applications

    All desktop applications have been suspended and no audio playback is occurring.

    Typically, less than one second.

    Low-power phase

    Note  This is where the system conceptually exits its Screen Off state and enters Sleep.

    The system notifies registered subscribers that the power manager is entering a low-power, long-resume-latency phase. This is used by some devices as a hint to power down.

    Notify registered subscribers.

    All registered subscribers have been notified.

    Typically, five seconds.

    Resiliency notification phase

    The network subsystem is notified to enter a low-power mode.

    Notify the network subsystem. Network adapters that do not support modern connected standby are turned off (D3).

    The network subsystem has been notified.

    Typically, less than one second.

    Resiliency phase

    Note  This is where explicitly allowed, value-adding software activities can run through activators. Consequently, the system may transition between idle and active states periodically.

    The system is ready for the SoC to enter the lowest power mode and remain idle.

    PDC resiliency clients are notified that the system is in resiliency phase.

    Session-0 services are throttled by the DAM to no more than one second of activity every 30 seconds.

    The power manager waits for activators to turn on their reference and cause the system to remain active.

    As of 24H2, additional session-0 services may be suspended, and session-0 service throttling may be stopped to decrease battery drain.

    The system exits standby due to user input or a power button press.

    The system transitions to maintenance phase to run system maintenance (this would show as a Screen Off segment in Sleepstudy).

    The majority of time the system is spent in DRIPS.

    After Windows has entered the resiliency phase, software is considered to be fully prepared for low-power operation. As soon as all devices have entered their low-power modes, the SoC and core chipset will enter the lowest idle power mode, as described in Prepare Hardware for Modern Standby.

    Note  Currently, no means is available to system designers to change or influence the behavior of these phases—they are a core part of Windows behavior. The details are explained here to aid in system debugging and development.

    The following graphic depicts how these phases fit into the overall Modern Standby session flow:

    figure 1: Diagram showing modern standby system states and their relationship to software phases

    Desktop activity moderator

    The desktop activity moderator (DAM) is the Windows component that is used to pause all desktop applications and throttle the runtime of third-party system services. The purpose of the DAM is to enable basic software compatibility with existing applications and services, but mitigate their impact on battery life during standby.

    Windows prevents desktop applications from running during any part of modern standby after completing the DAM phase. Windows allows third-party system services to execute in a throttled mode after completing the DAM phase.