WayneKeenan / python-vrzero

86 stars 20 forks source link

DK2 on Pi 4 not working #14

Open 69K-ram opened 3 years ago

69K-ram commented 3 years ago

First of all, thank you for updating it. I really appreciate it. No way I would have managed anything close to this without this. I followed the updated install instructions but with -DDRIVER_OCULUS_RIFT=ON instead of PSVR, and without copying the PSVR config.txt file. The demos work, it’s displayed on my monitor and it tracks the headsets rotation, but I can’t get it to output to it. I took the PSVR config and replaced the CVT with the stuff from the original DK2 file. I’ve messed around with a lot of the settings, but I can’t get even a white screen on the headset. It worked on Pi3 though, so one of the commands must not work/work differently on Pi4. I see you are using PSVR now, so if you do try to fix it, don’t try too hard. I’m just wondering if you know what it might be

WayneKeenan commented 3 years ago

The Pi4 is indeed a slightly new ball game and I don't know what is wrong with the timing settings on a Pi4.
I still have a DK2 but it's not with me, so not sure when I will get to try stuff out.

69K-ram commented 3 years ago

Ok, I’ll try messing with the settings today after school. I’ll comment if I get it working

69K-ram commented 3 years ago

LETS GO I FIGURED IT OUT! Probably took me far longer than it should have, but at least it works now. The issue is that the Pi4's HDMI pipeline outputs two pixels per clock cycle, so all horizontal timings must be divisible by two. The timing config for the DK2 has a couple odd numbers in it, so that's what caused the issue. I have it working now with: hdmi_timings=1080 1 32 10 14 1920 1 2 2 12 0 0 0 75 0 165000000 3, but it might not be ideal. Also the VC4 FKMS V3D driver does not support 90 or 270 degree rotations, so you have use the commands here

Should I close this now or close it after I update with a full Pi4 DK2 config.txt?

69K-ram commented 3 years ago

My working config.txt file:

disable_overscan=1
hdmi_force_hotplug=1
dtparam=on
[pi4]
# Enable DRM V3D driver on top of the dispmanx display stack
dtoverlay=vc4=fkms-v3d
max_framebuffers=2

[all]
gpu_mem=256

hdmi_timings=1080 1 32 10 14 1920 1 1 1 12 0 0 0 75 0 165000000 3
hdmi_group=2
hdmi_mode=87
max_framebuffer_width=1080
max_framebuffer_height=1920
hdmi_ignore_edid=0x5000080
hvs_priority=0x32ff
hdmi_max_pixel_freq=400000000

Oh and then just use xrandr --output HDMI-1 --rotate left or DISPLAY=:0 xrandr --output HDMI-1 --rotate left the first says it can't recognize display, but that might just be something with setup

WayneKeenan commented 3 years ago

That's great, many thanks for looking into it and posting the config file.

I'll probably make it easier (or at least properly document) how to use either PSVR or DK2 for Pi3 and Pi4, now I know at least one other person is using a DK2. :)

There's also a ticket I've just reopened on the rotation aspect (#5)

samcorsentiono commented 1 year ago

I am trying to configure an Oculus to work on a Pi400 for my college senior project. Following your code and wanting to ask if you have any updates or suggestions. I have both a DK2 and Oculus Rift - you used the DK2 but Oculus no longer supports it and finding code for it has been challenging - whole project has been an interesting challenge. Running into several roadblocks during the programming.