Emulator Issues #9723
closedDolphin hanging forever when launching any Wii games in full screen + DX11
0%
Description
Emulator hanging forever if launch any Wii games in full screen + DX11.
It doesn't hang if you launch game in windowed mode and then switch to full screen.
It applies only to dev builds 5.0+ but doesn't applies to stable 5.0.
Also it doesn't hang with DX12 at all.
Tried delete profile folder - doesn't help.
Specs: i7-4770, gtx760, win10 x64
Updated by seapancake over 8 years ago
Tested 5.0-349 and not seeing this, using Geforce GTX 970 (368.81), Windows 10 x64.
Updated by Kyogre over 8 years ago
Windows says: "dolphin doesn't unswer: wait for respond or close the programm?"
Updated by seapancake over 8 years ago
What other processes are you running? Which version Nvidia driver are you using?
Do you see anything in Event Viewer? (Start -> type 'Event Viewer' then click System)
Updated by Kyogre over 8 years ago
- no foreground processes
- 368.81 driver, Windows 10 Pro Anniversary update
- nothing interesting in system and application tabs except of "application hang" event when I force closed Dolphin
Updated by seapancake over 8 years ago
Can't think of anything that it might be, I'd suggest bi-secting the issue. You can use this tool to make it a bit easier: https://github.com/Helios747/DolphinBisectTool
Updated by Kyogre about 8 years ago
I had done some research:
build 5.0-72 - no hanging
build 5.0-76 - hanging exist
Updated by Kyogre about 8 years ago
same problem for few other users here https://github.com/dolphin-emu/dolphin/pull/3510#issuecomment-230109827
Updated by seapancake about 8 years ago
Good fine, this narrows it down to https://github.com/dolphin-emu/dolphin/pull/3510 possibly having an infinite. I'm locked out of the forums due to bad password attempts, would suggest contacting akyryz to get him to put debugging information here. and badkarma12 so we can compare your exact setups.
Also worth contacting JMC47 (IRC or forums) to see if he replicate it.
Updated by JosJuice about 8 years ago
- Subject changed from Dolphin hanging forever when launch any games in full screen + DX11 to Dolphin hanging forever when launching any Wii games in full screen + DX11
- Status changed from New to Accepted
- Priority changed from Normal to High
- Regression changed from No to Yes
- Regression start set to 5.0-76
- Operating system Windows added
- Operating system deleted (
N/A)
This has been bisected down to PR 3510 for a while already.
There are some more criteria for triggering the bug than what's described in this issue report. I think it was something like exclusive fullscreen on, or render to main window off, or both.
Updated by JosJuice about 8 years ago
- Has duplicate Emulator Issues #9698: Gecko OS crashes Dolphin when started with D3D11 and fullscreen added
Updated by Kyogre about 8 years ago
JosJuice,
you are right about criteria.
Render to main window OFF + Borderless full screen OFF = hangs
Render to main window ON + Borderless full screen OFF = doesn't hang
Render to main window OFF + Borderless full screen ON = hangs
Render to main window ON + Borderless full screen ON = doesn't hang
Updated by JosJuice about 8 years ago
- Has duplicate Emulator Issues #9863: Booting any VC/WiiWare title with "Fullscreen" checked on Direct3D 11, will crash Dolphin added
Updated by JosJuice about 8 years ago
- Has duplicate Emulator Issues #9880: D3D11 Black Screen on Every Game added
Updated by Armada about 8 years ago
The problem here is that Dolphin violates the DXGI: Best Practices, which states that you should never lock the UI thread on the GPU thread. The reason for that is because DXGI (which runs on the GPU thread) will also send messages to the UI thread. This means there is a lot of potential for rare race conditions that deadlock the emulator.
This race condition has been known since exclusive fullscreen was first implemented, however it seems PR 3510 has exposed it due to changes in the initialization order. Here's what's happening:
- The GPU thread is initialized and DXGI sends some messages to the UI thread for initialization.
- The UI thread triggers a switch to fullscreen as the "Use Fullscreen" option is enabled.
- The GPU thread switches to exclusive fullscreen and DXGI sends some message to the UI thread to change its style.
- The UI thread calls UpdateGUI() which is called numerous times and includes a LockAndPause() which locks on the GPU thread.
- Both threads are now deadlocked with the GUI thread waiting on the UI thread to handle the message and the UI thread waiting on the GPU thread to pause.
There are two ways to solve this as documented in the DXGI Best Practices:
Hard way: "To avoid this, never block the message pump."
This requires we make any interaction with the GPU thread asynchronous, which is difficult given the numerous usages of LockAndPause(). Though never blocking the UI thread is generally good practice.
Easy way: "If a block is unavoidable, then all DXGI interaction should occur on the same thread as the message pump."
This would either involve moving the Render Window to the GPU thread (which means render-to-main is no longer possible) or making sure that after initialization of the backend all DXGI calls are done by the UI thread. I'll make an attempt at implementing the latter option.
Updated by Armada about 8 years ago
- Status changed from Accepted to Fix pending
A workaround is available in my new PR: https://github.com/dolphin-emu/dolphin/pull/4433
I'm also working on a PR for exclusive mode that has some of the stability improvements I outlined in my previous comment.
Updated by Armada about 8 years ago
- Status changed from Fix pending to Fixed
- Fixed in set to 5.0-1281