Win Advanced Launcher suspend for windows games
#1
Hi,

I've also posted this on the advanced launcher forum, but perhaps someone here has already found a workaround.

Essentially I'm using a basic script, as explained here to suspend XBMC while in-game. This is important as we don't want half of our GPU gobbled up running xbmc in the background. However this script only works for launcher apps (emulators etc), and not for windows based games that are launched with explorer using a windows shortcut.

I'm not sure how to get around this issue, maybe someone here does?
Reply
#2
Do not use shortcuts and start directly the games executable file.
BTW, what is the command line you are using into your script to start your .lnk files?
Reply
#3
Hi,

Thanks for the tip.


I was using this script as the launcher in Advanced launcher:

Code:
pssuspend XBMC.exe
c:
cd "C:\Windows"
explorer.exe %1
pssuspend -r XBMC.exe

This only produces an opened explorer window in my documents. However I'm using individual bat files for each game now and this seems to be working! I was only able to get around 35 fps with XBMC running in a maximized window in the background, but with the script the fps counter stays maxed at 60 fps.

Code:
pssuspend XBMC.exe
E:
cd "E:\Games for Windows"
start /w AliensColonialMarines.lnk %1
pssuspend -r XBMC.exe

I can't really use the executable files directly as i also have a mixed bag of classic games, some of which use scummvm, some dosbox and some just have their individual launcher apps to get them to work. I'm using shortcut based commands to launch them and a script to reset the resolution to 1080p on exit (otherwise xbmc is zoomed in).

At any length, individual bat files seem to be working fine, so i guess this is "sorta kinda" resolved now.

Probably not the place to ask but; Is there any way you could build in the pssuspend functionality into advanced launcher? It seems beneficial to do so regardless of what is being launched as it also greatly increases performance, and reduces power consumption (36 watts as opposed to 160 watts in scummvm games!!).
Reply
#4
Seem to have hit a snag... It wont work with steam games (.url). Seems like it doesn't wait for the program to exit before resuming XBMC... I'll toy with it some more
Reply
#5
(2013-03-25, 16:45)Mercury Wrote: Probably not the place to ask but; Is there any way you could build in the pssuspend functionality into advanced launcher? It seems beneficial to do so regardless of what is being launched as it also greatly increases performance, and reduces power consumption (36 watts as opposed to 160 watts in scummvm games!!).
No... pssuspend is surely copyrighted. I do not have right to include it into Advanced Launcher.
Reply
#6
(2013-03-25, 18:31)Angelscry Wrote:
(2013-03-25, 16:45)Mercury Wrote: Probably not the place to ask but; Is there any way you could build in the pssuspend functionality into advanced launcher? It seems beneficial to do so regardless of what is being launched as it also greatly increases performance, and reduces power consumption (36 watts as opposed to 160 watts in scummvm games!!).
No... pssuspend is surely copyrighted. I do not have right to include it into Advanced Launcher.

I meant more along the lines of adding another "switch" in the files launcher (like the "switch XBMC to window") that you can turn on or off. When turned on the launcher would simply include a script that uses pssuspend as an operator. The actual pstools would still have to be downloaded and installed for it to work.

I'm pretty sure there is nothing illegal about writing scripts for programs and distributing those scripts, as long as you're not distributing the actual programs along with it, right?

Anyway, it was just an idea, it's easy enough to write these scripts manually, though it's fairly time-consuming.
Reply
#7
Looks like someone already figured out how to launch steam games while pausing XBMC 2 years ago!

While digging through about a million pages I found this little gem sitting around...

Code:
@echo off

REM ********************************************************************************?*********************
REM Usage:
REM call launcher_regular with 2 arguments, first argument is the game shortcutname, second argument
REM is the name of the process that must be tracked
REM ex: launcher_regular smb.lnk supermeatboy.exe
REM ********************************************************************************?*********************

REM pause XBMC
pssuspend XBMC.exe



REM start the game
start "GAME" %1
set process_1=%2
set ignore_result=INFO:

REM check if game has started
:1

set var=notrunning
for /f "usebackq" %%A in (`tasklist /nh /fi "imagename eq %process_1%"`) do if not %%A==%ignore_result% set var=running
echo variable %var%
timeout 1
if %var% == notrunning goto :1

REM check if game is still running
:2

set var=notrunning
for /f "usebackq" %%A in (`tasklist /nh /fi "imagename eq %process_1%"`) do if not %%A==%ignore_result% set var=running
echo variable %var%
timeout 1
if %var% == running goto :2

REM resume XBMC
pssuspend -r XBMC.exe

Then it was just a matter of slapping this into a batch file, using it as a files launcher and setting the appropriate launcher args (%rom% gameoverlaygui.exe) <= for steam in case anyone is googling this and doesn't want to dig through 1 million pages of the advanced launcher release topic.

You still have to add all non steam games to steam to get the steam ID .url shortcut. Works like a charm, THANK YOU fr500!! You rock!

I take no credit for the script, it was posted here by user fr500, 2 years ago.

Now i just need to add the suspend lines to my scummvm and dosbox batch launchers and I'm good to go!

So yeah, it's GUUUUD ^_^

Thanks again for getting me rolling with this!
Reply
#8
Something more I wanted to add...

This seems like a problem that would be common to anyone who uses XBMC as a gaming center next to a media center, with advanced launcher. But i found it quite time-consuming to piece all this information together.

Basically, if you run in true fullscreen mode you get issues with XBMC staying minimized after the game exits. This is common for ALL programs i launched with advanced launcher. Not to mention that most emulators will throw up directx errors, save for the officially supported ones on the advanced launcher wiki (not criticizing, just stating, i realize it's impossible to offer support for EVERY SINGLE emulator out there). Trying to run emulators from a scripted .bat launcher (if you want to script xbmc maximization after exit) simply results in ALL emulators having directX errors. So long story short; true fullscreen is problematic for file launchers. Which is really what you want if you have a mixed bag of games and want some level of organisation for browsing them (getting dumped into a pool of thousands of games is... overwhelming).

On the other hand if you use the maximized window instead of true fullscreen it solves most of these issues, but introduces a few new ones. Like the XBMC window not returning to 1080p resolution after you exit something that ran in a resolution other than 1080p natively (like most scummvm, dosbox or generally older games do). Or worse, power-consumption and system resource draw of XBMC running in a maximized window behind the fullscreen app. For people running SLI/X-FIRE high end gfx card, the power-consumption is significant (upto 150+ watts overhead...per card!), more importantly, XBMC significantly reduces performance in modern games (upto 40% in my case with an HD6970 gfx card).

The only solution (that i have found) is to suspend/pause XBMC when launching the emulator/files launcher, and that seems to take some creative scripting (or really intensive, persistent googling).

I think the Advanced Launcher wiki does an awesome job at trying to document and simplify all these matters, but the problem is that it mostly only addresses straight forward cases where nothing, the basic setup with no and/ifs or buts. However, I think that most serious gamers (who would bother building a gaming HTPC) have a very varied collection of games, ranging from commodore roms to sega, to classic PC games, to the latest PC games running on a myriad of launchers, like origin, ubilauncher, steam, etc etc... and it all kind of has to combine into a structured package that's easy to navigate, and nice to look at... because that's really the point of XBMC isn't it?

So what I'm saying is...

Wouldn't it be worth it to document all this somewhere? I mean other than on the release topic, buried under pages of text?

I realize it's not an "out of the box" solution, and that a lot of users will find it too time-consuming/complex to bother, but maybe with a little documentation and some packaging these scripts could work for anyone?

Or am i really the only person having this/these problem(s)? O.o
Reply
#9
(2013-03-25, 20:44)Mercury Wrote: I meant more along the lines of adding another "switch" in the files launcher (like the "switch XBMC to window") that you can turn on or off. When turned on the launcher would simply include a script that uses pssuspend as an operator. The actual pstools would still have to be downloaded and installed for it to work.

I'm pretty sure there is nothing illegal about writing scripts for programs and distributing those scripts, as long as you're not distributing the actual programs along with it, right?

Anyway, it was just an idea, it's easy enough to write these scripts manually, though it's fairly time-consuming.
I do not want to make Advanced Launcher dependant of any kind of application (like pstools) other than XBMC. Also, I don't want to also add any kind of OS specific script (.bat, .au3, .sh, etc...) into Advanced Launcher. Keep It Simple, Stupid.

Yes, it could be a good idea. But some users will then ask to add a similar script to close/restart XBMC, to mount/unmout ISO files, to unzip/unrar/un7z archives files, etc... Also users will ask to have these scripts for Windows (32 and 64bits, with XP, Win 7, Vista and Win 8 compatibility), Linux (Ubuntu, Openelec), OSX, etc... Then it will ask to have the possibility to combine these scripts togeter (for example : suspend XBMC, unzip and ISO file, automatically mount it, start the application, and once the application is closed, unmount the ISO, delete the ISO file and finally restore XBMC). I don't know if you can imaging what it suppose into background coding to predict all the possible combination all this to replace a poor 6 lines scripts.

The other approach that I have decided to follow, is to keep all minimalist like it is, and let any user do exactly what he want by creating their proper scripts. It may be more complicated to put in place for user, but they will have EXACTLY what they want.
Reply
#10
(2013-03-26, 00:52)Mercury Wrote: Something more I wanted to add...

This seems like a problem that would be common to anyone who uses XBMC as a gaming center next to a media center, with advanced launcher. But i found it quite time-consuming to piece all this information together.

Basically, if you run in true fullscreen mode you get issues with XBMC staying minimized after the game exits. This is common for ALL programs i launched with advanced launcher. Not to mention that most emulators will throw up directx errors, save for the officially supported ones on the advanced launcher wiki (not criticizing, just stating, i realize it's impossible to offer support for EVERY SINGLE emulator out there). Trying to run emulators from a scripted .bat launcher (if you want to script xbmc maximization after exit) simply results in ALL emulators having directX errors. So long story short; true fullscreen is problematic for file launchers. Which is really what you want if you have a mixed bag of games and want some level of organisation for browsing them (getting dumped into a pool of thousands of games is... overwhelming).

On the other hand if you use the maximized window instead of true fullscreen it solves most of these issues, but introduces a few new ones. Like the XBMC window not returning to 1080p resolution after you exit something that ran in a resolution other than 1080p natively (like most scummvm, dosbox or generally older games do). Or worse, power-consumption and system resource draw of XBMC running in a maximized window behind the fullscreen app. For people running SLI/X-FIRE high end gfx card, the power-consumption is significant (upto 150+ watts overhead...per card!), more importantly, XBMC significantly reduces performance in modern games (upto 40% in my case with an HD6970 gfx card).

The only solution (that i have found) is to suspend/pause XBMC when launching the emulator/files launcher, and that seems to take some creative scripting (or really intensive, persistent googling).

I think the Advanced Launcher wiki does an awesome job at trying to document and simplify all these matters, but the problem is that it mostly only addresses straight forward cases where nothing, the basic setup with no and/ifs or buts. However, I think that most serious gamers (who would bother building a gaming HTPC) have a very varied collection of games, ranging from commodore roms to sega, to classic PC games, to the latest PC games running on a myriad of launchers, like origin, ubilauncher, steam, etc etc... and it all kind of has to combine into a structured package that's easy to navigate, and nice to look at... because that's really the point of XBMC isn't it?

So what I'm saying is...

Wouldn't it be worth it to document all this somewhere? I mean other than on the release topic, buried under pages of text?

I realize it's not an "out of the box" solution, and that a lot of users will find it too time-consuming/complex to bother, but maybe with a little documentation and some packaging these scripts could work for anyone?

Or am i really the only person having this/these problem(s)? O.o
For documentation there is already the WIKI pages and the dedicated board. They are both open to subscription and contribution. Everyone is free to share its Advanced Launcher tips/configurations/scripts on them with other. But you can undestand that everybody share generally stuff close to there interest. Personnaly I'm a linux user, so you will not share a lot a Windows or OSX related stuff. Also keep in mind that Advanced Launcher is not only limited to start games and emulators but also all kind of other application (browser, reader, players, OS scripts, etc...). It's not possible to offer a support on all the possible existing applications.

Concerning true fullscreen mode problem, it is only a windows related problem. Under this OS XBMC (into true fullscreen mode) and some application could use the same rendering engine, conducting to comflicts, errors, freezing, etc... It is a XBMC related problem... so we have to deal with it. That's why the Advanced Launcher user guide suggests to use the fullscreen window mode instead... but it is not even perfect.

Now my personnal option : if you are not ready to take time to put in place your gaming center exactly how you want. you are not a real gamer. Wink
Reply
#11
(2013-03-26, 01:59)Angelscry Wrote: I do not want to make Advanced Launcher dependant of any kind of application (like pstools) other than XBMC. Also, I don't want to also add any kind of OS specific script (.bat, .au3, .sh, etc...) into Advanced Launcher. Keep It Simple, Stupid.

Your right, if you can't control the content it's asking for trouble to base functions off it.

(2013-03-26, 01:59)Angelscry Wrote: Yes, it could be a good idea. But some users will then ask to add a similar script to close/restart XBMC, to mount/unmout ISO files, to unzip/unrar/un7z archives files, etc... Also users will ask to have these scripts for Windows (32 and 64bits, with XP, Win 7, Vista and Win 8 compatibility), Linux (Ubuntu, Openelec), OSX, etc... Then it will ask to have the possibility to combine these scripts togeter (for example : suspend XBMC, unzip and ISO file, automatically mount it, start the application, and once the application is closed, unmount the ISO, delete the ISO file and finally restore XBMC). I don't know if you can imaging what it suppose into background coding to predict all the possible combination all this to replace a poor 6 lines scripts.

Hahaha! Well, when you put it like that it does seem like a lot of work just to bypass a simple script. Still it couldn't hurt to write up a definitive "run any game/emulator on win7XBMC (which is what i'm using) without issues - guide for complete dummies (like me)". If you don't mind I'll go ahead and do just that on the gwenael forum. Should make it easier to google if anyone else wants to make a similar setup with advanced launcher.

(2013-03-26, 02:52)Angelscry Wrote: For documentation there is already the WIKI pages and the dedicated board. They are both open to subscription and contribution. Everyone is free to share its Advanced Launcher tips/configurations/scripts on them with other. But you can undestand that everybody share generally stuff close to there interest. Personnaly I'm a linux user, so you will not share a lot a Windows or OSX related stuff. Also keep in mind that Advanced Launcher is not only limited to start games and emulators but also all kind of other application (browser, reader, players, OS scripts, etc...). It's not possible to offer a support on all the possible existing applications.

True enough. I've only considered gaming because that's what I'm interested in, and windows is the only widely supported gaming platform

(2013-03-26, 02:52)Angelscry Wrote: Now my personnal option : if you are not ready to take time to put in place your gaming center exactly how you want. you are not a real gamer. Wink

Or you're so busy gaming you don't have time to toy around with XBMC!! Wink
Reply
#12
Just install XBMC launcher and it will take care of all of your focus issues with a fully customisable windows interface.
Reply
#13
Sorry to bring up this old thread again but I also like to use advanced launcher due to rom collection broweser looks not as I like it to have with Aeaon Nox skin. AL looks much better.

I've written a small console application which will suspend a process, start another one (game) and after the game is not running kodi will be resumed again. Call is like
D:\Emulation\HtpcGameLauncherCon.exe /p:kodi "D:\Emulation\WinGames\Bastion.lnk"

Seettings in AL are:
Application: D:\Emulation\HtpcGameLauncherCon.exe
Parameter: /p:kodi "D:\Emulation\WinGames\Bastion.lnk"
(Also tried "/p:kodi "D:\Emulation\WinGames\Bastion.lnk"" whithout luck)

Running this from CMD works fine but AL (or more a CMD window) gives me an error message that /p:kodi "D:\Emulation\WinGames\Bastion.lnk" can't be found. It seems to me that AL does not start the application with parameters but more just the parameters.
In the log it looks correct:
12:03:02 T:5912 NOTICE: plugin.program.advanced.launcher: Load launchers.xml file
12:03:02 T:5912 NOTICE: plugin.program.advanced.launcher: Initialisierung
12:03:02 T:5912 NOTICE: plugin.program.advanced.launcher: Anwendung: D:\Emulation\HtpcGameLauncherCon.exe
12:03:02 T:5912 NOTICE: plugin.program.advanced.launcher: Parameter: /p:kodi "D:\Emulation\WinGames\Bastion.lnk"

What do I need to set in in parameter to get Kodi+AL execute a command like this? D:\Emulation\HtpcGameLauncherCon.exe /p:kodi "D:\Emulation\WinGames\Bastion.lnk"
Reply
#14
Ok I could figure out that disable the .lnk support did the trick. If any one likes to get the tool let me know and I will put it on github.
Reply

Logout Mark Read Team Forum Stats Members Help
Advanced Launcher suspend for windows games0