Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oculus Rift S Support #225

Closed
racerxdl opened this issue May 20, 2019 · 104 comments
Closed

Oculus Rift S Support #225

racerxdl opened this issue May 20, 2019 · 104 comments

Comments

@racerxdl
Copy link

racerxdl commented May 20, 2019

I know there is no support yet (since it not even got release oficially).

But I got the pre-order for Rift S and I plan to contribute with OpenHMD to support.

So I'm just adding this issue so I do not forget about it, and if someone also have one (or will have) and want to help, it can use this issue.

@alokdhir
Copy link

alokdhir commented May 25, 2019

Got my Rift S; added the device ID to rift.c with some other minor edits, but it didn't seem to work. examples/simple just spits out zeroes.

diff --git a/src/drv_oculus_rift/rift.c b/src/drv_oculus_rift/rift.c
index c8bc96f..d59cfa7 100644
--- a/src/drv_oculus_rift/rift.c
+++ b/src/drv_oculus_rift/rift.c
@@ -47,7 +47,7 @@ typedef enum {
        REV_DK1,
        REV_DK2,
        REV_CV1,
-
+       REV_RIFTS,
        REV_GEARVR_GEN1
 } rift_revision;
 
@@ -280,7 +280,7 @@ static ohmd_device* open_device(ohmd_driver* driver, ohmd_device_desc* desc)
        set_coordinate_frame(priv, priv->coordinate_frame);
 
        // Turn the screens on
-       if (desc->revision == REV_CV1)
+       if (desc->revision == REV_CV1 || desc->revision == REV_RIFTS)
        {
                size = encode_enable_components(buf, true, true, true);
                if (send_feature_report(priv, buf, size) == -1)
@@ -362,7 +362,8 @@ static ohmd_device* open_device(ohmd_driver* driver, ohmd_device_desc* desc)
                        ohmd_set_universal_distortion_k(&(priv->base.properties), 1.003, -1.005, 0.403, 0.599);
                        ohmd_set_universal_aberration_k(&(priv->base.properties), 0.985, 1.000, 1.015);
                        break;
-               case REV_CV1:
+       case REV_CV1:
+       case REV_RIFTS:
                        ohmd_set_universal_distortion_k(&(priv->base.properties), 0.098, .324, -0.241, 0.819);
                        ohmd_set_universal_aberration_k(&(priv->base.properties), 0.9952420, 1.0, 1.0008074);
                        /* CV1 reports IPD, but not lens center, at least not anywhere I could find, so use the manually measured value of 0.054 */
@@ -428,6 +429,7 @@ static void get_device_list(ohmd_driver* driver, ohmd_device_list* list)
                { "Rift (DK2)", OCULUS_VR_INC_ID, 0x0021,       -1, REV_DK2 },
                { "Rift (DK2)", OCULUS_VR_INC_ID, 0x2021,       -1, REV_DK2 },
                { "Rift (CV1)", OCULUS_VR_INC_ID, 0x0031,        0, REV_CV1 },
+               { "Rift (RIFTS)", OCULUS_VR_INC_ID, 0x0051,      0, REV_RIFTS },
 
                { "GearVR (Gen1)", SAMSUNG_ELECTRONICS_CO_ID, 0xa500,    0, REV_GEARVR_GEN1 },
        };
~

@TheOnlyJoey
Copy link
Member

probably something with the package format or something like that, a wireshark dump would be really nice to get started for us, since no one has a S in our team.

@alokdhir
Copy link

wireshark dump

I've done this for network connections but never USB .. I assume you mean something that's dumping USB?

@TheOnlyJoey
Copy link
Member

wireshark can do usb capture as well! look for usbmon/usbpcap

@alokdhir
Copy link

TIL! OK - will figure this and get something over to you next day or so.

@alokdhir
Copy link

BTW - I'm on a Mac. Not sure if that makes a diff.

@racerxdl
Copy link
Author

So the Rift S has two virtual USB 3.0 Hubs which has the following devices:

Following filter control devices are available:
1 \\.\USBPcap1
  \??\USB#ROOT_HUB30#4&2dadcc96&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
    [Port 1] Rift S USB Hub
      [Port 2] USB Composite Device
        Dispositivo Serial USB (COM3)
        Rift S
          Fones de ouvido (Rift S)
        Rift S
          Microfone do Headset (2- Rift S)
        Dispositivo de Entrada USB
          Dispositivo compatível com HID
        Dispositivo de Entrada USB
          Dispositivo compatível com HID
        Dispositivo de Entrada USB
          Dispositivo compatível com HID
    [Port 17] Rift S USB Hub
      [Port 1] USB Composite Device
        Rift S

I did a USBPcap recording while it was working (I did through the first setup). I will upload it shortly.

@racerxdl
Copy link
Author

Ok, here is the Wireshark recording of the USB Hub. I just hope I got right since I never did that in Windows: https://www.teske.net.br/lucas/rift/RiftUsbCapture.7z

I will try to nail down each device.

@racerxdl
Copy link
Author

And that's the full list of VID/PID

USB Hubs:
	VID_2833 PID_2051 MSFT301WMGH520H79173
	VID_2833 PID_2052 MSFT201WMGH520H79173

Audio Devices:
	VID_2833 PID_0051 MI_02 | 7&1e8c9aa7&0&0002
	VID_2833 PID_0051 MI_04 | 7&1e8c9aa7&0&0004

HID Devices:
	VID_2833  PID_0051 MI_08 | 8&1455fa0&0&0000
	VID_2833  PID_0051 MI_06 | 8&ace51dd&0&0000
	VID_2833  PID_0051 MI_07 | 8&1908ebe5&0&0000
	VID_2833  PID_0051 MI_06 | 7&1e8c9aa7&0&0006
	VID_2833  PID_0051 MI_07 | 7&1e8c9aa7&0&0007
	VID_2833  PID_0051 MI_08 | 7&1e8c9aa7&0&0008

@Akm0d
Copy link

Akm0d commented May 31, 2019

SteamVR in windows seems to think there are 3 base stations present with the Rift S. I wonder if the tracking of ground and controllers are handled on the device and pass data to virtual base stations or if the hmd driver would need to process data from all the cameras and IMUs. Either way.... i think a guardian/calibration/setup will need to be implemented on *nix systems for the Rift S to work properly.

I hope those HID Devices are 3 virtual base stations, 2 controllers, and a helmet. That would make everything easier.

@racerxdl
Copy link
Author

Yep. Thats correct @Akm0d. And also the oculus software when running in passthrough (camera view), doesnt show anything in the Mirror on the pc, which means the camera data never goes back via usb 3.

I might have more time this weekend to play a bit and make some PoC code that can read everthing.

@racerxdl
Copy link
Author

racerxdl commented Jun 2, 2019

Ok just as reference, the three Rift HIDs are named:

0: "Rift S Tracking Data"
1: "Rift S System State"
2: "Rift S Controller Data"

The other two that windows finds as HID:

0: USB-CDC Modem ( loads as /dev/ttyACM0, has debug messages from the headset)
1: Nothing on Linux ( RAW USB data shows that it might be camera data, but I couldn't parse images)

So @Akm0d I was wrong about the HID Devices. Still I don't see a lot of traffic on the "camera" device when its running in-game, I just see when the passthrough mode is enabled somehow. Maybe thats used for mirror?

@racerxdl
Copy link
Author

racerxdl commented Jun 2, 2019

Also, I can't get the video to be enabled in my linux, not even with the HMD setting at nvidia config.

@Akm0d
Copy link

Akm0d commented Jun 3, 2019

On windows you get camera passthrough during guardian setup and when you leave the guardian area, I wonder if there is some kind of flag or command to trigger receiving that data over USB. I haven't poked around with it too much in linux... I'll see what I can find out some nights this week.

@racerxdl
Copy link
Author

racerxdl commented Jun 4, 2019

@Akm0d I mean, if you enable oculus mirror, it usually doesn't show the passthrough camera in the PC side.

Anwyays, figured out some stuff. If you write 0x1 to HID report 0x14 of "Rift S System State", it turns on the Camera device (it popus up as UVC on linux) and enables the controllers. If you send 0x1 to Report 0x02, it turns on the HMD.

I did a small snippet that does that:
https://gist.github.com/racerxdl/02731a85193e2bbbbb7e25eda2dd9618

Will work more soon.

@racerxdl
Copy link
Author

racerxdl commented Jun 9, 2019

Ok, after few more tests I also narrowed down the RiftS initialization procedure:
https://gist.github.com/racerxdl/0152d59e64a38c4d7b8e4f25169334b8

This will make it available in the Display Port with the AllowHMD setting in NVidia.
Funny thing is that on my Laptop with a GTX 980 it says that 1440x2560@80 is over my hardware capacity (on windows works fine), but in my desktop with a GTX 1060 it opens fine.

image

Still, I got no image at Rift S. The Rift S log say its running fine:

1525236 [debug  ] {ANX }: Event 3 (VIDEO_STREAM_STABLE)
1525237 [debug  ] {ANX }: Event 17 (DP_LINK_READY)

About the controllers, they can be found at Interface 0x08.
The reports that come in are from both controllers. Discarding the CMD byte this is what I got so far:

def ParseController(data):
  reportId = data[0]
  controllerId = binascii.hexlify(data[1:9])
  data = data[9:]

  c = " (%02d " % ord(data[0])
  v = struct.unpack("<I", data[1:5])[0]
  c += " %d) " % v

  if ord(data[0]) != 32:
    return

  data = data[5:]

  c += "(%03d " % ord(data[0])
  o, v = struct.unpack("<HH", data[1:5])
  c += " %05d %05d) " % (o, v) // Packet Counter
  data = data[5:]

  s = struct.unpack("<H", data[:2])

  c += " %05d " % s

  data = data[2:]

  s = struct.unpack("<3h", data[:6])
  c += " (%05d %05d %05d)" % s // Acell


  data = data[6:]

  c += " (%05d %05d %05d) " % struct.unpack("<3h", data[:6]) // Gyros

  data = data[6:]

  print "%s: %s [%s]" % (controllerId.upper(), c, toHex(data).upper())

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jun 15, 2019

@racerxdl Bruh. People like you are the heroes that make Linux thrive (and, in this case, MacOS gaming by extension). I know you still have to get an image from the S, but you've already done a lot in such a short time. +1 for your efforts, and for the project as a whole.

Edit: Will try this script for myself since I have a Rift S, and I'll post how that goes here.

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jun 15, 2019

@racerxdl Not sure what I did wrong, but I got a bunch of compiler errors with both scripts. Which C compiler/version did you use? (Sorry if this is a dumb question, I don't know much about the differences between compilers and versions!)

Edit: I used Linux Mint as my OS, and I tested with GCC (and G++) version 7.4.0. Thought you should know since I asked you.

@racerxdl
Copy link
Author

@EdgyBama GCC 7.3, standard from ubuntu 18.
Then I just run

gcc rifts-init.c -lhidapi-libusb -o rifts-init

Should work fine in 7.4 as well. What are the errors?

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jun 17, 2019

@racerxdl I don't remember what the errors are, but it doesn't really matter anymore, since your command compiled the code, with some warnings, and I was able to run the script properly.

I'm pretty sure, since I've never compiled c or c++ using any libraries before, that I mistook the "l" for an "I" when typing my command initially.

I'll post the warnings below if you really need them, but they seem like something you're already well aware of.:

} __attribute__((aligned(1), packed));
^
rifts-init.c: In function ‘main’:
rifts-init.c:66:19: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘const wchar_t * {aka const int *}’ [-Wformat=]
    printf("FAIL %s\n", hid_error(hid));
                 ~^     ~~~~~~~~~~~~~~
                 %ls
rifts-init.c:77:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
  printf("%d\n", sizeof(devInfo));

Edit: just for clarification, I tested both scripts. Both (appear to) work.

Edit 2: Wow. I really need to clarify my results the first time.

rift-s-test results:

6
7
FOUND
4a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
4a 00 0d 00 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
4a 00 0d 00 00 00 00 0c 3e 3e 03 c1 df f8 88 86 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
4a 00 0d 0c 00 00 00 12 7b 22 74 68 72 65 73 68 6f 6c 64 22 3a 33 37 38 7d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

rifts-init results:

FOUND
06 a0 05 00 0a 01 00 50 fe 03 ef 01 5d 00 5d 00 06 00 01 00 02 00 
22
Horiz: 2560
Vert: 1440
Hz: 80
Unk0: 1
Unk1: 32441342
Unk2: 6094941
Unk3: 65542
Unk4: 2
Sending 0x0A 0x02

It does not turn on the physical screen like you said, but the white LED lights up and the screen shows up in the NVidia settings.

@racerxdl
Copy link
Author

The warnings I get here, is just because I didn't bothered to make it the right way (since its just a test snippet). They're harmless for that case.

I still need to do some more work on Rift-S stuff, sadly it looks like I can't get it to work in my laptop with the GTX980 so I will need to use my desktop that has two GTX 1060. I'm just wondering why there is no image since there is not much more payloads the headset receives from USB (most of the payloads are flash memory control to get settings from the headset itself).

This week there is a holiday in Brazil so I will have more time to check it.

The only sad thing is that I have no other headset to compare with, so I have no clue how one of these should work.

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jun 18, 2019

If I remember correctly from using the Rift S on Windows 10, the headset didn't show any image until I turned on the Oculus App (from FB's Website), SteamVR will not start without it. The Oculus App, when Opened, opens the Oculus Desktop (by default), turns on the cameras, etc, etc. Not sure if me telling you this helps you out any.

I'm saying there might have to be a call from the OS/OpenHMD (possibly using some Open Source VR Desktop) that is used to turn on the Headset Display, potentially using your existing payload information.

Edit/Disclaimer: I know very little about how OpenHMD/Rift S Hardware Support actually works. I do have a general idea about how hardware and OS calls work, and have a pretty good understanding of how to do general troubleshooting, and that's where my hypothesis comes from.

Also have fun on your vacation!

@racerxdl
Copy link
Author

The call from Oculus App is the one you just ran there. The headset display chipset is a ANX7533 (https://www.analogix.com/en/system/files/AA-004747-PB-1-ANX7533_0.pdf) with a FPGA for Camera Processing. The Oculus App also deals in a generic way regarding any supported headset (the drivers in the windows are just generic HID, so the app controls everything). So its probably something stupid that I let pass.

Also just for completeness, the LCD screen is a LS055R1SX04. Funny enough, its overclocked in the Rift S (Probably by low persistence / reduced range).

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jun 18, 2019

Gotcha.

as for not having another headset to compare with, post the link to your results when you're ready and the minute I get a chance I'll test it out with my Rift S like I did before 👍 .

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jun 18, 2019

I can't believe I didn't state my specs after posting that it worked for me:

Linux Mint 19.1
NVidia Geforce GTX 1060 6GB (one card)
~32 GB DDR4 RAM
160 GB, 4 TB, & 2 1 TB HDDs,
Intel i7 6700k X 8 X 4.0 GHz
Hope this helps!

Edit: Dependency issue forced me to switch to Manjaro 18. Everything else still applies.

@TheOnlyJoey
Copy link
Member

TheOnlyJoey commented Jul 5, 2019

@racerxdl Have you put any work into wrapping it into a OpenHMD driver? or would you like some help with that. If so please post the latest gist you have and i can get working on that.

Also keep in mind that on the CV1 you need a application opening the usb device and active on the Oculus screen before the screen enables, might be part of the issue you are having

@racerxdl
Copy link
Author

racerxdl commented Jul 5, 2019

Hi @TheOnlyJoey, to be honest I haven't put too much work on it because for some reason I have some limitations on my GTX 980 which didn't happend on the GTX 1060. So I waited until I finished building my desktop to continue the work.

The current status is: The Rift S shows as a secondary screen on linux with the correct resolution (2560x1440) and right refresh rate, the controllers are received on USB but the rift does not display the image even the status led showing its OK. I think I might missed some USB transactions, so I need to take a deep look on that. Besides that, I will need some help wrapiing into OpenHMD driver, mainly because: to get the Rift S running, there are two USB devices that I need to talk, and OpenHMD assumes that there is only one VID/PID/Interface wrapped.

@racerxdl
Copy link
Author

racerxdl commented Jul 5, 2019

Ok so I haven't saw the #231 PR, I will check that to see how it was managed in CV1.

@TheOnlyJoey
Copy link
Member

TheOnlyJoey commented Jul 5, 2019

The current status is: The Rift S shows as a secondary screen on linux with the correct resolution (2560x1440) and right refresh rate, the controllers are received on USB but the rift does not display the image even the status led showing its OK.

So as mentioned before, this is exactly the same as the CV1, you need to move a rendered window to the device in order for it to start display anything, while covering the light field sensor that is inside the device.
Otherwise it will show as enabled but not show anything, this is intended behavior.

We also send a keepalive message, might be a good idea to wrap your test into our rift driver and see what it does.

@AutoUpdatingBSoD
Copy link

AutoUpdatingBSoD commented Jul 5, 2019

@TheOnlyJoey Apologies for the potentially stupid question, but I can't find any info on this: Is/are the light field sensor(s) on the Rift S the cameras on the front and side? If not, where is it? I want to try this for myself if I can...

Edit: I know @racerxdl 's changes haven't been posted yet. I'm asking for when it's available.

@r00tman
Copy link

r00tman commented Jun 4, 2020

Yep, thanks for noticing. I just hacked my way through in the cmake file when I was doing it yesterday too and forgot to write about that, sorry

@thaytan
Copy link
Contributor

thaytan commented Jun 16, 2020

I had a quite fruitless attempt at doing my own measurements of the lens distortion over the weekend. Everything I came up with was arguably worse than the CV1 distortion, using the cameras I have on hand. I've ordered a new camera, so I'll try that again in a few weeks.

In the meantime, I just fixed a bug calculating the time delta for IMU fusion that was making the tracking really bad. That's working noticeably better now.

@thaytan
Copy link
Contributor

thaytan commented Jun 22, 2020

I implemented controller support in https://github.com/thaytan/OpenHMD/tree/dev-rift-s this weekend. IMU rotational tracking and controls reports now work.

Very occasionally I see spurious failures at startup with some of the USB traffic reading the controller configuration blocks. That probably needs some retry logic, but in general it seems to work quite well.

thaytan added a commit to thaytan/OpenHMD that referenced this issue Jun 22, 2020
This is a preliminary 3DOF driver for the Rift S headset and
controllers. Rotational IMU tracking and controller
controls are supported. It would also be possible to
publish more from the controllers with additional OpenHMD API,
such as capsense touch information for each button/trigger.

Distortion parameters are taken from the CV1 and need improving,
but aren't completely wrong.

Partially fixes OpenHMD#225
thaytan added a commit to thaytan/OpenHMD that referenced this issue Jun 22, 2020
This is a preliminary 3DOF driver for the Rift S headset and
controllers. Rotational IMU tracking and controller
controls are supported. It would also be possible to
publish more from the controllers with additional OpenHMD API,
such as capsense touch information for each button/trigger.

Distortion parameters are taken from the CV1 and need improving,
but aren't completely wrong.

Partially fixes OpenHMD#225
@exstrim401
Copy link

Can't get Rift S working in SteamVR. It's looking for 2560x1440 screen but my main screen has same resolution and SteamVR choses it as correct. When I disconnect main screen SteamVR is not seeing Rift S at all but HMD appearing in xrandr.
AMD Radeon RX 5700. Arch Linux
vrcompositor log:

Tue Jun 30 2020 14:17:26.618298 - Looking for direct display through RandR
Tue Jun 30 2020 14:17:26.618308 -  - Root 0x6cd
Tue Jun 30 2020 14:17:26.618752 -    - Output 0x55 - 0 modes, 0 preferred
Tue Jun 30 2020 14:17:26.618770 -    - Output 0x56 - 13 modes, 1 preferred
Tue Jun 30 2020 14:17:26.618777 -      - Mode 0 0x68 1280x1024 (looking for 2560x1440)
Tue Jun 30 2020 14:17:26.618791 -    - Output 0x57 - 0 modes, 0 preferred
Tue Jun 30 2020 14:17:26.618806 -    - Output 0x58 - 0 modes, 0 preferred
Tue Jun 30 2020 14:17:26.618814 - Tried to find direct display through RandR: (nil)
Tue Jun 30 2020 14:17:26.618821 - Looking for direct display through Vulkan WSI
Tue Jun 30 2020 14:17:26.618829 - Tried to find direct display through Vulkan WSI: (nil)

xrandr log

@thaytan
Copy link
Contributor

thaytan commented Jun 30, 2020

That's probably better filed as a new issue now that this one is closed and initial Rift S support merged.

@bonkmaykrQ
Copy link

initial Rift S support merged.

Just to clarify, is the Rift S ready to play games yet?

@wizardwatch
Copy link

No. You can check the openhmd website for a list of working devices and their support level.

@thaytan
Copy link
Contributor

thaytan commented Nov 7, 2020

Current support is for 3DOF only (you can look around but not move). Controller buttons work, but without being able to move the controllers around it's only useful in limited situations for now.

@SparkyTD
Copy link

Hello! I just spent the last few days getting balls deep inside RiftS.dll on windows with IDA Pro, and I might have some useful info. I know that you guys can already access the camera streams on linux because it shows up as a standard UVC device, but I have figured out how to access the stream on Windows.

The driver uses the MSMF API (Microsoft Media Foundation), which is a standard backend for webcams, except you need to set an extra flag while enumerating the devices to pick up the Rift S cameras. The easiest way to test this is to clone OpenCV, add one line of code, build it, and make a simple test program. See my issue on opencv for details. In the test app, all you need to do is to open the VideoCapture with the CV_CAP_MSMF flag to force it to use the MSMF backend. Here's a small snippet that displays the sensor stream in a window:

int main() {
    VideoCapture cap;
    cap.open(CV_CAP_MSMF + 0); // +0 is the device ID, but it's obviously not needed here
    cap.set(CAP_PROP_FOURCC, VideoWriter::fourcc('M', 'J', 'P', 'G'));
    cap.set(CAP_PROP_FRAME_WIDTH, 3200);
    cap.set(CAP_PROP_FRAME_HEIGHT, 856);
    cap.set(CAP_PROP_FPS, 60);

    Mat mat;
    while(true) {
        cap >> mat;
        imshow("cam", mat);
        if(waitKey(10) == 27)
            break;
    }
    return 0;
}

Also some more info, probably not as useful, here is a complete list of every single HID data packet (only name, ID and size so far) that can be sent from the driver to the device. These values are scraped straight from the decompiled source code, so they are 'official'. I don't have a lot of time right now, but when I do, I will try to build detailed package descriptions about as much of them as I can.

@AutoUpdatingBSoD
Copy link

I just want to say I'm so glad for Rift S owners that they finally have hope to use the Rift S outside of Windows. Thank you to all of the people in this thread who've actually contributed to this part of OpenHMD.

I don't own mine anymore because it took too much work to get set up on Linux at the time, and I was in Grad School with a bunch of other projects that were more immediately important to me personally to get working. I acknowledge that VR is critical for many people's use cases, I just had others that demanded my attention that second.

I wish I knew more about how Wireshark worked at the time of when I owned my Rift S and had the time to learn more about the differences of C verisons. When I was a full-time Linux user I would have been able to be able to actually contribute had that been the case.

I regret not contributing to this part of the project more when I had the opportunity. Maybe that'll happen when I get the ability to use VR again by way of Mobile Phone Headset/Wii Remote and Kinect (I do not own a Kinect currently which is keeping me from doing this right now), but I'll cross that bridge when I get to it...

@OzzyHelix
Copy link

the Rift S has an AI on board to help with tracking not sure how you should replicate something like that or if its necessary

@SparkyTD
Copy link

the Rift S has an AI on board to help with tracking not sure how you should replicate something like that or if its necessary

The Rift S doesn't have anything "on board". The device is basically a $400 webcam that streams the video from its 5 sensors + some IMU data through the USB cable into the Oculus software, which uses some sort of proprietary SLAM algo to track the movement of the headset. There is only very minimal data processing happening on the device itself.

This can definitely be replicated, and there are already lots of open source projects that do exactly that. (e.g. msckf_vio, Kimera-VIO, ORB_SLAM3, etc...).

I've been working on this a few months ago, and I even made some progress with tracking, but then life got complicated and now I don't have enough time to work on it. But it is 100% doable.

@OzzyHelix
Copy link

if you have tracking working would you be willing to make a pull request or a fork with that I have a Rift S and would love to help test that stuff

@JACKHAHA363
Copy link

Is there support for Oculus quest 2?

@AgentLoneStar007
Copy link

(Sorry if this comment re-opens this issue.) Does anyone know the progress of support for the Oculus Rift S on Linux? I know that OpenHMD doesn't fully support the device yet, and I'm currently struggling to replicate my actually getting the display to work on KDE Plasma, but I was curious if any form of position tracking was close. I recently upgraded my GPU to an AMD Radeon 7900 XT, and now the headset keeps malfunctioning due to an issue in the Windows registry. (Thanks, Microsoft, for your work on this beautiful operating system.)

@lbenard
Copy link

lbenard commented Jun 1, 2023

As far as i know, nothing new :(

@sifiro
Copy link

sifiro commented Jun 1, 2023

Guys, You should change to Monado.
We have HMD/SLAM Tracking already.

@AgentLoneStar007
Copy link

Guys, You should change to Monado.
We have HMD/SLAM Tracking already.

Does it support Oculus Rift S, and does it work on Steam VR?

@thaytan
Copy link
Contributor

thaytan commented Jun 1, 2023

Guys, You should change to Monado.
We have HMD/SLAM Tracking already.

Does it support Oculus Rift S, and does it work on Steam VR?

Yes - I moved the OpenHMD Rift S driver to Monado last year, and development has been happening there instead. Monado has a SteamVR driver implementation.

Controller 6dof tracking is still WIP, but head-tracking SLAM works, and hand tracking

@AgentLoneStar007
Copy link

AgentLoneStar007 commented Jun 1, 2023

Is it possible to use Monado with SteamVR, and is it possible to play VR games like Beat Saber via Proton?

And how is hand tracking supported, but controllers are not?

EDIT: Just watched a video on hand tracking; that is awesome.

@thaytan
Copy link
Contributor

thaytan commented Jun 2, 2023

Is it possible to use Monado with SteamVR, and is it possible to play VR games like Beat Saber via Proton?

A few brave souls have tried, using the hand-tracking controller emulation. They say it's not great :)

And how is hand tracking supported, but controllers are not?

The hand tracking is an amazing piece of work - implementing a full hand tracking set of neural networks and logic from scratch. The controller tracking - I have wanted to concentrate on one implementation at a time, so focussed on controller tracking for the CV1 headset driver with the idea to port it to other headsets once it's perfect. I've come to the conclusion that it'll never be perfect though and I should just get on with it. It takes a long time, because I can only work on VR drivers in my spare time.

EDIT: Just watched a video on hand tracking; that is awesome.

It is!

@AgentLoneStar007
Copy link

Question(I would love to help with this stuff, but I'm still new to C and I've never dealt with driver development or reverse engineering, though I would like to get into both; and I don't know much about how VR headsets actually work): if hand tracking is possible via the cameras on the HMD tracking the hands, and the controllers already have rotation support, why not simply add a system that can track the controllers using the same system as the hand tracking? Granted it would not be perfect, because if the headset loses track of the controllers, they'd be lost period, but it's a start.

I have no idea how controller tracking works on the Oculus Rift S in the first place. Since it has no cameras on it, I assume the headset either uses the above mentioned system in a way, or it uses signal triangulation.

@NewtSoup
Copy link

NewtSoup commented Jun 2, 2023

Rift-S has quite a few cameras on it. Indeed if ( in windows ) you step outside the guardian area the game view goes away and a black and white camera view appears instead. The controllers have infra-red LED's in the rings and it's these that the cameras on the headset pick up in order to determine position and rotation.

@darkvertex
Copy link

@AgentLoneStar007 wrote:

I have no idea how controller tracking works on the Oculus Rift S in the first place. Since it has no cameras on it, ...

Rift-S has 5 outward facing tracking cameras.

If you look at infrared pics of the controller you can see the constellation of invisible infrared LEDs, which is how it knows where they are:
image
[source]

@AgentLoneStar007
Copy link

Cool.

Alright, I know this isn't the best place to ask, considering it's an issue for a Github project and all, but could someone either help me figure out Monado, or link a guide for installation and usage of it on Arch Linux? If you want a better place to talk, reply to this post. I've installed the SteamVR driver, I've tried to use the hello_xr tool, but nothing is working. The window pops up on one of my monitors and not the headset, and headset movements aren't detected at all.

@thaytan
Copy link
Contributor

thaytan commented Jun 2, 2023

Monado (monado-git) is packaged in Arch. Install the optional basalt-monado-git and onnxruntime deps first to have SLAM and hand tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests