Laptop won't suspend/sleep while Wesnoth is running

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
karger
Posts: 2
Joined: May 23rd, 2011, 1:49 pm

Laptop won't suspend/sleep while Wesnoth is running

Post by karger »

When I'm running Wesnoth on my Windows 10 Thinkpad Laptop, closing the lid doesn't put the laptop to sleep----it continues to drain battery at full operational rate. Running powercfg /requests produces the following output:
SYSTEM:
[DRIVER] Realtek High Definition Audio (HDAUDIO\FUNC_01&VEN_10EC&DEV_0293&SUBSYS_17AA2233&REV_1000\4&1253530c&0&0001)
An audio stream is currently in use.
(This only shows when Wesnoth is running.) Which suggests Wesnoth is demanding to play its sound effects and refusing to suspend. Is there a way to overcome this behavior?
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Laptop won't suspend/sleep while Wesnoth is running

Post by Pentarctagon »

Wesnoth 1.13.4 also prevents my computer from going to sleep as well, running Linux Mint.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Aginor
Inactive Developer
Posts: 11
Joined: July 31st, 2015, 10:31 pm

Re: Laptop won't suspend/sleep while Wesnoth is running

Post by Aginor »

Pentarctagon wrote:Wesnoth 1.13.4 also prevents my computer from going to sleep as well, running Linux Mint.
Could this be because SDL disables screen savers? Could you try the instructions here to re-enable it throught the environment variable? https://wiki.libsdl.org/FAQUsingSDL#Why ... default.3F
If it works, we'll have to consider whether we want wesnoth to disable screensaver or not.

Thanks
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Laptop won't suspend/sleep while Wesnoth is running

Post by gfgtdf »

I think it makes sense to disable auto suspend (that is susepnd after x miutes of inctiveness) while playing a mp game, since susepdnding the pc will automatically break the connection afaik. I do however agree that wesnoth should not disable suspending when playing in sp mode or beeing on titltescreen.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Laptop won't suspend/sleep while Wesnoth is running

Post by Pentarctagon »

Aginor wrote:
Pentarctagon wrote:Wesnoth 1.13.4 also prevents my computer from going to sleep as well, running Linux Mint.
Could this be because SDL disables screen savers? Could you try the instructions here to re-enable it throught the environment variable? https://wiki.libsdl.org/FAQUsingSDL#Why ... default.3F
If it works, we'll have to consider whether we want wesnoth to disable screensaver or not.

Thanks
This does not seem to be the cause. I set SDL_VIDEO_ALLOW_SCREENSAVER=1 in my ~/.bashrc, logged out/in, and Wesnoth still prevents going to sleep both from within an SP scenario and when on the title screen.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Laptop won't suspend/sleep while Wesnoth is running

Post by Pentarctagon »

So, I did another experiment with this on Mint 18.

Power settings are set to suspend after 5 minutes:
power.png
All of Wesnoth's sounds are disabled:
sound options.png
There is nothing doing anything with sound:
sounds.png
I walked away for 7 minutes, came back, the computer had not suspended.

I then closed Wesnoth, walked away for another 5 minutes, came back, and the computer had suspended.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Post Reply