JockeJarre / VPinballX.starter

Small tool to start the right VPinballX version depending on the table file
GNU General Public License v3.0
5 stars 1 forks source link

Using PinballY together with VPinballX.starter makes it fail screen capture #8

Closed JockeJarre closed 5 months ago

JockeJarre commented 9 months ago

I have created the same story on PinballY's side. I hope Michael might know what the problem is.

The link is here: https://github.com/mjrgh/PinballY/issues/227

Karl030167 commented 9 months ago

maybe the issue is because the "starter.exe" is the "main task" and the real vpinball_xx.exe is a "child task" ? Even if the starter.exe is renamed to vpinballx.exe and was started, in taskmanager then there is "vpinballx.starter" as a task. And of course additionally the "real" Visual Pinball exe as a task. Only when the visual pinball program will be closed (by menu-file-exit or long press esc) the two tasks are closed, too.

JockeJarre commented 7 months ago

The reason is because PinballY is waiting for our "VPinballX" replacement to idle in it's main gui loop. Windows has an API for this: "WaitForInputIdle", though since VPinballX.starter does not have any GUI nor GUI loop, PinballY calling WaitForInputIdle on the process, returns directly. One might have to add some dummy GUI to VPinballX.starter, to make it react on WaitForInputIdle?

Karl030167 commented 7 months ago

Thank you for still looking at this behavior - at least a first step that you identified the reason

JockeJarre commented 7 months ago

Thank you for still looking at this behavior - at least a first step that you identified the reason

Do you mind testing a new build coming up in the actions, I want to know if it helps for PinballY? I now also do the WaitForInputIdle() on VPX and hope it will tell PinballY to also wait... fingers crossed...

Karl030167 commented 7 months ago

Hi, downloaded and tested 1.5.74 with plain use of the starter (renamed to vpinballx.exe) all is ok; doubleclick of .vpx starts the right .exe as it is set in .starter.ini

but when used in PinballY, now sometimes the table don't close at game exit. only when i switch with Alt-Tab to the table-process again, it get closed. Oddly this happens not always; tried the same table few times again and again - sometimes PinballY close the table correctly, next time the table (vpx process) stays alive until the "Alt-Tab" doing

the screen capture ( i do only pictures, NO videos) is not clear, too. Ok, maybe one step further... let me explain the capture-steps : in PinballY i choose the menu-item to capture (i set it to capture backglass and playfield, manual start with a key) Pinbally starts the table, show a small window with a timer from 20 sec to 0 sec (can be set how long, to give all kind of tables the neccessary start time) When the time is at 0, i can press the defined key - capture of backglass is taken - then the small window switch from playfield display to backglass display and back - then i can press the defined key again to capture the playfield PinballY then close the table (the vpx process) and is in menu mode again

now with the new starter.exe, at the step when the first small window is visible and the countdown starts from 20 -> 0, nothing happens - i can't press the capture key. ONLY when i "ALT-TAB" switch to the table process, then i can use the capture key and then it works.

ok, i know this all sounds crazy, and maybe my wordings are not so clear as they should. But hopefully you can pull some helpful info out of them, so you could look further with another test version ?

JockeJarre commented 7 months ago

Thanks for your tests! I guess my fix wasn't good enough. Will have to revisit this when I have a clue what I could try out... Maybe I will install PinballY, so I can test it myself too

Karl030167 commented 5 months ago

Hi , this one issue is almost gone, but sadly not for complete. The capture process now is starting ok: PinballY starts the table - the capture "countdown-window" is visible, counts from 20 to 0, then the both captures for backglass and playfield are ok. BUT after this the "table"-task (a.k.a. the vpinballx.exe) won't close. it needs to manually press ESC to close and return to PinballY

JockeJarre commented 5 months ago

We'll see if I can find a solution to that...

JockeJarre commented 5 months ago

Added new issue https://github.com/JockeJarre/VPinballX.starter/issues/11

JockeJarre commented 5 months ago

Hi , this one issue is almost gone, but sadly not for complete. The capture process now is starting ok: PinballY starts the table - the capture "countdown-window" is visible, counts from 20 to 0, then the both captures for backglass and playfield are ok. BUT after this the "table"-task (a.k.a. the vpinballx.exe) won't close. it needs to manually press ESC to close and return to PinballY

There is a new build under actions... which should now do what you explained.