Skip to content

WSLg keeps display always awake (application keeps caret blinking). #172

Closed

Description

@fliespl

I am not 100% sure that it's connected, but have checked it a few times and only when app under WSLg was running my displays wouldn't go off.

Environment

Windows build number: 21364
Your Distribution version: Ubuntu 20.04 / 21.04
Your WSLg version: 1.0.19

Steps to reproduce

Setup display to go off after 1 minute.
Run any gui app (PHPStorm in my case). Lock your PC (wait 1 minute).

Expected behavior

Display should go off after specified time when WSLg app is running.

Actual behavior

Display won't go off.

If I can provide any logs that might help troubleshoot - happy to do so.

Activity

  1. geneing commented on May 9, 2021

    @geneing

    I have the same issue. Looks like rdp is blocking sleep. Don't know how to fix it though.

  2. hideyukn88 commented on May 10, 2021

    @hideyukn88
    Contributor

    Thanks for reporting, currently the default idle timeout in WSLg is 300 seconds (instead of 60 seconds you may configure in Windows Settings app), would you please check if display turned off after 300 seconds of idle time? We are looking a way to sync display timeout between Windows and Linux side.

    If it doesn't turn off display after 300 seconds of idle time, it is possible that those application update UI at least once within every 300 seconds, currently WSLg is configured to keep display awake as long as they updates their UI. This makes weston compositor never enter idle state and it blocks display to be turned off at Windows side.

    You can check if display timeout is actually blocked by WSLg by running "powercfg -requests" command from command prompts on Windows and check if mstsc.exe has reference to DISPLAY.

    Thanks!

  3. hideyukn88 commented on May 10, 2021

    @hideyukn88
    Contributor

    fliespl , I tried PhpStorm and it looks this app is blinking caret by default, and it doesn't stop even after long period of idle, this is causing compositor to keep awake. If you can move focus out of the editor pane (by clicking project pane, for example), this makes caret at editor pane no longer blinking, then I confirmed that display can be turned off after 300 seconds. Also you can uncheck caret blinking at settings as workaround (below screenshot).

    geneing , what application are you running and encounter this issue?

    image

  4. changed the title [-]WSLg keeps display always awake[/-] [+]WSLg keeps display always awake (application keeps caret blinking).[/+] on May 10, 2021
  5. fliespl commented on May 10, 2021

    @fliespl
    Author

    Hideyuki Nagase (@hideyukn88) yes I can confirm it was showing mstsc.exe during my problems, which lead me to RDP and idea it's connected with WSL.

    Strange thing is:

    • when it didn't work - display never went off (been up all night),
    • when it worked display went off in my case after 60 seconds (which I find strange since you mention 300 seconds timeout on WSL).

    Gonna give it a try with caret later today and report results tomorrow - thanks! If disabling caret would fix the issue - should I report this bug on jetbrains or is it more WSLg related somehow (or maybe neither / both)?

  6. geneing commented on May 10, 2021

    @geneing

    Hideyuki Nagase (@hideyukn88) The interesting thing is that rdp keeps the screen up even when I'm not running any Linux gui applications. I usually run VS Code in win10 with WSL2 remote and a console application in WSL2.

    Is there a simple way to see which weston clients are running in wsl2?

  7. hideyukn88 commented on May 10, 2021

    @hideyukn88
    Contributor

    geneing , please check which version of WSLg you are running? There was such issue in our very first insider release of WSLg, but fixed in following release, please check if you are using 1.0.19. You can find the version of WSLg is at /mnt/wslg/versions.txt. Thanks!

  8. geneing commented on May 11, 2021

    @geneing

    Hideyuki Nagase (@hideyukn88) Here's the output of cat versions:

    cat /mnt/wslg/versions.txt
    WSLg ( x86_64 ): 1.0.17+3.Branch.master.Sha.a526dfd5ad03d126bb2d8c528f6c3563e86a40da
    Mariner: VERSION="1.0.20210224"
    FreeRDP: e4a2fc2053bd8c5f99455fcd08ffee7e5591567a
    weston: fd961f5cd116c9358d82ce94d139c1578e21bd00
    pulseaudio: 2f0f0b8c3872780f15e275fc12899f4564f01bd5
    mesa:

    I ran wsl --update, and this is the latest version.

  9. fliespl commented on May 11, 2021

    @fliespl
    Author

    geneing you must install msi/exe from the releases in this repo https://github.com/microsoft/wslg/releases/tag/v1.0.20

    Hideyuki Nagase (@hideyukn88) unfortunately disabling caret made no difference to my case. Display still didn't go into off mode.

    What's more important. After closing phpstorm it didn't went to off mode as well, cause powercfg still reported that rdp has display access. Closing with wsl --shutdown resolved it and display went off.

    powercfg -requests
    DISPLAY:
    [PROCESS] \Device\HarddiskVolume3\Windows\System32\mstsc.exe
    RAIL Power Request

  10. geneing commented on May 11, 2021

    @geneing

    fliespl Hideyuki Nagase (@hideyukn88) Installing updated msi solved the my display sleep mode issue. It would be great if information about updating wslg was available in the README.md

  11. hideyukn88 commented on May 13, 2021

    @hideyukn88
    Contributor

    geneing , thanks for feedback, first, we note major fixes for each release at release page (https://github.com/microsoft/wslg/releases) and this particular fix should have listed there, but somehow didn't make it. For reference, this issue was fixed by this commit : microsoft/weston-mirror@febf611.

    Regarding to updating wslg, README.md has a section, https://github.com/microsoft/wslg#updating-wsl--wslg, if any are not clear or not sufficient, please suggest us, thanks!

  12. fliespl commented on May 13, 2021

    @fliespl
    Author

    Hideyuki Nagase (@hideyukn88) i think this issue is far from closing ;) caret didn't make difference in my case (see above).

  13. hideyukn88 commented on May 13, 2021

    @hideyukn88
    Contributor

    fliespl , thanks for pointing out that, sorry I missed that. Since there could be various settings in PhpStrom, so I won't go into why it's not powering off while PhpStrom is running, first, but clearly it should go off after you close PnpStorm (and wait 5 mins). So please allow me to double check basics, do you wait at least 5 or more minutes to check by "powercfg" ? and check if there is any hidden GUI applications running by accident? please check by "ps -axf". For X apps, you can do "xwininfo -root -tree" to see if any outstanding window opened, (and for Wayland native, unless debug is enabled, we can't get scene-graph. while there is a way to enable debug, but hopefully ps will give clue if any is running), thanks!

  14. 2 remaining items

  15. avielc commented on Dec 11, 2021

    @avielc

    FYI - This is also in effect on Windows 11.
    This is what I found using Sysexplorer (internal tool)
    mstsc.exe /v:AE94C869-A9B3-43E2-A2C0-DF94E8EE24C2 /hvsocketserviceid:94F99ED2-FACB-11E6-BD58-64006A7986D3 /silent /wslg /plugin:WSLDVC /wslgsharedmemorypath:WSL\AE94C869-A9B3-43E2-A2C0-DF94E8EE24C2\wslg C:\ProgramData\Microsoft\WSL\wslg.rdp

    IF anyone found a solution for that, I'd appreciate it
    Thanks!

  16. RomRider commented on Dec 13, 2021

    @RomRider

    Same here, no X application running.
    Windows 11 OS Build 22000.348

  17. erSitzt commented on Mar 15, 2022

    @erSitzt

    Same here.. whole desktop is flickering, applications loosing focus to remotedesktop
    really annoying

  18. hideyukn88 commented on Mar 15, 2022

    @hideyukn88
    Contributor

    Dennis (@erSitzt), would you please share /mnt/wslg/weston.log and /mnt/wslg/stderr.txt? And please double check WSLg is up to date from aka.ms/wslstorepage. Thanks!

  19. creativestate commented on Apr 2, 2022

    @creativestate

    Here is how I fixed my monitors not going to sleep on a new build of Windows 11 with WSL (specifically in locked mode).

    powercfg /requests

    DISPLAY:
    [PROCESS] \Device\HarddiskVolume1\Windows\System32\mstsc.exe
    RAIL Power Request

    SYSTEM:
    [PROCESS] \Device\HarddiskVolume1\Windows\System32\mstsc.exe
    RAIL Power Request

    These processes appear three times for me (assuming one for each monitor as I have three).

    The fix for me:

    powercfg /requestsoverride PROCESS mstsc.exe DISPLAY SYSTEM


    What we are doing here is overriding the caller type (PROCESS) with the name of the process (mstsc.exe) and the request/s in this instance requests being (DISPLAY) and (SYSTEM).

    After this adjustment regardless if these processes were shown as requests, my monitors would successfully go into sleep mode.

    Hope it works for you too, good luck!


    For more info on the power configuration option and its parameter list:

    powercfg /requestsoverride /?

  20. hideyukn88 commented on Apr 2, 2022

    @hideyukn88
    Contributor

    creativestate, it looks you are on older version of WSLg, and the "monitor not getting sleep" issue should be fixed in newer release. Please install WSL/WSLg from aka.ms/wslstorepage, thanks!

  21. g2flyer commented on Aug 1, 2022

    @g2flyer

    creativestate, it looks you are on older version of WSLg, and the "monitor not getting sleep" issue should be fixed in newer release. Please install WSL/WSLg from aka.ms/wslstorepage, thanks!

    Hmm, i just installed latest version of WSL/WSLg last week and i still had the issue (but could solve if using the requestsoverride mentioned above ...)

    PS: oops, just realized that i have the latest wslg and the latest of wsl you get with windows. However, i do not have the wsl preview from store, which creativestate refers to. my bad ...

  22. hideyukn88 commented on Aug 1, 2022

    @hideyukn88
    Contributor

    Michael Steiner (@g2flyer), FYI, there is one known issue described at #380 (comment), so be aware to not press ctrl key to enter login screen, thanks!

  23. arpaterson commented on Sep 2, 2022

    @arpaterson

    (Windows 11)
    After updating to the app store preview version of WSL, the RAIL Power request now comes from msrdc.exe instead of mstsc.exe.
    Is this expected?

    Installed from app store - /mnt/wlg/versions.txt shows the following.
    WSLg ( x86_64 ): 1.0.42+Branch.main.Sha.78fa15d6ffd8fad62343b194d39c142e57cc1869

    powercfg -requests:

    SYSTEM:
    [PROCESS] \Device\HarddiskVolume3\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_0.66.2.0_x64__8wekyb3d8bbwe\msrdc.exe
    RAIL Power Request
    
    + same under DISPLAY:
    

    EDIT: Seems to have disappeared now.

  24. hideyukn88 commented on Sep 6, 2022

    @hideyukn88
    Contributor

    Anthony Paterson (@arpaterson),

    the RAIL Power request now comes from msrdc.exe instead of mstsc.exe. Is this expected?

    Yes, it is expected. We moved from Windows OS inbox mstsc.exe to msrdc.exe released independently from Windows OS.

    https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/windowsdesktop-whatsnew

    Thanks!

  25. jbouwh commented on Dec 15, 2022

    @jbouwh

    Now msrdc.exe keeps my system awake, no idea how to change that behaviour

  26. hideyukn88 commented on Dec 15, 2022

    @hideyukn88
    Contributor

    Jan Bouwhuis (@jbouwh), would you please collect core dump of weston following instruction at #380 (comment), and also share the output from wsl --version on Windows's command prompt, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions