A simple Oculus Rift test application targeted at the Raspberry Pi.
The goal is to evaluate how the Raspberry Pi performs with the Rift and check whether it can handle it (the answer: yes to some extent!). Rendering is done using OpenGL ES 2.0. Accessing the Oculus Rift API is done through the Oculus SDK with a minor fix for the Raspberry Pi.
More information about this project can be found here: http://bitoniau.blogspot.fr/2014/04/oculus-rift-on-raspberry-pi.html
Tested on:
Install gcc and cmake
sudo apt-get install build-essential cmake
Packages required for Oculus LibOVR
sudo apt-get install libudev-dev libxext-dev mesa-common-dev freeglut3-dev libxinerama-dev
git clone https://github.com/jbitoniau/RiftOnThePi
In struct AtomicOpsRawBase (at around line 94), replace the code in the OVR_CPU_ARM defined section with this:
#elif defined(OVR_CPU_ARM)
//struct FullSync { inline FullSync() { asm volatile("dmb\n"); } ~FullSync() { asm volatile("dmb\n"); } };
//struct AcquireSync { inline AcquireSync() { } ~AcquireSync() { asm volatile("dmb\n"); } };
//struct ReleaseSync { inline ReleaseSync() { asm volatile("dmb\n"); } };
#define MB() __asm__ __volatile__ ("mcr p15, 0, r0, c7, c10, 5" : : : "memory")
struct FullSync { inline FullSync() { MB(); } ~FullSync() { MB(); } };
struct AcquireSync { inline AcquireSync() { } ~AcquireSync() { MB(); } };
struct ReleaseSync { inline ReleaseSync() { MB(); } };
mkdir Build
cd Build
cmake .. -DCMAKE_BUILT_TYPE=Release
make
RiftOnThePi/RiftOnThePi
RiftOnThePi --StereoRenderTechnique=<0 to 3> --DistortionScaleEnabled=<0 or 1> --AnimationEnabled=<0 or 1> --UseRiftOrientation=<0 or 1>
It was faster and more practical to develop this application on a Windows desktop machine. RiftOnThePi therefore also works on Windows using the AMD OpenGL ES SDK (you must have an AMD graphics card though). Here are the steps to compile the code: