cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus Injector X-Plane Fix Edition

System1
Level 2
This discussion was created from comments split from: VR won't load. X Plane 11 - Rift S.
20 REPLIES 20

kojack
Volunteer Moderator
Volunteer Moderator
Ok, I cleaned up some code, removed a heap of stuff that isn't ready for release yet, and made a test version of Oculus Injector X-Plane Fix Edition. You can grab this first release here: https://github.com/rajetic/OculusInjector/releases/download/v0.0.1/OculusInjector.v0.0.1.XPlane.Fix....
This isn't the full Oculus Injector, I removed everything besides the X-Plane fix. So there's no vibration disabling, hand steadying, height adjust, touch emulation using Xbox or DS4 controllers, etc.

If somebody wants to verify this works, I'll do a more public release. For now I'm just keeping it here, I've never had anybody run OculusInjector before. 🙂

I've tested it with X-Plane 11.41 stable and 11.50b9 beta.

This is what it looks like out of the box:
a3o9zp9xrf9m.png

Setup
First thing to do is click on Add Entry. That adds a list box to the panel, and a new secondary panel appears with details.
On the secondary panel, you'll see a few things:
- A Launch button. This plays the selected game.
- An empty text box with "Process Name" next to it. Actually I should rename that, it's the Profile Name. You can type whatever name you want here to identify the selected game.
- A Select button. This opens a windows file requestor. This is how you choose an executable for the profile.
- An empty text box next to Select. This shows the selected executable.

Fill in a name for the profile on the Process Name field.
Click Select and find your X-Plane.exe file.
Go to the File menu at the top and save if you want to keep the profile.
Note: You can add as many profiles as you want, if you have several X-Planes installed, such as stable and beta versions.

Now press Launch and hopefully a working X-Plane will start.
You MUST use the OculusInjector program to launch X-Plane. The way the fix works is all in memory during loading, it doesn't modify your installed X-Plane files. If you run X-Plane normally (from Oculus Dash, from explorer, etc) it will be the regular X-Plane. No uninstalling is needed, just don't run the injector if you don't want it active.
You can close OculusInjector once X-Plane is running, it is only needed to start.

Here's what mine looks like:
cea7wqhoxm5d.png

What is the Fix?
This is specifically the fix for X-Plane hanging or crashing on startup in OpenGL mode using the Oculus v17 runtime. It doesn't fix the hang when you exit.

What's the issue? Who's to blame?
X-Plane uses Oculus SDK 1.23, which is from 2 years ago. When enabling the VR headset in OpenGL, they try to create a cubic texture swap chain. This cubic texture swap chain is only used once, it's not used when rendering normally.
1.5 years ago Oculus updated the SDK source code to include a warning to not make cubic swap chains. X-Plane's devs apparently never saw this warning. Fast forward to now, and in Oculus v17 the thing that they've warned to not do for 1.5 years no longer works. So technically Oculus broke it, but X-Plane is doing something it shouldn't be doing which just happened to not break in the past.

How the fix works
When X-Plane calls ovr_CreateTextureSwapChainGL it passes in ovrTexture_Cube. I intercept the call and replace it with ovrTexture_2D. That's it. It's basically changing a 2 to a 0 with one line of code. It would have taken Laminar less time to fix this than it took me, if they believed my bug report that detailed how to fix it.

Why does Vulkan in 11.50b9 work fine without a fix?
The Vulkan code in X-Plane never tries to make a cube texture swap chain, and therefore runs correctly. It's only the OpenGL code that does the wrong thing.

Important Note
Oculus Injector uses DLL injection to intercept functions in X-Plane and the Oculus runtime. This kind of technique is sometimes used by game cheats and hacks, so if you did this to games with anti-cheat tech like VAC, maybe it will get upset. I haven't had any problem with Oculus games or X-Plane, but be warned.


(I hate releasing first versions of things. So stressful)



Author: Oculus Monitor,  Auto Oculus Touch,  Forum Dark Mode, Phantom Touch Remover,  X-Plane Fixer
Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich
Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2

DaftnDirect
Volunteer Moderator
Volunteer Moderator
Hopefully if that works, it won't preclude Laminar looking into their code too. It sounds like their VR implemetation is maybe a little overdue for an update?

Intel 5820K OC@4Ghz, Titan X (Maxwell), 32GB Corsair Vengeance DDR4, ASRock X99 Taichi, Samsung 500Gb 960 Evo M.2, Corsair H100i v2 Cooler, Inateck KTU3FR-4P USB 3 card, Windows 10 Pro v20H2 (19043.1081)

TomCgcmfc
Level 16
A guy on the xp11 forum just said it works great.  Well done kojack, you make all us Oculus forum members very proud!

https://forums.x-plane.org/index.php?/forums/topic/213584-oculus-v17-not-working-and-v16-forces-upda...

I hate to think of all the guys who have stuffed up their Oculus systems trying to use silly hacks.  Thanks again mate.
9 9900k, rtx3090, 32 Gb ram, 1tb ssd, 4tb hdd. xi hero wifi mb, 750w psu, Q2 w/Air Link, Vive Pro

kojack
Volunteer Moderator
Volunteer Moderator
Hehe, I was waiting for somebody here to say it worked before telling the X-Plane forum. 🙂 Guess word spreads fast.
Author: Oculus Monitor,  Auto Oculus Touch,  Forum Dark Mode, Phantom Touch Remover,  X-Plane Fixer
Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich
Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2

TomCgcmfc
Level 16

kojack said:

Hehe, I was waiting for somebody here to say it worked before telling the X-Plane forum. 🙂 Guess word spreads fast.


Ya, usually only BAD news travels so fast, lol!  Again, good job mate.
9 9900k, rtx3090, 32 Gb ram, 1tb ssd, 4tb hdd. xi hero wifi mb, 750w psu, Q2 w/Air Link, Vive Pro

martinrasaboni
Level 2
Hello, does it work on Steam X-plane version? I can't find the X-plane11.exe

TomCgcmfc
Level 16


Hello, does it work on Steam X-plane version? I can't find the X-plane11.exe


You should find this where you installed it.  Usually is is drive: steam library/steamapps/common/bin/  name of app/ should see the application exe file.
9 9900k, rtx3090, 32 Gb ram, 1tb ssd, 4tb hdd. xi hero wifi mb, 750w psu, Q2 w/Air Link, Vive Pro

kojack
Volunteer Moderator
Volunteer Moderator
I'm guessing it should work on steam X-Plane, as long as it is running as a native Oculus app. It won't work with SteamVR.
Although I haven't tested Steam, I bought it from Laminar's store.

Author: Oculus Monitor,  Auto Oculus Touch,  Forum Dark Mode, Phantom Touch Remover,  X-Plane Fixer
Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich
Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2

martinrasaboni
Level 2
Thanks for your help (both) I found the .exe and I run the injector but x-plane is still saying that headset is disabled and automatically unchecks the box for enable VR hardware. I don't know how to make the Xplane runs with Oculus Rift S. I will very appreciate if you can help me.