# VR in FreeBSD



## kpedersen (Jul 10, 2019)

Hi all,

I am in the early stages of planning a new research project involving spatial audio and learning. It basically involves a VR headset and a fairly straight forward OpenGL application.

I was just interested to hear about anyone else's experience with it. There is not much actual technical knowledge on the internet other than kids just fiddling about with VR plugins in toys like Unity. So far my findings:

For the Oculus Rift, Facebook's *libOVR* is Windows only and the older versions are Linux only. It is a shame, I really quite liked the look of this API for the binding between OpenGL, you basically just create some GL frame buffers and attach them to the system. I am quite happy to use an older hardware (Oculus Rift DK1/2) but I am past the point where I actually can be arsed with Linux any more XD

For the HTC Vive, Valve has created what initially looked great, called *OpenVR*, basically a specification that wraps many VR headsets. Unfortunately the only implementation is called *SteamVR* where it has a dependency on Steam which I simply cannot accept the license agreement of (I don't like to be digitally raped). Also this is Windows, Ubuntu and macOS only without frigging about with Wine (if it wasn't for the Steam DRM, I would possibly take this route). I have very little respect for developers who tie their own work and efforts to invasive DRM schemes like Steam. Valve has really done a disservice to the VR community here, shame on them.

So the next is *OSVR* (Open-Source VR) which is basically vapourware with a bunch of hardware offerings which simply do not exist to purchase. I hate this kind of thing.

So next is *OpenXR* (https://www.khronos.org/openxr) - Khronos's offering. Now I like OpenGL as a specification but unfortunately there are very few implementations of the OpenXR spec. Loads of companies (Valve, Facebook) all are members, but have not contributed *any* code. What a bunch of absolute arses. Ultimately I predict that OpenXR will be dominant in the future. There is one implementation called Monado which is Linux only and looks fairly OK but then I saw that it depends on OpenHMD...

*OpenHMD* (http://www.openhmd.net/) used directly so far looks to be the best solution for VR. It's provided drivers supports some Oculus Rift hardware and the Vive hardware (rotation sensors supported but no movement or input, which is fine for this project).
The drivers themselves are all provided with OpenHMD in a monolithic manner, this is great.
It provides its own API which is a little bit manual, i.e you need to simply render the scene twice with different view matrix and also compile up a suitable distortion shader to undo the lenses bending the light but it all looks manageable and there is some (messy and outdated) sample code that does the general tasks using the fixed function pipeline. That said, these guys look like the only people to have actually done some work, reverse engineering the crap churned out by the VR corporations.

So I have compiled a binary up on FreeBSD and it is running with a dummy device but unfortunately I have display port on my GPU not HDMI, so I will have to resume it later this week with an (ironically) older GPU! The great news is that you don't need a stupidly high end gamer graphics card to use, unlike the proprietary drivers and the artificial limitations in the proprietary installers. It seems it is even runnable on a Raspberry Pi (http://www.openhmd.net/index.php/showcase/vr-zero-pri/)

So, that is my findings this far. All in all, it was a terrible state of affairs, overly monetising a very early technology almost to death. Almost everything is for a consumer, everything is pretty flakey and hobbiest. I will keep this thread up to date if I run into any other issues.

tl;dr
VR is a mess on all platforms, but it seems like it can work if you avoid all the idiots. How is anyone else finding it?


----------



## Sevendogsbsd (Jul 10, 2019)

I am just an end user: own an Oculus Go. I love it and it works very well. I realize that is not of any help, sorry


----------



## kpedersen (Jul 10, 2019)

Sevendogsbsd said:


> I am just an end user: own an Oculus Go. I love it and it works very well. I realize that is not of any help, sorry


Heh, the Oculus Go is many more generations newer than the open-source drivers can support but one day I might get to play with one 

Does it feel fairly solid? We have a few older headsets and most of them feel pretty robust other than the non-blue Vive. It feels like paper. I don't know how many participants that would support before it falls apart.

It must also be nice to own a personal one... the ones we have at work are not hygienic with the amount of "person essence" from many of us nerds soaked into the sponge fascias


----------



## Sevendogsbsd (Jul 10, 2019)

I just got it for Christmas last year - wife got it for me. It's very robust and fits well. Battery life is good and the remote is easy to use. I can pair it with my phone and push content to it, although with a wifi connection itself, that's not necessary. I do find I have to sit down in a swivel chair (office chair) to use it or I tend to lose my balance! Boot time from power on is almost instant - I get the Oculus logo then I am at the home screen. I do find some of the content is not well done and is blocky, while other content is great and you think you are there.


----------



## dimensionality (Jul 11, 2019)

So far I have only gotten OpenHMD working on Linux, last I tried on FreeBSD I had some inexplicable USB problems, I could get the display working (Rift CV1 so it needs to be activated over USB which turned out to be a real headache) but not get any orientation readings. I experiment with trying to improve my "memory palaces" style memorisation with some hacks to the VR "desktop" Safespaces ( https://arcan-fe.com/2018/03/29/safespaces-an-open-source-vr-desktop/ ).


----------



## kpedersen (Jul 11, 2019)

dimensionality said:


> So far I have only gotten OpenHMD working on Linux, last I tried on FreeBSD I had some inexplicable USB problems, I could get the display working (Rift CV1 so it needs to be activated over USB which turned out to be a real headache) but not get any orientation readings.


I notice that the port is actually quite out of date (~0.2.0). When you tried, did you compile openhmd from the latest upstream sources (~0.3.0)? It seems that quite a lot has happened between those versions.


----------



## TheOnlyJoey (Jul 11, 2019)

Hey OpenHMD developer here!
FreeBSD actually has been supported by OpenHMD since 0.2.0 and even had some love by contributors to get it working on other BSD types (OpenBSD being one).



dimensionality said:


> So far I have only gotten OpenHMD working on Linux, last I tried on FreeBSD I had some inexplicable USB problems, I could get the display working (Rift CV1 so it needs to be activated over USB which turned out to be a real headache) but not get any orientation readings. I experiment with trying to improve my "memory palaces" style memorisation with some hacks to the VR "desktop" Safespaces ( https://arcan-fe.com/2018/03/29/safespaces-an-open-source-vr-desktop/ ).



As kpedresen mentioned, have you compiled from source? 0.2 did not have support for the CV1 as you can see on our devices list (http://www.openhmd.net/index.php/devices/)
If there are any bugs, please let us know, BSD support is something i always like supporting.


----------



## dimensionality (Jul 12, 2019)

TheOnlyJoey said:


> Hey OpenHMD developer here!
> FreeBSD actually has been supported by OpenHMD since 0.2.0 and even had some love by contributors to get it working on other BSD types (OpenBSD being one).
> 
> 
> ...



It was from source, both the in-source and dynamic shared. The display turns on so I don't think it is directly OpenHMDs fault, but rather something else with my USB stack / chipset. Vacation in a few weeks then I'll go back to see if it got fixed by itself or figure out who to blame.


----------



## BSD User (Jul 18, 2019)

End user - HP Windows Mixed Reality Headset. I abandoned everything related to creating and editing graphics on FreeBSD ages ago. It’s not worth the time end efforts. I use Windows for gaming, 3d modeling and 3d printing. Played with VR features in Unreal Engine. The engine is ported to FreeBSD, there’s a thread on this forum somewhere. You might want to try it out. https://docs.unrealengine.com/en-US/Platforms/VR/index.html


----------



## malavon (Jul 19, 2019)

BSD User said:


> The engine is ported to FreeBSD, there’s a thread on this forum somewhere


I'd welcome anyone trying to do something with UE4 on FreeBSD, especially fringe things like VR. It's always good to know what works and what doesn't.
That said, OP kpedersen is definitely aware of that already


----------

