wslg icon indicating copy to clipboard operation
wslg copied to clipboard

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

Open fliespl opened this issue 5 years ago • 26 comments

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.

fliespl avatar May 07 '21 18:05 fliespl

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

geneing avatar May 09 '21 19:05 geneing

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!

hideyukn88 avatar May 10 '21 15:05 hideyukn88

@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

hideyukn88 avatar May 10 '21 18:05 hideyukn88

@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)?

fliespl avatar May 10 '21 19:05 fliespl

@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?

geneing avatar May 10 '21 21:05 geneing

@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!

hideyukn88 avatar May 10 '21 22:05 hideyukn88

@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.

geneing avatar May 11 '21 04:05 geneing

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

@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

fliespl avatar May 11 '21 05:05 fliespl

@fliespl @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

geneing avatar May 11 '21 17:05 geneing

@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 : https://github.com/microsoft/weston-mirror/commit/febf611b6cd4412be8df2faa18ddaf5e906f3d79.

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!

hideyukn88 avatar May 13 '21 04:05 hideyukn88

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

fliespl avatar May 13 '21 04:05 fliespl

@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!

hideyukn88 avatar May 13 '21 05:05 hideyukn88

@hideyukn88 I would like to come back to this one. I have tried running phpstorm from WSL using other x-server and none of them created entry in powercfg /requests like WSLG does.

Can I provide any info / debug so we can pinpoint this issue?

PS C:\WINDOWS\system32> powercfg /requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume3\Windows\System32\mstsc.exe
RAIL Power Request

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

Alternatively - can I change a way WSLg operate so it doesn't keep display awake at all? No matter if any updates are being done to UI?

fliespl avatar Jul 10 '21 19:07 fliespl

I'm still seeing this on: WSLg ( x86_64 ): 1.0.26+Branch.main.Sha.26ce2c09b86442f3c7f4f6462f770ed2afa76a25 Mariner: VERSION="1.0.20210224" No X applications running.

5tardust avatar Nov 11 '21 22:11 5tardust

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!

avielc avatar Dec 11 '21 23:12 avielc

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

RomRider avatar Dec 13 '21 01:12 RomRider

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

erSitzt avatar Mar 15 '22 11:03 erSitzt

@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!

hideyukn88 avatar Mar 15 '22 16:03 hideyukn88

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 /?

creativestate avatar Apr 02 '22 00:04 creativestate

@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!

hideyukn88 avatar Apr 02 '22 02:04 hideyukn88