OSVR / OSVR-Oculus-Rift

Oculus Rift tracking plugin for OSVR.
Apache License 2.0
40 stars 13 forks source link

Not outputting to hmd with 1.3 runtime #13

Closed betavr closed 8 years ago

betavr commented 8 years ago

Applications are not displayed on the HMD, but on the main monitor in a window. Tracker works correctly.

When starting osvr_server.exe and the HMD is initialized, it immediately turns on and the Oculus Home software starts. Next in the HMD the Oculus Home warning screen is shown, then after accepting the terms and conditions, it continues with an Oculus Home loading screen which stays on until osvr_server.exe is stopped. No other output is sent to the hmd.

You can find the osvr_print_tree output of my system below: osvr_print_tree.txt

godbyk commented 8 years ago

What applications have you tried?

betavr commented 8 years ago

Only Showdown UE4 demo, and Steamvr, but anyway the problem has been solved in the meantime. I needed to remove the display section from the config, so now I get picture and tracking too.

godbyk commented 8 years ago

Ah, good catch. I'll go ahead and close this issue then.

betavr commented 8 years ago

I would like to ask a reopen on this issue unfortunately.

My earlier comment about having the picture in the hmd was incorrect, it was actually the normal Oculus driver that was outputting in steamvr, not the OSVR driver.

So first to leave Steam out of this, currently I'm trying to run the Palace demo and it only displays on the main monitor. The driver is fully loaded, and handles the tracking perfectly:

d:\Downloads - web\osvr\OSVR-Core-Snapshot-v0.6-1176-g9ba5951-build254-vs12-32bit\bin>osvr_server.exe
[OSVR Server] Using default config file - pass a filename on the command line to use a different one.
[OSVR Server] Using config file 'osvr_server_config.json'
[OSVR Server] Constructing server as configured...
[OSVR Server] Loading auto-loadable plugins...
[OSVR Oculus Rift] Initializing Oculus API...
[OVR 1] [CAPI] LibOVR module is located at C:\Program Files (x86)\Oculus\Support\oculus-runtime\LibOVRRT32_1.dll
[OSVR Oculus Rift] Oculus Rift initialized.
[OSVR Server] Loading plugins...
[OSVR Server]
[OSVR Server] Instantiating configured drivers...
[OSVR Server]
[OSVR Server] Display descriptor found and parsed from config file.
[OSVR Server] Triggering automatic hardware detection...
[OSVR Server] Registering shutdown handler...
[OSVR Server] Starting server mainloop: OSVR Server is ready to go!
[OSVR] Performing hardware auto-detection.
[OSVR] Added device: com_osvr_Multiserver/RazerHydra0
[OSVR] Added device: com_osvr_Multiserver/OneEuroFilter0
[OSVR Oculus Rift] Detecting Oculus Rifts...
[OSVR Oculus Rift] Detection: context = 00B434AC
[OVR 1] IAD changed to 64.0mm
[OSVR Oculus Rift] Detected 1 HMD.
[OVR 1] I[AOD changed to 64.0mmS
VR] Added device: com_osvr_OculusRift/OculusRift0
[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Got first motion controller report! This means everything is working properl
y now. (Took 0 attempt to change modes.)
vrpn: Connection request received from 127.0.0.1: 127.0.0.1 56325
[OSVR] Got first client connection, exiting idle mode.
[OSVR] Performing hardware auto-detection.
[OSVR Oculus Rift] Detecting Oculus Rifts...
[OSVR Oculus Rift] Detection: context = 00B434AC
[OSVR Oculus Rift] Detected 1 HMD.
[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
vrpn: Connection request received from 127.0.0.1: 127.0.0.1 56327
vrpn_Endpoint::getOneTCPMessage:  Can't read header (this is normal when a connection is dropped)
vrpn: TCP handling failed, dropping connection (this is normal when a connection is dropped)
vrpn_Endpoint::getOneTCPMessage:  Can't read header (this is normal when a connection is dropped)
vrpn: TCP handling failed, dropping connection (this is normal when a connection is dropped)
[OSVR] Dropped last client connection, entering idle mode.
vrpn: Connection request received from 127.0.0.1: 127.0.0.1 56434
[OSVR] Got first client connection, exiting idle mode.
[OSVR] Performing hardware auto-detection.
[OSVR Oculus Rift] Detecting Oculus Rifts...
[OSVR Oculus Rift] Detection: context = 00B434AC
[OSVR Oculus Rift] Detected 1 HMD.
[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
vrpn: Connection request received from 127.0.0.1: 127.0.0.1 56436
vrpn_Endpoint::getOneTCPMessage:  Can't read header (this is normal when a connection is dropped)
vrpn: TCP handling failed, dropping connection (this is normal when a connection is dropped)
vrpn_Endpoint::getOneTCPMessage:  Can't read header (this is normal when a connection is dropped)
vrpn: TCP handling failed, dropping connection (this is normal when a connection is dropped)
[OSVR] Dropped last client connection, entering idle mode.
DuFF14 commented 8 years ago

DK2 or CV1?

betavr commented 8 years ago

DK2

betavr commented 8 years ago

Some more info: OculusRift::getDisplayJson() is never called.

betavr commented 8 years ago

Ok, so I downgraded my runtime to 0.8, downgraded osvr too to a february build together with the osvr-oculus driver back to build19. I see the very same thing happen: the application window opens up on the main desktop, and nothing in the hmd.

Native Oculus apps, and also SteamVR works perfectly, just like with the 1.3 runtime.

So it looks like something is going on with OSVR that is not related to this plugin. Maybe my Windows 10 system is the problem.

DuFF14 commented 8 years ago

what nvidia drivers are installed?

DuFF14 commented 8 years ago

you should also try running the RenderManagerD3DPresentExample3D.exe from the command line (this comes with the OSVR runtime installer). This will show you some info on a failure.

betavr commented 8 years ago

I'm running 16.4.1 amd software currently with a AMD R9 280. Just upgraded from 16.3.2 an hour ago.

Will try the example, thanks!

betavr commented 8 years ago

This is what I get with latest 64 bit runtime+oculus driver:

c:\Program Files\OSVR\Runtime\bin>RenderManagerD3DPresentExample3D.exe
[OSVR] Connecting to default (local) host
[OSVR] Client context initialized for osvr.RenderManager.D3DPresentExample3D
[OSVR] Got connection to main OSVR server
[OSVR] Got updated path tree, processing
[OSVR] Connected 0 of 0 unconnected paths successfully
[OSVR] Connection process took 65ms: have connection to server, have path tree
[OSVR] Interface initialized for /controller/left/1
[OSVR] Constructed a ButtonHandler for com_osvr_Multiserver/RazerHydra0@localhost:3883
[OSVR] Successfully produced handler for /controller/left/1
[OSVR] Interface initialized for /controller/right/1
[OSVR] Constructed a ButtonHandler for com_osvr_Multiserver/RazerHydra0@localhost:3883
[OSVR] Successfully produced handler for /controller/right/1
[OSVR] Connecting to default (local) host
[OSVR] Client context initialized for com.osvr.renderManager
[OSVR] Got connection to main OSVR server
[OSVR] Got updated path tree, processing
[OSVR] Connected 0 of 0 unconnected paths successfully
[OSVR] Connection process took 63ms: have connection to server, have path tree
[OSVR] Interface initialized for /me/head
[OSVR] Constructed a TrackerHandler for com_osvr_OculusRift/OculusRift0@localhost:3883 sensor 0
[OSVR] Successfully produced handler for /me/head
[OSVR] Interface initialized for /me/head
[OSVR] Interface initialized for /me/head
[OSVR] Display: Oculus Rift (Version DK2)
[OSVR] Created an OSVR_DisplayConfigObject!
RenderManager::createRenderManager(): Got Display info from server (ignore earlier errors that occured while we were wai
ting to connect)
createRenderManager: Could not parse /render_manager_parameters string from server.
Could not create RenderManager
[OSVR] Client context shut down for osvr.RenderManager.D3DPresentExample3D
vrpn_Endpoint::send_pending_reports():  select() failed.
Error (10093):  Either the application has not called WSAStartup, or WSAStartup failed.
.
vrpn_Connection_IP::send_pending_reports:  Closing failed endpoint.
vrpn_Connection::~vrpn_Connection: Connection was deleted while 2 references still remain.
vrpn_Endpoint::send_pending_reports():  select() failed.
Error (10093):  Either the application has not called WSAStartup, or WSAStartup failed.
.
vrpn_Connection_IP::send_pending_reports:  Closing failed endpoint.
vrpn_Connection::~vrpn_Connection: Connection was deleted while 5 references still remain.
betavr commented 8 years ago

Yay! I copied the contents of the sample rendermanager config into the server config, and now it's displaying in the hmd. Thank you for pointing me in the right direction!

DuFF14 commented 8 years ago

Great. Make sure you use the Oculus_Rift_DK2 display. My whole config file for using DK2 is: { "display": "displays/Oculus_Rift_DK2.json", "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json" }

betavr commented 8 years ago

Perfect, thank you.

So with 0.8 it works. But I'm trying to make it work with the 1.3 supporting dll too, and now I get a different error:

c:\Program Files\OSVR\Runtime\bin>RenderManagerD3DPresentExample3D.exe
[OSVR] Connecting to default (local) host
[OSVR] Client context initialized for osvr.RenderManager.D3DPresentExample3D
[OSVR] Got connection to main OSVR server
[OSVR] Got updated path tree, processing
[OSVR] Connected 0 of 0 unconnected paths successfully
[OSVR] Connection process took 56ms: have connection to server, have path tree
[OSVR] Interface initialized for /controller/left/1
[OSVR] Constructed a ButtonHandler for com_osvr_Multiserver/RazerHydra0@localhost:3883
[OSVR] Successfully produced handler for /controller/left/1
[OSVR] Interface initialized for /controller/right/1
[OSVR] Constructed a ButtonHandler for com_osvr_Multiserver/RazerHydra0@localhost:3883
[OSVR] Successfully produced handler for /controller/right/1
[OSVR] Connecting to default (local) host
[OSVR] Client context initialized for com.osvr.renderManager
[OSVR] Got connection to main OSVR server
[OSVR] Got updated path tree, processing
[OSVR] Connected 0 of 0 unconnected paths successfully
[OSVR] Connection process took 55ms: have connection to server, have path tree
[OSVR] Interface initialized for /me/head
[OSVR] Constructed a TrackerHandler for com_osvr_OculusRift/OculusRift0@localhost:3883 sensor 0
[OSVR] Successfully produced handler for /me/head
[OSVR] Interface initialized for /me/head
[OSVR] Interface initialized for /me/head
[OSVR] Display: Oculus Rift (Version DK2)
[OSVR] Created an OSVR_DisplayConfigObject!
RenderManager::createRenderManager(): Got Display info from server (ignore earlier errors that occured while we were wai
ting to connect)
OSVRDisplayConfiguration::parse(): No RenderManager-compatible distortion parameters found, falling back to an identity
polynomial.
[OSVR] Interface initialized for /me/head
RenderManagerAMDD3D11::OpenDisplay(): Could not find display with resolution 1080x1920, found only 0x0
Could not open display
[OSVR] Client context shut down for osvr.RenderManager.D3DPresentExample3D
vrpn_Endpoint::send_pending_reports():  select() failed.
Error (10093):  Either the application has not called WSAStartup, or WSAStartup failed.
.
vrpn_Connection_IP::send_pending_reports:  Closing failed endpoint.
vrpn_Connection::~vrpn_Connection: Connection was deleted while 2 references still remain.
vrpn_Endpoint::send_pending_reports():  select() failed.
Error (10093):  Either the application has not called WSAStartup, or WSAStartup failed.
.
vrpn_Connection_IP::send_pending_reports:  Closing failed endpoint.
vrpn_Connection::~vrpn_Connection: Connection was deleted while 5 references still remain.
godbyk commented 8 years ago

A few notes:

  1. The OSVR-Oculus-Rift plugin doesn't do anything with the display. It only reads the position/orientation information and passes it on to any OSVR clients that request it.
  2. The render manager configuration can be used to position the window on the Oculus Rift (as you've discovered).
  3. The OculusRift::getDisplayJson() method isn't called yet because there's no functionality in place for passing that information along to OSVR outside of setting it in the osvr_server_config.json file. This is something that is on our to do list.
betavr commented 8 years ago

Thanks, will try to keep that in mind :) I'm discovering a lot of things lately here, it's interesting to see Sixense developing STEM support for the Vive in the other repo, if I discovered that a little bit earlier I could have saved a lot of time :)

Anyway I moved back to 0.8 runtime now since 1.3 seems a little bugged. While everything else works with this combination (Palace demo, D3DExample), SteamVR keeps outputting to the main screen. I can see these errors in the openvr server log:

Wed Apr 13 2016 20:53:00.527 - Guessing frequency of current display mode because SDL failed us
Wed Apr 13 2016 20:53:00.527 - driver_osvr: ServerDriver_OSVR::FindTrackedDeviceDriver(): Returning tracked device Left Hand Controller.
Wed Apr 13 2016 20:53:00.527 - Processing message VRMsg_Connect from vrmonitor (9108) took 0.103 seconds
Wed Apr 13 2016 20:53:00.527 - driver_osvr: OSVRTrackedDeviceHandL::GetInt32TrackedDeviceProperty(): Requested property: 1029
Wed Apr 13 2016 20:53:00.527 - driver_osvr: Waiting for the context to fully start up...
Wed Apr 13 2016 20:53:00.529 - DXGI thread failed to get SDL display index
DuFF14 commented 8 years ago

SteamVR and OSVR can't both be in DirectMode. You'll have to put SteamVR in extended mode to use it with OSVR. Maybe there is a similar conflict with the latest Oculus runtime.

betavr commented 8 years ago

The oculus runtime doesn't support extended mode since 0.8, and steamvr only supports runtime 0.8 and up. Why can't OSVR let steam handle the display?

DuFF14 commented 8 years ago

I think that's the goal but the work hasn't been done yet.

betavr commented 8 years ago

Can we count on this in the future? This could show the advantages of a truely open source platform by letting us attach any peripheral to any hmd. Sixense are already working on this for the Vive, and there are an order of a magnitude more Oculus users out there who could benefit from this.

VRguy commented 8 years ago

Can you kindly summarize in brief what is the feature you are looking for us to implement?

betavr commented 8 years ago

Hey VRguy, thank you for asking!

I forked SteamVR-OSVR, and implemented tracked controller support in hope of using it with my Oculus Rift DK2. It's almost finished, and you can use it right now to play Vive games with a HDK headset (or using the main monitor like I did, but that's not much fun).

The problem is the OSVR-Oculus-Rift plugin can't be used in conjunction with SteamVR-OSVR, because as Kevin pointed out Steam and OSVR both try to open the video device in direct mode.

I'm asking you to check the possibility of making these two plugins compatible with current Oculus runtime and SteamVR.

betavr commented 8 years ago

I have very good news guys! Valve has provided me information on how to create a controller-only driver for Steamvr. This means OSVR no longer needs to provide a display device to steam, only /controller/right and /controller/left in order to get the driver loaded successfully.

Since this issue was related to the Steam compatibility, I'm going to close it. Thank you for the help!