Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with game freeze after ALT+TAB #133

Closed
HerMajestyDrMona opened this issue Nov 7, 2021 · 1 comment
Closed

Problem with game freeze after ALT+TAB #133

HerMajestyDrMona opened this issue Nov 7, 2021 · 1 comment

Comments

@HerMajestyDrMona
Copy link
Contributor

HerMajestyDrMona commented Nov 7, 2021

Hi. In Empire Earth II many users are complaining that sometimes game freezes after ALT+TAB. We use d3d8to9 (with little modifications, but I restored the official d3d8to9 release version for tests).

I detected, that the freeze occurs in function:

HRESULT STDMETHODCALLTYPE Direct3DDevice8::Reset(D3DPRESENT_PARAMETERS8 *pPresentationParameters)

Exactly at step:

ProxyInterface->Reset(&PresentParams);

In my pseudo-log it looks following:

Mona Reset returned at: 2021-11-07_00.56.43.189 after: 113 milliseconds. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 0152198A
Mona Calling Reset at: 2021-11-07_00.56.43.756. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 0152198A
Mona Reset returned at: 2021-11-07_00.56.43.864 after: 108 milliseconds. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 0152198A
Mona Calling Reset at: 2021-11-07_00.56.44.413. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 0152198A
Mona Reset returned at: 2021-11-07_00.56.44.512 after: 99 milliseconds. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 0152198A
Mona Calling Reset at: 2021-11-07_00.56.45.668. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 0152198A
Mona Reset returned at: 2021-11-07_00.57.25.812 after: 40144 milliseconds. HWND: 0152198A. Iconic: 0. Active window: 0152198A. Foreground window: 00092AF6

As you can see, it usually returns after ~100 milliseconds. However, sometimes it takes 40144+ milliseconds.
I believe that there is some fixed timeout in function ProxyInterface->Reset(&PresentParams) which is 40 seconds.

I wonder what could be the problem? Is there any possibility to figure out what goes wrong?
I noticed that with DirectX 8, the Reset() function finishes much faster. I mean, instantly after ALT+TAB I can see the game window. With d3d8to9 it takes a moment to show the screen (from black). I wonder if there is some extra check available, that would determine if Reset() is needed? Or maybe this game expect some different reset method?
The ALT+TAB bug is not easily easily reproducible. It happens randomly, usually after fast spamming of ALT+TAB key. The only thing I'm 100% sure about is that freeze occurs at that Reset function from DirectX 9.

Any help and tips would be very welcome!

EDIT:
I forgot to mention that the problem seems to only occur on computers with Nvidia graphics card. I personally am not able to reproduce this bug on my laptop with integrated AMD card, only on Desktop PC with RTX2070.

@HerMajestyDrMona
Copy link
Contributor Author

Problem solved!

Seems like once again Windows 10 / 11 "Fullscreen optimizations" cause the problem.

I believe that there is something broken in Nvidia drivers, because it looped at some .dll file from Nvidia.

Either way, checking option "Disable fullscreen optimizations" fixed it fully. I wish I remembered earlier about this option :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant