Linux, Mesa and Oculus Rift SDK


#1

The interface works fine in the default view. I’d like to try it with the Oculus Rift DK2.

But when trying to enable VR mode, the unfortunately common Error: [Context] Unable to obtain x11 visual from context error is thrown.

After a bit of wrestling I managed to tell the build system to include this hack in LibOVR: https://forums.oculus.com/viewtopic.php?uid=119403&f=34&t=16664&start=0#p252973

Now when I try to enable VR mode a fullscreen window opens, but it is completely black.

Are there any plans to make it work or do I have to wait for OpenVR integration?


#2

@haagch great you got it working in VR Mode.

@KevinMThomas this might be useful to you, you had the same error in Ubuntu!

As for the VR Mode I am not entirely sure if it functions well on Linux/Unix/OSX at the moment. Last time I checked it worked great on Windows.


#3

@haagch - I can report success on Ubuntu with a DK1. Those other hacks didn’t work for me – what I had to do was retrieve the config from the context instead of the drawable (ie: glXQueryContext instead of glXQueryDrawable).


#4

Perhaps the application is using a different config than the hardcoded one… So I should replace it with this (I can only test it later)?

glXQueryContext(display, glXGetCurrentContext(), GLX_FBCONFIG_ID, (int *) &value);

#5

Yup, except I think I changed the declaration of value into an int (instead of recasting). There are at least two more ways to retrieve the framebuffer config, but those are definitely the most straightforward.

Does RiftConfigUtil work on your Linux? If not let me know – another way to instrument the workaround is to LD_PRELOAD a shared object (which is the only way I’ve found that also works with apps statically-linked to LibOVR).


#6

Thanks for the tip. It’s still completely black for me, but I’m not sure if right now this here is the cause or some other mesa problem. I’ll come back to this later.

If I remember correctly the rift config util from the 0.4.4 Oculus Rift SDK worked fine, but not with 0.5.0.1 anymore and I think LD_PRELOAD worked around it.


#7

So I haven’t checked in for a while. Just tested the latest git revision again with my workaround https://github.com/ChristophHaag/OculusSDK/commit/a1eb97523ef1daa9d34709fa0cb64b4646ba03c6 and there’s no improvement: 2D mode works decently, but activating HMD mode creates a fullscreen window that is completely black.

JanusVR now doesn’t work at all, but the last few weeks it has done the same: The fullscreen window in VR was completely black. It uses Qt5 OpenGL support and I think hi-fi does the same. Maybe there’s the problem?

[DEBUG] [09/10 09:32:44] Offscreen UI resizing to  1920 x 1080  with pixel ratio  1
[DEBUG] [09/10 09:32:44] HMDToolsDialog::watchWindow() window: QWidgetWindow(0x7f66020, name = "QWidgetClassWindow")
[DEBUG] [09/10 09:32:44] HMDToolsDialog::watchWindow() window: QWidgetWindow(0x1f2c0d0, name = "RunningScriptsWidgetWindow")
[DEBUG] [09/10 09:32:44] HMDToolsDialog::watchWindow() window: QObject(0x0)
[DEBUG] [09/10 09:32:44] HMDToolsDialog::watchWindow() window: QWidgetWindow(0x7f66020, name = "QWidgetClassWindow")
[DEBUG] [09/10 09:32:44] HMD Tools: Whoa! What are you doing? You don't want to move me to the HMD Screen!
[WARNING] [09/10 09:32:44] 0x2200b80 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1c05d40) ): Attempt to set a screen on a child window.
[From Service] Lost 2 IMU samples: 4005 2 4
[From Service] [ExternalCamera] Skipped 10 frames
[DEBUG] [09/10 09:32:44] Offscreen UI resizing to  1920 x 1053  with pixel ratio  1
[DEBUG] [09/10 09:32:44] Offscreen UI resizing to  1920 x 1080  with pixel ratio  1
[WARNING] [09/10 09:32:44] 0x2200b80 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1c061f0) ): Attempt to set a screen on a child window.
[DEBUG] [09/10 09:33:08] adjusting LOD DOWN after initial delay... average fps for last  3 seconds was  29.9999 minimum is: 30 elapsedSinceUpShift: 78731633  NEW _octreeSizeScale= 1.17965e+07
[DEBUG] [09/10 09:33:09] adjusting LOD DOWN... average fps for last  0.5 seconds was  29.0074 minimum is: 30 elapsedSinceDownShift: 533320  NEW _octreeSizeScale= 1.06168e+07

By the way, the [DEBUG] [09/10 09:32:44] HMD Tools: Whoa! What are you doing? You don't want to move me to the HMD Screen! part is buggy, the window appeared on my main monitor, not on the rift. But that only happened the second time I started it, the first time it was correctly moved to the rift.

So… Can anyone actually run hi-fi with mesa with the rift DK2 right now?