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

Exit (Air)Link when SteamVR exits! #51

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

UnusualNorm
Copy link
Collaborator

It's the long awaited thing! SteamVR no longer automagically restarts when you want to exit (Air)Link!
I have no idea how this affects Rift users as mine is currently in storage, please test if you do though.

This PR simply kills the OVRServer_x64.exe when vrserver.exe exits, thus, killing (Air)Link. But there's more room for error.
@HyrumGG If you could please review this and correct my stupidity, I did not find a way to run .Find on the array, so I resorted to using loops. Please submit a PR if you do find a way to do that, thanks!

@UnusualNorm UnusualNorm requested a review from HyrumGG June 2, 2022 22:25
@UnusualNorm
Copy link
Collaborator Author

Just an update about my inability to find the Array.Find, I found out how to do it with the latest commit. Although it goes untested as I am not currently home, I will edit this message when I build and test the latest commit.

@UnusualNorm UnusualNorm closed this Jun 3, 2022
@UnusualNorm
Copy link
Collaborator Author

Woops, I hit the wrong button :(

@UnusualNorm UnusualNorm reopened this Jun 3, 2022
@HyrumGG
Copy link
Collaborator

HyrumGG commented Jun 3, 2022

I will look at this after work today

@UnusualNorm
Copy link
Collaborator Author

UnusualNorm commented Jun 3, 2022

@HyrumGG Thanks! Unfortunately, the latest commit is broken, as I have programmed it in VSCode... I am commiting a better and fixed version later today though. Sorry for the inconvenience.

@UnusualNorm
Copy link
Collaborator Author

Cool! Fixed everything @HyrumGG! Please check to see if there is any optimizations/fixes I could make, thanks in advance!

Copy link
Collaborator

@HyrumGG HyrumGG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the appropriate changes

@GlazedBelmont
Copy link

Any idea when this would be merged? it's a very important change imo since it would solve the fact that the oculus button doesn't work

@UnusualNorm
Copy link
Collaborator Author

@GlazedBelmont Unfortunately, this PR would not solve the issue of the Oculus button being unusable. This solves the issue where the "Exit VR" button would simply restart SteamVR instead of closing Oculus Link.

@GlazedBelmont
Copy link

I mean, there's no other use to the oculus button other than quitting link in that context

@GlazedBelmont
Copy link

So yes it does "fix" it by giving us a way to leave link that's not "kill steamVR and open the oculus menu while steamVR is still dead"

@lukecarbis
Copy link

Any update on this?

@ThatOneGal
Copy link

Anything?

@GlazedBelmont
Copy link

@ItsKaitlyn03 @HyrumGG could you review and possibly merge this PR? it's been inactive for a while

@JulianCaruso
Copy link

Hi @ItsKaitlyn03 @HyrumGG ! Also pushing this :)

@Eliminater74
Copy link

Can this be reviewed and merged>> this PR has been inactive for a while and seems nothing is doing anything more with it.
but this PR would make life so much easier for peepz that rely on AirLink..

@kayteck1
Copy link

Any progress in this matter?
I very often switch between native Quest2 and SteamVR and the only way to go back to Quest2 from SteamVR I found is to restart the headset.
SteamVR still restarts after selecting Exit SteamVR.

@MaxMls
Copy link

MaxMls commented Jul 16, 2023

Any progress in this matter? I very often switch between native Quest2 and SteamVR and the only way to go back to Quest2 from SteamVR I found is to restart the headset. SteamVR still restarts after selecting Exit SteamVR.

You can download the version with these changes using the following link:
https://github.com/UnusualNorm/OculusKiller/releases/tag/Anti-Restart-Forgiveness

To make sure of the safety, I also builded my own version based on this branch.
https://github.com/MaxMls/OculusKiller/releases/tag/publish

@Identifier
Copy link

Hey @Eliminater74 and @MaxMls, I happened to also start working on this problem today (before I knew about your work), and I noticed you're waiting up to 10 seconds for vrserver to start because apparently you often ran into the case where vrserver couldn't be found. Well, it might be because sometimes, vrstartup.exe doesn't exit. Usually it does, but sometimes it doesn't. I've noticed that usually, the steps happen in this order:

OVRServer_x64.exe starts our killer OculusDash.exe
OculusDash.exe starts vrstartup.exe
vrstartup.exe starts vrmonitor.exe
vrmonitor.exe starts vrserver.exe
--- usually, at this point, vrstartup.exe exits. This is where the original OculusKiller exits, causing the infinite startup problem.

But sometimes, vrstartup.exe doesn't exit until vrserver and vrmonitor exit. In this case, you'r stuck on line 24 (Process.Start(startupPath).WaitForExit();) until vrserver and vrmonitor have already exited, which may be why you couldn't find it with Process.GetProcessesByName("vrserver")

@Identifier
Copy link

I actually have a kind of serious issue that I'm currently troubleshooting. On my machine, if the headset disconnects (e.g. because OculusClient is closed, or OVRService is stopped) while SteamVR is still running, my CPU and GPU will go to 100% and hang the machine for a few minutes. I don't know if it's because I'm also running Desktop+ or what, but it's a total pain. So I'm trying to add some code that will check for when vrservice is running but OVRService is not, and kill vrservice.

@Identifier
Copy link

FYI I've created another PR (#84) that automatically closes SteamVR if the user exited by closing the Oculus app (or stopped the service). It doesn't do nearly as much error checking as yours, but I just wanted to put it up there just in case it was useful to you guys.

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