cancel
Showing results for 
Search instead for 
Did you mean: 

SDK 0.4.4-Long Vsync Waits in Display Driver in Direct Mode

cegli
Level 2
I'm working on trying to get "Direct Mode" working properly in Dolphin VR. The frame rate holds steady at 75fps in Extended Mode with no pauses.

I finally have Direct Mode displaying at 75fps, with no judder, which is great. The problem is, whenever the games starts loading something there is a long freeze somewhere inside line 399 of CAPI_D3D1X_DistortionRenderer.cpp


if (swapBuffers)
{
if (RParams.pSwapChain)
{
UINT swapInterval = (RState.EnabledHmdCaps & ovrHmdCap_NoVSync) ? 0 : 1;
RParams.pSwapChain->Present(swapInterval, 0); //This line has a long pause when new scenes/large objects are loading.

This happens when I try to bring up a menu for the first time, or when the whole level changes, etc. Once the area is loaded, and you don't try to load anything else, it's very smooth.

Things I've tried:
1. Running "WaitUntilGpuIdle();" directly after, like it does in Extended Mode. No change.
2. Play with the AMD Control Panel a bit. No change.
3. Run in OpenGL mode. No change. I assume it's also pausing during present here.
4. Run everything (CPU and GPU stuff) in a single-thread, to make sure no weird mutex lock stuff was going on. No change.
5. Change Present(swapInterval, 0); to Present(0, 0), which fixes it completely, but now Vsync is off and there is tearing.
6. Change Present(swapInterval, 0); to Present(swapInterval, 1), which is supposed to be a NoWait flag. Caused everything to run at 0.5fps and caused ghosting. Not a good idea apparently...

I'm not sure how to debug further, because it appears that this is happening in the OVRDisplay64.dll at 0x7feeb9425b8(). I can't look in the .dll to debug further. It's always paused at that address though. Any ideas? Seems like a bug in the display driver, because it works perfect in Extended Mode, and also perfect with Vsync off.

Specs:
AMD HD7970 - 14.11 Drivers
Windows 7 64bit
Intel I7 3570k @ 4.4GHz.
5 REPLIES 5

cegli
Level 2
Any comment from Oculus on this? Anything like, "We acknowledge this is an issue and are looking into it, but it might take a while" or "We think you've messed something up in your code" would do!

I'd like to eventually transition Dolphin VR completely to Direct Mode, but we'll never be able to support it until this is resolved.

Or you guys can send me the source code for the display driver and I'll take a look at it myself :lol:. We can all dream, right?

cybereality
Level 15
I don't know the answer myself, but I will see if I can find out.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV

cybereality
Level 15
Quick thing: can you check that Aero (desktop composition) is enabled?
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV

DeanOfTheDriver
Level 4
cyber's question is a good one. Is Aero enabled?

cegli
Level 2
Ah, thanks for the response guys! I used to have Aero enabled, but it looks like I turned it off during some testing at some point. I turned it on, and now it works in some games, as long as:

1. It's in Dual Core Determinism Mode.
2. The mirroring window is disabled.
3. It's the right game (bad judder in a couple games)

Definitely a step in the right direction!

---

If you guys ever wanted a good open source program to really tune your display driver/sdk/timewarp, you should think about using Dolphin VR as part of your test suite. It has:

* Both OpenGL and D3D mode.
* Single Core and Dual Core Mode.
* GPU Synchronization on and off mode.
* Dual Core Determinism on and off mode.
* Tons of different games, all with different timings in the code.
* Different Synchonous Timewarp modes programmed into it (patterns of using timewarping to get games from 20/30/60fps -> 75fps)
* A well supported and fully functional Extended Mode support.
* Automatic defines switches for SDK 0.4.2, 0.4.3 and 0.4.4 for easy testing between SDK versions.

I think it could be useful in perfecting all sorts of things, considering direct mode seems to behave so differently depending on the synchronization model, game, amount of timewarp, etc. I bet if Direct Mode was working perfectly in Dolphin VR with all the different threading/synchronization models, it would probably be working well in 95% of the game engines out there.

Anyway, thanks for the help, and let me know if you are ever interested in getting Dolphin VR setup for testing with!