Getting Oculus Rift CV1 to work on Linux. Currently on Raspberry Pi 4b with Ubuntu 22.04. I am using full fat 'kms' kernel display system, not the old 'fkms'. This is partially the reason for this exercise.
This is a work in progress and its possible that some steps are actually not required. I'll update as I'll figure out more.
If you have any information that you think might help please add an 'Issue' to let me know!
Current Steps:
-
Copy the file 83-hmd.rules to
/etc/udev/rules.d/
-
Copy the modded edid from this repo modified_rift_edid_01.bin to
/lib/firmware
This edid has been hacked so that the Kernel won't take notice of the 'non-desktop' attribute which is hindering the display from getting recognized and take signal. You can compare with the un-modified edid to see how that was done. I got some help doing the edid hack as I didn't know how to find and change the right data. (the hack doesn't actually change the attrib value it changes the display model id)
Read more here about how the Linux kernel handles the attribute, look for 'EDID_QUIRK_NON_DESKTOP'
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_edid.c
-
Edit cmdline.txt to have this before 'rootwait'
video=HDMI-A-2:2160x1200M@90e drm.edid_firmware=HDMI-A-2:modified_rift_edid_01.bin
The above line assumes you are using the secondary hdmi port on the Rpi4b. -
Reboot
When you return you might not get a good login screen at least I don't. I can't see a field to put user name. -
go to tty3, start up riftDriverPi
https://github.com/OhioIon/riftDriverPi
(Don't press any keys after you started this, other than to switch tty)
This is currently needed to wakeup the Rift and keeping it alive. The orange light in the headset should go white and you should see the tty screen in the Rift. So far I haven't found another way to get the Rift screen alive.
- go to tty2, run kms-vulkan
https://github.com/nyorain/kms-vulkan
I'm currently hacking in a line in device.c just after
for (int i = 0; i < ret->res->count_connectors; i++) {
to skip past the first out device (my monitor) by doing
if(i==0) continue;
For me this program currently fails setting up for Vulkan rendering but falls back to OpenGL.
Notes:
- Look for Rift display mode to be present in return of
modetest -c
ToDo:
- Figure out how to get the display modes to allow Desktop to co-exist.
I did find a way but it then does not work from tty. See wiki page. - Find a easy to follow Vulkan kmsdrm/direct render example.
- Get a stereo/multiview example using Vulkan working on Raspberry Pi4b.
Actually this is working now see: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6882
but running disappointingly slow even when pointing the camera to empty space.