Cannot enable "Direct Mode" with IVRDriverDirectModeComponent implemented
My driver implements the IVRDriverDirectModeComponent and SteamVR is submitting frames to it. However, When I start SteamVR there is an warning message that says: "SteamVR is in Extended Mode". There is also button that says "Enable Direct Mode" which restarts SteamVR but nothing changes. And its not possible to enable the "Direct Mode" from SteamVR settings.
I have a few questions:
-
Is the message just an indication that Nvidia/AMD Direct mode not being used? Or does it mean there is an issue with my IVRDriverDirectModeComponent implementation?
-
In order to enable "Direct Mode", other then implementing the IVRDriverDirectModeComponent and setting up the Prop_UsesDriverDirectMode_Bool property to true, is there anything else that is required?
-
What is the "Extended Mode" meaning in this case? As I do receive the frames in my driver and there is nothing being rendered to the desktop.
This is a bug in SteamVR IMO. When using Oculus/Direct mode, the OpenVR compositor does not have control of the display, and has no way to tell if the HMD is in direct/extended mode. It therefore shouldn't give any warnings in this regard. The Oculus driver doesn't show this warning, so there must be flag to set in the driver to avoid the warning, but I haven't found it. In any case, trying to enable it can't/won't do anything, so all you can do is 'dismiss'.
Really wish they'd called this "Oculus/Direct" Mode something else. Endless confusion between "Oculus/Direct" and "Display/Direct", which are almost completely unrelated but are both called "direct". In this instance "direct" mode is referring to "Display/Direct" and so is unrelated to your "Oculus/Direct" driver.
@TheDeveloperGuy my thoughts exactly.
The Oculus driver doesn't show this warning, so there must be flag to set in the driver to avoid the warning, but I haven't found it.
I was wondering if the DirectMode can be enabled with the Oculus runtime since there is a physical headset present on the system and its edid is whitelisted by the NVIDIA driver. to OpenVR then gets its indication that DirectMode is available/enabled.
My only concern is that OpenVR will perform worse since it thinks it is in "extended mode" (e.g. if it does extra steps that aren't needed by a DirectMode driver)
Please don't make me have to explain the difference between "Oculus/Direct" and "Display/Direct" to anyone again! :)
The IVRDriverDirectModeComponent might as well be called IVRDriverOculusModeComponent because that is what it is. It has nothing to do with your display driver's "direct" mode. Whether or not OpenVR thinks your display is "extended" or not makes no difference to your HMD driver. In particular these terms have absolutely no meaning if your HMD is not connected via a VGA/DVI/HDMI/DP port! Your OpenVR HMD driver effectively bypasses most of OpenVR's compositor and is responsible for all of the kind of things that the OpenVR compositor would normally be responsible for.
The real Oculus OpenVR driver (your's is a fake) uses the Oculus runtime's own compositor. You have to emulate this in your fake driver. Somewhere in the real Oculus OpenVR driver it sets something which disables this warning (who knows what it is? we will probably never find out because the Oculus driver is closed source that noone wants to give any info about).
OpenVR doesn't know anything about the screen mode, monitor ID etc. that the Oculus runtime is using (if you doubt this look at vrserver.txt log after running Oculus and you will see the same "DXGI thread failed to get SDL display index" that you will see for your own driver).
In any case, you'll have to live with this because there doesn't appear to be any way around it. I have had no problems running 120+FPS with this interface, so I wouldn't worry too much about the performance implications.
@TheDeveloperGuy Thank you very much for your wonderful answer. Finally my understanding is:
- The IVRDriverDirectModeComponent interface is designed specifically for oculus, and we can't use it to do anything?
- If we want to do for the custom HMD direct rendering only through the IVRDisplayComponent to achieve the direct rendering (EDID and NVIDIA's white list), and in this way you can reach 120 frames? If convenient, tell me about this.
@HelenXR
- No, you can use IVRDriverDirectModeComponent for your own driver, if you implement an equivalent of the Oculus compositor yourself.
- If your hardware supports 120Hz, maybe. I used the Oculus interface to achieve 120FPS.
@TheDeveloperGuy thanks!
@HelenXR The primary benefit of using a IVRDriverDirectModeComponent driver for HDMI connected headsets is much finer control over when the HMD can be activated. In a IVRDisplayComponent driver, the HMD's display must be presented to Windows (either as extended or direct mode) before the driver is initialised, whereas the IVRDriverDirectModeComponent can activate the display whenever it wants to. This allows a IVRDriverDirectModeComponent driver to operate without a 'server' application running on the PC. The IVRDriverDirectModeComponent also allows more flexibility when it comes to composing the final image that gets sent to the headset (image rotation, scan-line interleaving etc.).
Did you ever figure out how to get the "Prop_UsesDriverDirectMode_Bool" / "Prop_EdidVendorID_Int32" / "Prop_EdidProductID_Int32" values to work?
I have DirectMode working in a custom app but am trying to get it working in OpenVR using there compositor.
The Prop_UsesDriverDirectMode_Bool property should be false if you want to use SteamVR's own direct-mode implementation. Set the EDID properties properly.
Set the EDID properties properly. -- Can you clarify this? I've set "Prop_EdidVendorID_Int32" and "Prop_EdidProductID_Int32" to the same values in my working DirectMode app and the vrcompositor just opens then quits. The vrmonitor says my HMD is there but not ready.
My values are set like:
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_UsesDriverDirectMode_Bool, false);
vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, Prop_EdidVendorID_Int32, 0x1017);
vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, Prop_EdidProductID_Int32, 0x0007);
It means set Prop_EdidVendorID_Int32 and Prop_EdidProductID_Int32 to the EDID vendor and product ID values associated with the monitor you want SteamVR to put into direct mode.
My Edid looks like the values shown.
Also these values are passing correct I assume?
bool IVRDisplayComponent::IsDisplayOnDesktop()
{
return false;
}
bool IVRDisplayComponent::IsDisplayRealDisplay()
{
return true;
}
IsDisplayRealDisplay() should return true, as you've done. IsDisplayOnDesktop() should return true when the display is in extended mode and false when it's in direct mode (or if you're using your own direct-mode implementation instead of SteamVR's).
Awesomeness, I got it working. Had the resolution set incorrectly. Now I have direct mode working. Tnx for the clarification!! Cool so both extended and direct work now.
Glad I could help. It's definitely a matter of knowing all the right buttons to push at the right time.
One last question if you know off the top of your head. So a Unity OpenVR game is running on the screen just fine, however I still get the "Not Ready" status in the vrmonitor. Because of this, "DriverPose_t" updates I'm passing from "ITrackedDeviceServerDriver::GetPose" stops taking effect in the game.
Am I required to implement something else to prevent this from happening?
It's hard to say. Check to make sure you're continuing to send pose updates regularly. I think it may go to a not-ready state if too much time elapses without a pose update.
I can attach a debugger and see the method is always fired as that was my first guess. O well more digging I guess. I'm guessing I need to implement some other interface or have some other setting wrong.