Forum Discussion
nsb
12 years agoHonored Guest
Basic Linux Rift library with OpenGL in C
Ok, don't get too excited. This is a very simple C port of the SDK 1.5 library. I did this mostly to satisfy my own curiosity, but if there is enough interest, I'm willing to make it a more complete project.
Right now all it will do is connect to the Rift, open up a GL window, and move an arrow around to follow the HMD tracker. Now that the new SDK is out, there are GL shaders which I'll work into the simple demo scene for the next pass.
I'm still playing around with this, but tf there is interest, I can put the code up in a private git repo so others can contribute.
Enjoy
-nsb
Right now all it will do is connect to the Rift, open up a GL window, and move an arrow around to follow the HMD tracker. Now that the new SDK is out, there are GL shaders which I'll work into the simple demo scene for the next pass.
I'm still playing around with this, but tf there is interest, I can put the code up in a private git repo so others can contribute.
Enjoy
-nsb
73 Replies
- ConzExplorerNice one. I haven't tested it yet.
Could this be a solution for implementing the rift in GPL software? Please choose a GPL compatible license for it. There is some interest to include the Rift inside the Blender GameEngine. Blender is under GPL, and the Rift SDK is not compatible with the GPL.
So it would be important to have a GPL solution for the Rift, not only for Linux, but for all big OS (Win, Mac, Linux), too. - nsbHonored GuestI have no problem making my code GPL or free, but because the current library heavily leverages code from the SDK, the final license must agree with the SDK license. That having been said, the only truly proprietary information is the format of the HID packets that the tracker delivers. The sensorFusion stuff could probably be independently derived by someone sufficiently versed in that sort of math (read: not me). Maybe Oculus could be convinced to opensource some of that, but that remains to be seen. For now, I would treat everything here as an extension to the main SDK.
- JWBHonored GuestKudos.
I've been scratching my head a bit trying to figure out how to test if my build of the SDK was working. If your Makefiles are any indication, then I was at least issuing the incantation properly (albeit with g++). I couldn't get the the first section of the Minimal Oculus Application to build against the SDK, I was probably making a simple mistake, but I gave up pretty quickly to instead read the (dated) Linux Device Drivers book.
Have you had success with the official (1.5) SDK and the Minimal Oculus Application? Your Makefiles should be simple to update for the SDK.
I'd also like to report a build success: x86_64, Linux kernel 3.8.8, but I don't have a rift to test it fully."nsb" wrote:
... [if] there is interest, I can put the code up in a private git repo so others can contribute.
Well, you left .git in the the gl-matrix.c directory, complete with staged changes: might as well make a full repo of it. ;)
Are we prohibited from using an online service like bitbucket or github due to the nature of the SDK, which is why you're proposing a private repo? - nsbHonored Guest
"JWB" wrote:
Have you had success with the official (1.5) SDK and the Minimal Oculus Application? Your Makefiles should be simple to update for the SDK.
I actually started with the SDK, trying to create a sibling OVR_Linux_xxx driver class and then decided ( after reading the "The SDK is too object oriented" post here) that starting with a basic C library would be easier and more useful to more people, so I switched."JWB" wrote:
Well, you left .git in the the gl-matrix.c directory, complete with staged changes: might as well make a full repo of it. ;)
That should be the .git from the github pull of gl-matrix.c (I hope) - I haven't modified that at all."JWB" wrote:
Are we prohibited from using an online service like bitbucket or github due to the nature of the SDK, which is why you're proposing a private repo?
Yeah, that was the reason for suggesting the private repo - I'm more than happy to put everything on github, but I was working under the assumption that that the SDK wasn't for public consumption. I inquired about permissions for this a few days ago, but haven't heard anything yet. - atavenerAdventurer> make
> linuxtest
Success! Rift is found, and tracking shown. And holy cow did you base that OpenGL off a 1.0 version of the Red Book? ;)
Very nice though! I've been stuck trying to get queries back using libusb (and distracted by playing with distortion shaders). It looks far more straightforward with hidraw (at least there is correspondence to the OVR SDK's communication with the device).
This is the basic functionality I'm going for. Though I'd make threads optional for the application to handle that itself (potentially without pthreads), and I'm using libusb hoping that allows for a cross-platform library with minimal system-specifics.
Now I might be distracted by your working implementation. :) - geekmasterProtege
In file included from OVR_HID.c:8:0:
OVR_HID.h:9:2: error: #error Update Kernel headers
...
$ cat /proc/version
Linux version 2.6.38-8-generic (buildd@vernadsky) (gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu3) ) #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011
Running Linux Mint 11 in VirtualBox. Any ideas what to do? TIA... - nsbHonored GuestHeh! Yes, it's very GL1.0 - that's what happens when you play with GL for awhile and then get sidetracked for a decade writing embedded firmware.
I agree about pthreads - I left it in there for initial simplicity, but if this gets any traction, I'll either make a _t version of the lib or make it a configure option.
For added portability, it could probably use this for the HID stuff: http://www.signal11.us/oss/hidapi Looks like their BSD license would be compatible. - geekmasterProtegeI am not familiar with the "Update kernel headers" error, and Google is not helping me. Any ideas what I should do to compile this?
- nsbHonored Guest
"geekmaster" wrote:
Running Linux Mint 11 in VirtualBox. Any ideas what to do? TIA...
You can just delete the line:#error Update Kernel headers
...from OVR_HID.h and try again. The only platform I've tried this on so far is Ubuntu 12 x64, so there will be differences from what you're running. - geekmasterProtegeCommented out the error line. It is built. It runs. My Rift shows in lsusb 2833:0001. With only one monitor, I am getting no tracker data from my RIft. But with two monitors it finds the Rift, but then OpenGL crashes. My linux mint has fits when trying to run multiple monitors (RandR issues). Last time I have mulitple monitors running I had to muck with xorg.conf and set one as a generic monitor.
I suppose I need to try a different linux. But it looks promising. I should try to build the minimal app (my C version) against this. I need tracker data now.
https://developer.oculus.com/wiki/Tracker_Data_for_C
I can deal with OpenGL issues later.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 5 months agoAnonymous
- 3 months ago