OSVR / OSVR-Oculus-Rift

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

Update to Oculus runtime 1.3 #11

Closed betavr closed 8 years ago

betavr commented 8 years ago

Since the latest Oculus SDK 1.3 update, this driver is not detecting connected Oculus HMDs when the user has the current 1.3 version of the runtime installed.

godbyk commented 8 years ago

Thanks for notifying me of this. I hadn't realized they finally released the new SDK. I'll look into updating this plugin.

godbyk commented 8 years ago

@betavr I've made some changes to the driver in the ovrsdk-1.3.0 branch. I don't have an Oculus Rift or CB1 handy to test it. Would you mind giving it a try for me?

betavr commented 8 years ago

That was quick! :+1:

Can you give me a link to the binary (or a Visual Studio project file)?

godbyk commented 8 years ago

I don't have a binary handy, but you can generate the VS project file using CMake.

betavr commented 8 years ago

Well I'm trying, but first I need to deal with the dependencies. Do you think it would be easier to cross compile?

godbyk commented 8 years ago

@betavr I pushed the build so binaries are available now. Please test them and let me know if you encounter any problems. http://access.osvr.com/binary/oculus

betavr commented 8 years ago

Awesome, thanks! :)

betavr commented 8 years ago

I'm getting an error:

d:\Downloads - web\osvr\OSVR-Core-Snapshot-v0.6-1176-g9ba5951-build254-vs12-32bit\bin>osvr_server.exe osvr_server_config
.oculusrift.sample.json
[OSVR Server] Using config file 'osvr_server_config.oculusrift.sample.json'
[OSVR Server] Constructing server as configured...
[OSVR Server] Loading auto-loadable plugins...
[OSVR Oculus Rift] Initializing Oculus API...
[OSVR Oculus Rift] Oculus Rift initialized.
[OSVR Server] Loading plugins...
[OSVR Server]
[OSVR Server] Instantiating configured drivers...
[OSVR Server] Errors:
[OSVR Server]  - com_osvr_OculusRift/OculusRift No driver initialization callback was registered for the driver name Ocu
lusRift
[OSVR Server]
[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 = 007E951C
[OSVR Oculus Rift] Detected 0 HMDs.
[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Connected to Razer Hydra with serial number UN1121063401999
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Hydra not in motion-controller mode - attempting to change modes. Please be
sure that the left and right sensors are to the left and right sides of the base for automatic calibration to take place
.
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Got first motion controller report! This means everything is working properl
y now. (Took 1 attempt to change modes.)
[OSVR Server] Received shutdown signal...
[OSVR Oculus Rift] Shutting down Oculus API...
[OSVR Server] OSVR Server exited.
godbyk commented 8 years ago

To fix the error No driver initialization callback was registered for the driver name OculusRift, remove the Oculus Rift stuff from the drivers section of the server config file. The Oculus Rift driver has autodetection now, so it no longer needs to be manually loaded.

betavr commented 8 years ago

Yeah it fixed that, but no hmd is found:

d:\Downloads - web\osvr\OSVR-Core-Snapshot-v0.6-1176-g9ba5951-build254-vs12-32bit\bin>osvr_server.exe osvr_server_config
.oculusrift.sample.json
[OSVR Server] Using config file 'osvr_server_config.oculusrift.sample.json'
[OSVR Server] Constructing server as configured...
[OSVR Server] Loading auto-loadable plugins...
[OSVR Oculus Rift] Initializing Oculus API...
[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 = 007D50F4
[OSVR Oculus Rift] Detected 0 HMDs.
[OSVR] Path tree updated or connection detected
[OSVR] Sending path tree to clients.
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Connected to Razer Hydra with serial number UN1121063401999
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Hydra not in motion-controller mode - attempting to change modes. Please be
sure that the left and right sensors are to the left and right sides of the base for automatic calibration to take place
.
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Got first motion controller report! This means everything is working properl
y now. (Took 1 attempt to change modes.)
godbyk commented 8 years ago

Are you running the Oculus runtime/service?

Have you tried it with an older version of the runtime in the past? Did it work then?

betavr commented 8 years ago

Ok, I managed to compile it and my build seems to work:

d:\Downloads - web\osvr\OSVR-Core-Snapshot-v0.6-1176-g9ba5951-build254-vs12-32bit\bin>osvr_server.exe osvr_server_config
.oculusrift.sample.json
[OSVR Server] Using config file 'osvr_server_config.oculusrift.sample.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 = 00B090B4
[OVR 1] IAD changed to 64.0mm
[OSVR Oculus Rift] Detected 1 HMD.
[OVR [1] IAD changedO 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: Connected to Razer Hydra with serial number UN1121063401999
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Hydra not in motion-controller mode - attempting to change modes. Please be
sure that the left and right sensors are to the left and right sides of the base for automatic calibration to take place
.
VRPN Warning
 (0) from com_osvr_Multiserver/RazerHydra0: Got first motion controller report! This means everything is working properl
y now. (Took 1 attempt to change modes.)
godbyk commented 8 years ago

Ah, good to hear!

I'll close this issue then. Feel free to open a new one if you encounter any problems.

bdone2012 commented 8 years ago

@betavr How did you eventually get this to work? You said you compiled it, how did you do that? I'm trying to get psmove controllers to work with the rift CV1 and I think I'm pretty close but getting the same error as you. Thanks.

betavr commented 8 years ago

I didn't modify it. It worked out of the box after I compiled it on my machine.

bdone2012 commented 8 years ago

Thanks for the response. I'm working with someone else's code so haven't compiled anything. What exactly did you compile? I'm having trouble seeing what was compiled that got you from where you weren't getting a hmd to show up to the point where you did.

godbyk commented 8 years ago

@bdone2012 I read @betavr's comment as meaning he compiled the OSVR-Oculus-Rift driver (i.e., the code in this repository) himself instead of using the prebuilt binaries I linked to above.

bdone2012 commented 8 years ago

@godbyk cool, thanks for your help. I think my problem is with the Rift SDK and runtime. I downloaded the most recent one which is 1.3.2 and the docs say the OSVR Rift plugin is for 1.3 but on top of that I'm reading the docs https://github.com/OSVR/OSVR-Oculus-Rift and I'm stuck at this stuff "Run CMake and point the OVR_ROOT_DIR parameter at the location in which you installed the Oculus SDK. Set the CMAKE_PREFIX_PATH to include the path to OSVR and jsoncpp. Set the CMAKE_INSTALL_PREFIX parameter to the same location OSVR was installed to. When you build and install the plugin, the files will be copied to the proper location." Would this be a good resource to learn more about what to do with it in regards to cmake? https://cmake.org/cmake/help/v3.1/manual/cmake-packages.7.html I'm a Rails(mac) developer so this stuff is a bit different.

betavr commented 8 years ago

In case you want to skip the compiling part, here is the dll I compiled: https://mega.nz/#!dtwBVCib!5NmKDcgfs_NnXCISW-qjRmhtNc_yxN2XXKI3vzcNBaE

bdone2012 commented 8 years ago

@betavr Thanks. Yeah I wouldn't mind skipping the compiling but now I'm getting "com_osvr_OculusRift/OculusRift Could not find plugin named com_osvr_OculusRift" though it's the same name as the standard osvr rift plugin which runs but says 0 hmds detected. Is there a special way I need to call the plugin I just have the standard { "plugin": "com_osvr_OculusRift", "driver": "OculusRift", "params": { "index": 0 } }

betavr commented 8 years ago

Remove everything related from the config: https://github.com/OSVR/OSVR-Oculus-Rift/issues/11#issuecomment-208087940

bdone2012 commented 8 years ago

Still getting the same error. This is what I've got: { "drivers": [ { "plugin": "com_osvr_OculusRift", "params": { "index": 0 } }, { "plugin": "com_osvr_PSMoveTracker", "driver": "PSMoveTracker", "params": { "index": 0 } } ], "display": "displays/Oculus_Rift_DK2.json" }

I think it's a slightly different problem because the error isn't "No driver initialization callback was registered for the driver name OculusRift". It's "Could not find plugin named com_osvr_OculusRift" even though it's there.

image

This is what it looks like with the standard osvr rift plugin

image

Maybe I should open up a separate issue? Sorry for opening this closed one.

DuFF14 commented 8 years ago

@bdone2012 my DK2 config file is: { "display": "displays/Oculus_Rift_DK2.json", "renderManagerConfig": "sample-configs/renderManager.direct.portrait.json" }

betavr commented 8 years ago

I forgot to add this is a 64bit dll. Are you by any chance using a 32bit osvr server?

bdone2012 commented 8 years ago

Ah yeah I'm using 32 bit because the psmove stuff was made in 32. Is there some way to combine them, or I'm going to need to compile the com_osvr_OculusRift in 32bit?

bdone2012 commented 8 years ago

I added the render manager line and didn't help.

DuFF14 commented 8 years ago

@bdone2012 my point was to remove this part: { "plugin": "com_osvr_OculusRift", "params": { "index": 0 } },

But bitness sounds like the issue here. There are 32 and 64 bit Oculus plugins available at http://osvr.github.io/using/

betavr commented 8 years ago

Yes, for the 32bit server you are going to need a 32bit dll.

I uploaded both 32 and 64bit binaries now, download it here: https://mega.nz/#!Z1hhjDoa!ggZcmIva0fFNBNTZI7f3D8Iw473EEidh3RmuY107VBI

betavr commented 8 years ago

@DuFF14 the official binary didn't work for me when I needed it (build 31). Idk if the current (build 35) one works, but I just downloaded it and it's still 10x the size of my dll, so something must be wrong with it.

DuFF14 commented 8 years ago

@betavr good to know, thanks.

bdone2012 commented 8 years ago

The 32 bit one did. Thanks so much.

@DuFF14 If I take these lines out it doesn't even say 0 hmds detected. { "plugin": "com_osvr_OculusRift", "params": { "index": 0 } },

betavr commented 8 years ago

@DuFF14 just gave build 35 a try, it doesn't detect my rift:

[OSVR Oculus Rift] Detecting Oculus Rifts...
[OSVR Oculus Rift] Detection: context = 0000027E0245FA40
[OSVR Oculus Rift] Detected 0 HMDs.
godbyk commented 8 years ago

@betavr Which version of the runtime are you using? Are you using the matching plugin version?

godbyk commented 8 years ago

@bdone2012 Would you mind opening a new issue and pasting your complete OSVR server config file along with the output of osvr_server? Thanks!

bdone2012 commented 8 years ago

@godbyk Yeah no problem. Thanks for your help.

betavr commented 8 years ago

I used 1176, now upgraded to 1186 and still the same, 0 HMDs found.