Interlisp / medley

The main repo for the Medley Interlisp project. Wiki, Issues are here. Other repositories include maiko (the VM implementation) and Interlisp.github.io (web site sources)
https://Interlisp.org
MIT License
376 stars 19 forks source link

Medley prevents monitors from sleeping in Windows 11 Pro host #943

Closed Michele31415 closed 1 year ago

Michele31415 commented 2 years ago

Describe the bug Run WSL. Run medley in WSL. Your monitors will no longer go to sleep after the screensaver timeout set in the host..

Expected behavior Monitors should sleep even though the host CPU isn't sleeping.

Screenshots If applicable, add screenshots to help explain your problem.

Context (please complete the following information):

masinter commented 2 years ago

https://github.com/microsoft/wslg/issues/380 "Displays do not go to sleep when WSLg is enabled after unlocking Windows lock screen using modifier key (such as left-ctrl) "

is still Open. The discussion points to reasons and a work-around. This belong in the Medley "Running on Windows with WSL" page though.

Michele31415 commented 2 years ago

I have no lock screen enabled. Just moving the mouse wakes up the displays. Putting the entire computer in hibernate mode is not an option since I have other programs that need to continue running even though the displays are blanked.

rmkaplan commented 2 years ago

I did an experiment on the Mac (M2 Air) to see whether there is power drain when Medley is running and the system goes to sleep.

So:

3 Medley's running, disconnect power, leave it alone for eight hours. Battery went from 100% to 81%.

No Medley's running, disconnect power, leave it alone for eight hours. Battery still went from 100% to 81%.

Medley itself appears to be a good citizen (although I did not stop the X server (XQuartz).

masinter commented 2 years ago

when PR #948 is merged, you can set your IDLE.PROFILE to have a LOGOUT after N minutes of idle. Then medley won't be running. I have that set, and my screens blank, but the machine doesn't sleep and it used to (even with medley was running!).

My impression is that lots of random things can cause your machine not to sleep, and that figuring out which one is affecting any particular situation is hard. if you run WSL and don't start medley, will it sleep? Is this just the display or do you really mean "sleep"? If you run medley and then quit medley, does it sleep then?

Michele31415 commented 2 years ago

if you run WSL and don't start medley, will it sleep? Yes. Is this just the display or do you really mean "sleep"? It's just the display. The screen goes black and the backlight shuts off but the PC continues to run.

If you run medley and then quit medley, does it sleep then? Yes.

nbriggs commented 2 years ago

Medly does nothing special to prevent the system from sleeping, so I’m not sure what more we could do.

masinter commented 2 years ago

if you run xterm and leave that running... does it turn off the monitor then? if you run xclock?

if those sleep OK and Medley doesn't,

Try (SETQ BACKGROUND-YIELD (ITIMES BACKGROUND-YIELD 10))

Michele31415 commented 2 years ago

I didn't even need to run any X app. Just opening an X server (lxde in this case since startx wouldn't start x) caused the monitors to stay awake. So Nick is, of course correct. This seems to be a Windows X problem. Lisp in Solaris does not have this problem.

I tried saying xset s blank in WSL before running startlxde but that didn't help.

I tried setting the prefs for screensaver inside lxde. Using "blank" or a random screensaver in lxde does kick in after the timeout, but it runs on the entire display, not just inside the lxde window. And PC windows that have the "stay on top" property are not blanked.

I tried using "No screensaver" in lxde. That resulted in the monitors not blanking. I'm about out of ideas.

masinter commented 2 years ago

The X server doesn't run in WSL. It runs in Windows. WSL is a different virtual machine with its own Ethernet MAC and IP address. When I start WSL it sets DISPLAY and so on. How you start the X server depends on what X server you have installed on the Windows side.

masinter commented 2 years ago

web site running on windows mentions problem and offers a solution (actually needs PR #948 )

Michele31415 commented 2 years ago

The X server I'm using in Windows is VcXsrv. Just starting xlaunch.exe in Windows does not prevent the monitors from sleeping. Just starting wsl does not prevent the monitors from sleeping. But as soon as I run startlxde from a wsl prompt, the monitors no longer sleep.

Do you have a link to this web site?

masinter commented 2 years ago

https://github.com/microsoft/wslg/issues/380 <- click there https: //github.com /microsoft /wslg /isssues /380

masinter commented 2 years ago

https://github.com/microsoft/wslg/issues/380#issuecomment-958140885 <== click there and it will take you to (spaces added): https: //github.com /microsoft /wslg /issues /380 #issuecomment-958140885

Michele31415 commented 2 years ago

I had seen that and got to the comment that the workaround was worse than the problem and stopped reading. I think I will just install Lisp in a Ubuntu VM running in Virtualbox and forget about wsl entirely. I know that VB doesn't prevent monitors from sleeping.

masinter commented 2 years ago

should we add using VirtualBox as an option? Can you mount your local file system or parts using it? Any other pros or cons?

nbriggs commented 2 years ago

You can configure VirtualBox to share directories with the host system.

masinter commented 2 years ago

should/could add a VirtualBox to our list of release targets? WSL seems a bit raw still -- hard for Microsoft to really polish?

On Mon, Sep 26, 2022 at 6:30 PM Nick Briggs @.***> wrote:

You can configure VirtualBox to share directories with the host system.

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/943#issuecomment-1258851096, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIQTK7EO3MNWOXOYTFQC3TWAJEZPANCNFSM6AAAAAAQQMNQNQ . You are receiving this because you commented.Message ID: @.***>

-- https://LarryMasinter.net https://interlisp.org

Michele31415 commented 2 years ago

VirtualBox VM's can mount directories on the host using the "Shared Folders" option.

One possibility would be to start a Ubuntu VM, load Lisp on it and then create a VirtualBox machine file out of it. Then a user could just load that machine and have Lisp without the bother of setting up a Ubuntu VM from scratch.

fghalasz commented 2 years ago

If we are talking about Windows 10/11 Pro, why not do all of this in Hyper-v instead of VirtualBox. Hyper-V ships with Windows 10/11 Pro so it wouldn't require users to download and install something new to their systems. It is also better integrated with Windows automation-wise than is VirtualBox.

Windows 10/11 Home is a slightly different story since it requires an install of sorts to get Hyper-V running and it's not an officially supported configuration,. VirtualBox may be a better option in this case.

Michele31415 commented 2 years ago

I hadn't thought of Hyper-V. Unfortunately, I need the Xilinx ISE FPGA IDE and it refuses to install if you have Hyper-V activated.

fghalasz commented 2 years ago

FWIW: I updated to Windows 11 Pro 2022H2 yesterday. And it seems the WSL2 monitor sleep issues have been solved in this update. Monitors go to sleep as expected while running WSL2 and when running Medley on WSL2 - at least using my setup which bypasses the WSL2 X server and instead uses VNC to put Medley on the windows desktop.

masinter commented 1 year ago

closing this issue as "solved" (or "wontfix" if it isn't)