OSVR / OSVR-Oculus-Rift

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

Rift 32 bit plugin not detecting HMD #15

Closed bdone2012 closed 7 years ago

bdone2012 commented 8 years ago

@godbyk When I use the rift 32 bit plugin It's detecting 0 HMDs. This is my config file:

{ "drivers": [ { "plugin": "com_osvr_PSMoveTracker", "driver": "PSMoveTracker", "params": { "index": 0 } } ], "display": "displays/Oculus_Rift_DK2.json", "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json" }

Here's the output

image

I also tried this and it did the same thing.

"drivers": [ { "plugin": "com_osvr_OculusRift", "params": { "index": 0 } }, { "plugin": "com_osvr_PSMoveTracker", "driver": "PSMoveTracker", "params": { "index": 0 } } ], "display": "displays/Oculus_Rift_DK2.json", "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json" }

I'm pretty sure everything else is set up alright because it works when I used a different com_osvr_OculusRift.dll file provided by @betavr

Maybe I should mention that I'm using a pseye camera and Rift constellation camera. When I have a video feed running the camera appears to be detecting the the rift because the white light dots show up on the hmd similar to this picture but without the numbers. Another interesting point is that that light dots only show up when the constellation camera is plugged in even if it's not pointing at the HMD https://raw.githubusercontent.com/OSVR/OSVR-Core/master/plugins/videobasedtracker/doc/video_debug.png

Thanks

godbyk commented 8 years ago

The message No driver initialization callback was registered for the driver name ... means that you've included a block within the drivers section that is unnecessary. When you include a block there, you're telling OSVR it should manually load a driver. This should only be done with drivers that have manualload in their filenames. All the other drivers will be loaded automatically by OSVR.

Create a config file with the following contents only:

{
    "display": "displays/Oculus_Rift_DK2.json",
    "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json"
}

Then try running the server with that config file (e.g., from the command line, run osvr_server.exe my_new_config_file.json). Paste the output of OSVR when running with that configuration file.

betavr commented 8 years ago

I think something is probably wrong in your build environment @godbyk. My dll is fraction of the size of the one you built.

bdone2012 commented 8 years ago

I haven't been running anything from the command line so maybe that's a problem.

betavr commented 8 years ago

It shouldn't be a problem, just put your settings in the default config file "osvr_server_config.json".

bdone2012 commented 8 years ago

@godbyk When I put in only { "display": "displays/Oculus_Rift_DK2.json", "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json" }

I get this

image

bdone2012 commented 8 years ago

@betavr When you were adding the hydra controllers once you had the HMD and controllers showing up as tracked in the Tracker Viewer did Steam just recognize the controllers when you had StreamVR open? I was kinda hoping it would.

godbyk commented 8 years ago

@betavr You're right that the 1.3.0 build of the driver is screwed up. It appears that it's building it against 0.4.4 instead of 1.3.0. Let me fix that real quick and then we can test it.

betavr commented 8 years ago

@bdone2012: The steamvr plugin has HMD support only, you are going to have to add new drivers for the controllers. I've already done this for the hydra: https://github.com/betavr/SteamVR-OSVR

godbyk commented 8 years ago

Okay, fresh builds are up. Try build 37 or higher and see if that works for you.

godbyk commented 8 years ago

@betavr And then Valve came along and wrote their own native SteamVR driver for the Hydra and stole your thunder.

betavr commented 8 years ago

@godbyk build 37 seems to work:

c:\Program Files\OSVR\Runtime\bin>osvr_print_tree.exe
...
[   DeviceElement] /com_osvr_OculusRift/OculusRift0
                     - corresponds to com_osvr_OculusRift/OculusRift0@localhost:3883
[InterfaceElement] /com_osvr_OculusRift/OculusRift0/tracker
[   SensorElement] /com_osvr_OculusRift/OculusRift0/tracker/1
[   SensorElement] /com_osvr_OculusRift/OculusRift0/tracker/0
[   SensorElement] /com_osvr_OculusRift/OculusRift0/tracker/2
[    AliasElement] /com_osvr_OculusRift/OculusRift0/semantic/camera
                     -> /com_osvr_OculusRift/OculusRift0/tracker/1
[    AliasElement] /com_osvr_OculusRift/OculusRift0/semantic/hmd
                     -> /com_osvr_OculusRift/OculusRift0/tracker/0
[    AliasElement] /com_osvr_OculusRift/OculusRift0/semantic/leveled_camera
                     -> /com_osvr_OculusRift/OculusRift0/tracker/2
c:\Program Files\OSVR\Runtime\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[ OmSoVdRu lOec uilsu sl oRciaftte]d  Oactu lCu:s\ PRriofgtr aimn iFtiilaelsi z(exd8.6
)\Oculus\Support\oculus-runtime\LibOVRRT64_1.dll
[OSVR Server] Loading plugins...
[OSVR Server]
[OSVR Server] Instantiating configured drivers...
[OSVR] Added device: org_osvr_filter_videoimufusion/HeadFusion
[OSVR] Client context initialized for org.osvr.analysisplugin
[OSVR] Interface initialized for /com_osvr_Multiserver/OSVRHackerDevKitPrediction0/semantic/hmd
[OSVR] Interface initialized for /com_osvr_VideoBasedHMDTracker/TrackedCamera0_0/semantic/hmd/front
[OSVR Server] Successes:
[OSVR Server]  - com_osvr_VideoBasedHMDTracker/VideoBasedHMDTracker
[OSVR Server]  - org_osvr_filter_videoimufusion/VideoIMUFusion
[OSVR Server]
[OSVR Server]
[OSVR Server] Aliases found and parsed from config file.
[OSVR Server] Display descriptor found and parsed from config file.
[OSVR Server] RenderManager config found and parsed from the 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 = 00000267BE988B20
[O[VORS VR Oculus Rift] Detected 1 HMD.
1] IAD changed to 64.0mm
[OSVR] [OVR Added device: com_osvr_OculusRift/OculusRift0
1] IAD changed to 64.0mm
directx_camera_server: Can't create video enumerator (no cameras?)

Video-based tracker: Could not open the tracking camera. If you intend to use it, make sure that all cables to it are pl
ugged in firmly.
Video-based tracker: Windows users may need to exit other camera-using applications or activities until after the tracki
ng camera is turned on by this plugin. (This is the most common cause of messages regarding the 'filter graph')

[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
[OSVR] Got updated path tree, processing
[OSVR] Could not resolve source for /com_osvr_Multiserver/OSVRHackerDevKitPrediction0/semantic/hmd
[OSVR] Could not resolve source for /com_osvr_VideoBasedHMDTracker/TrackedCamera0_0/semantic/hmd/front
[OSVR] Connected 0 of 2 unconnected paths successfully
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.)
[OSVR] Performing hardware auto-detection.
[OSVR Oculus Rift] Detecting Oculus Rifts...
[OSVR Oculus Rift] Detection: context = 00000267BE988B20
[OSVR Oculus Rift] Detected 1 HMD.
directx_camera_server: Can't create video enumerator (no cameras?)
[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 58558
vrpn_Endpoint::connect_tcp_to: Could not connect to machine 127.0.0.1 port 58558
Winsock error: 10061
vrpn_Endpoint::setup_new_connection:  Can't write cookie.
vrpn_Connection_IP::handle_connection():  Can't set up new connection!
[OSVR] Performing hardware auto-detection.
[OSVR Oculus Rift] Detecting Oculus Rifts...
[OSVR Oculus Rift] Detection: context = 00000267BE988B20
[OSVR Oculus Rift] Detected 1 HMD.
directx_camera_server: Can't create video enumerator (no cameras?)
[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
[OSVR Server] Received shutdown signal...
[OSVR] Client context shut down for org.osvr.analysisplugin
[OSVR Oculus Rift] Shutting down Oculus API...
[OSVR Server] OSVR Server exited.
godbyk commented 8 years ago

Excellent! I'm glad we got that sorted out.

I also just uploaded a build for version 1.3.2 of the SDK (just to simplify compatibility questions that people may have—there are no API or plugin code changes between 1.3.0 and 1.3.2).

Thanks, @betavr, for the pointer on the file size issue.

godbyk commented 8 years ago

@bdone2012, try the latest OSVR-Oculus-Rift build available at http://access.osvr.com/binary/oculus. See if it detects the HMD.

betavr commented 8 years ago

@godbyk: It's awesome what Valve did, though they needed some poking on Github first :)

I'm not sure everything is ok with the driver. Just tried trackerview and the HMD doesn't move. Looking at the server output I can see some errors about the camera:

directx_camera_server: Can't create video enumerator (no cameras?)

godbyk commented 8 years ago

@betavr, that message is from VRPN, not Oculus. Are you loading other drivers that are trying to use a camera?

bdone2012 commented 8 years ago

@godbyk It's working using this server config

{ "drivers": [ { "plugin": "com_osvr_PSMoveTracker", "driver": "PSMoveTracker", "params": { "index": 0 } } ], "display": "displays/Oculus_Rift_DK2.json", "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json" }

godbyk commented 8 years ago

@bdone2012 Okay, great! Does the head tracking work for you or are you seeing the same problem that @betavr reported?

betavr commented 8 years ago

My bad, I forgot to put back the contents of the default config file after I reinstalled the runtime. Movement is now showing correctly in trackerview, and no errors are in the server output.

bdone2012 commented 8 years ago

@godbyk I'm new to using tracker viewer but it seems to be working. I wave the hmd around and it moves around. The controllers are only getting rotational tracking not positional but I'd assume that has something to do with on my side and not yours. When I put the headset on I get what I think is an oculus loading screen and then eventually a message that says it's unable to load osvr_server.exe. It does this with the other plugin as well. I haven't actually gotten anything working from osvr on the headset. Except stuff in steamvr that's unrelated to this project so I assume that's different.

bdone2012 commented 8 years ago

Am I supposed to be seeing something when I put the headset on? I tried osvr-palace but it didn't work. I just turned on the server and then opened the palace.

bdone2012 commented 8 years ago

Also I have the drivers for the steam controller support here https://drive.google.com/file/d/0Bye7vvW1JTGCRk9qSU9KYXd6eUU/view

I just added them to the bin but it didn't do anything.

godbyk commented 8 years ago

You won't see anything on the headset unless you're running a program that displays something there.

In recent versions of the Oculus runtime, the Rift runs in direct mode only, so the screen will be empty (or show some Oculus-specific thing) until a program is running and sending graphics to the Rift.

betavr commented 8 years ago

I can't make it work either. RenderManagerD3DPresentExample3D.exe is giving me this 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 62ms: 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 58ms: 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.
bdone2012 commented 8 years ago

When I turn on the palace demo and move the headset around the palace demo moves on the computer screen but nothing shows up on the screen.

godbyk commented 8 years ago

@betavr You'll have better luck reporting those issues to the RenderMnager repository. I'm fairly ignorant of RM at the moment.

godbyk commented 8 years ago

@bdone2012 It's good that it's detecting the rotation/position changes of the Rift. That's about all this plugin does right now.

For the display issues, you'll need to look into the RenderManager and Palace side of things. The RM config may need to be modified.

bdone2012 commented 8 years ago

@godbyk Cool thanks for all your help I'll look into the RenderManager stuff. Would you happen know where I'd put this driver stuff for the controllers https://drive.google.com/file/d/0Bye7vvW1JTGCRk9qSU9KYXd6eUU/view or where I could find out more about it?

godbyk commented 8 years ago

@bdone2012 The drivers folder is usually in C:/Program Files (x86)/Steam/steamapps/common/SteamVR on Windows.

bdone2012 commented 8 years ago

@godbyk Yeah that's where I put them. But it didn't do anything. I'm not sure if I'm supposed to do anything with the files other than just put them in there or if something else is wrong.

godbyk commented 8 years ago

You also need to modify a SteamVR config file to tell it to load multiple drivers; otherwise it'll see the Oculus Rift driver first and stop after it loads that one.

Set "activateMultipleDrivers": true in the "steamvr" section of the config/steamvr.vrsettings file.

bdone2012 commented 8 years ago

Thanks, it was already set to true. I'm going to see if I can get the palace demo working because it seems like my rift is having trouble recognizing the osvr_server because that's what the error message in the headset says.