monstermac77 / vr

This is a comprehensive guide to my VR setup, including descriptions of some VR concepts and phenomena.
GNU General Public License v3.0
56 stars 8 forks source link

Issues starting SteamVR #13

Closed Jdbye closed 3 years ago

Jdbye commented 3 years ago

Okay, so it was working fine for a couple of days, but today I've been having issues. SteamVR starts up, and gets automatically closed by MixedVR Manager. So far all good, this is expected behavior. However, at this point, in the game library it still says SteamVR is running, and when MixedVR Manager tries to start it again the second time, Steam gives the error "An error occurred while updating SteamVR (app running)" Attempting to start SteamVR again from the menu gives the error immediately (however the menu does actually say "Start" and not "Exit", which contradicts the "Running" status in the library; also, checking in task manager there is indeed nothing SteamVR related running) A restart of Steam results in the original behavior (SteamVR starting up, closing, and then erroring on the second start) Rebooting fixes the issue, for a while. Although strangely, sometimes the error appears but SteamVR still starts up. Eventually it occurs again requiring another reboot. Also, as far as I can tell I am on the latest version of SteamVR (nothing listed in Downloads) so that error is a bit misleading.

Log:

Initializing: at time of MixedVR-Manager start, SteamVR was: quit

MixedVR-Manager is now waiting for events... MixedVR-Manager detected that SteamVR is now: running MixedVR-Manager is changing state of USB device, the HMD, to /enable... MixedVR-Manager is skipping changing state of the lighthouses to on, per user's configuration The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. Waiting 25 seconds for SteamVR to launch... MixedVR-Manager is restarting SteamVR so SteamVR can detect the now powered on lighthouses and HMD. SUCCESS: The process "vrmonitor.exe" with PID 19996 has been terminated. SUCCESS: The process "vrserver.exe" with PID 24964 has been terminated. The system cannot find the drive specified. The system cannot find the drive specified. Waiting for SteamVR to start back up and to close Room Setup, will wait up to 90 seconds... The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. SteamVR was exited or crashed almost immediately after start of play session. User is likely testing script, has slow computer, or serious issue is occuring. MixedVR-Manager has finished procedure for SteamVR's state changing to: running MixedVR-Manager is now waiting for events... MixedVR-Manager detected that SteamVR is now: quit The system cannot find the drive specified. The system cannot find the drive specified. The system cannot find the drive specified. ERROR: The process "MixedRealityPortal.exe" not found. MixedVR-Manager is changing state of USB device, the HMD, to /disable... MixedVR-Manager is skipping changing state of the lighthouses to off, per user's configuration MixedVR-Manager has finished procedure for SteamVR's state changing to: quit MixedVR-Manager is now waiting for events...

monstermac77 commented 3 years ago

Has this issue persisted? I'm in the process of moving so I don't have my VR set up to help debug yet.

Jdbye commented 3 years ago

I had the issue occur once when I wasn't using MixedVR Manager. SteamVR started fine once, and then gave an error on subsequent launches until I restarted Steam, rinse and repeat. It seems to have something to do with the automatic timeout (VR automatically exiting after a period of inactivity), that seems to trigger it, however it's not SteamVR doing it because I have the automatic timeout disabled in SteamVR. Does WMR also have some sort of automatic timeout setting? In any case, it doesn't seem like it's MixedVR Manager's fault. When I am using the headset actively there are no issues, the issue only starts once the headset is left idle for long enough to time out (doesn't happen every time though)

I wonder if it might not be better to have a shortcut (using a command line parameter) that enables the USB device, and then starts SteamVR, and launch SteamVR that way rather than from the menu in Steam. That could also be added as a non-Steam game shortcut to Steam. It saves the extra step of having to kill and restart SteamVR for the headset to be recognized. Wish there was a neater way (from the user's perspective) like hooking into the "Start SteamVR" menu item and injecting code to toggle the USB status before SteamVR actually starts, but that is a bit overcomplicated and likely to break when Valve changes things.

Anyway, I have just ordered another TP-Link HS110 smart socket so I can control the power to the headset directly rather than cutting off the USB connection which doesn't disable the power to the G2 (as it's powered by a separate power supply), so I will figure out some solution to toggling the power on and off automatically on the smart socket. I already wrote my own code to do basically the same thing MixedVR Manager does (minus USB toggling) as I started mining Ethereum on my spare time and wanted to tie that into the whole thing so the miner also stops automatically when I'm playing a game or using SteamVR, so I will just expand on that code to toggle the smart socket as well.

monstermac77 commented 3 years ago

It seems to have something to do with the automatic timeout (VR automatically exiting after a period of inactivity), that seems to trigger it

Interesting, yeah I always "clean up" when I'm done, so I quit SteamVR so that everything shut down, but I'll keep my eye on this to see if others report a timing out issue.

Does WMR also have some sort of automatic timeout setting?

Good question, I don't know the answer. I think PumpkinSpice on Reddit would be able to give you a more definitive answer.

I wonder if it might not be better to have a shortcut (using a command line parameter) that enables the USB device, and then starts SteamVR, and launch SteamVR that way rather than from the menu in Steam. That could also be added as a non-Steam game shortcut to Steam. It saves the extra step of having to kill and restart SteamVR for the headset to be recognized. Wish there was a neater way (from the user's perspective) like hooking into the "Start SteamVR" menu item and injecting code to toggle the USB status before SteamVR actually starts, but that is a bit overcomplicated and likely to break when Valve changes things.

Yeah, this would be great save for one key thing: we'd really need to do some deep injection into SteamVR/Steam because one of the beautiful things about a fully functional MixedVR setup is that you can just turn on an Index/Vive controller to kick it all off. In order to preserve that, we'd need to get SteamVR/Steam to execute the USB-enable function in response to the controller turning on but before starting SteamVR. That's probably going to be tricky business.

I already wrote my own code

Sounds good, hopefully you were able to peruse MixedVR Manager's code to inform how you structured your own!

Jdbye commented 3 years ago

FWIW, I've found a simple solution to not needing to restart SteamVR that should also work in the case you described (powering on everything using an Index/Vive controller) Simply suspend the vrserver.exe process when it starts, enable the device and wait some time for it to be recognized before unsuspending. It's working in my code (still have some bugs to iron out though with all the changes I've been making today, as I received the smart socket and have been implementing that)

Jdbye commented 3 years ago

Polling for the vrserver.exe process on a 1 second timer seems to be sufficient to detect it and suspend it in time without fail, but I've lowered the delay to 500ms in my code just to be safe. Seems to be working well. I'll see if I release my program some day once I clean up the code a bit and add an UI.

It saves about 15 seconds starting up SteamVR, and only takes a few seconds longer than starting SteamVR normally, with the headset already recognized. It's about as good as it'll get.

monstermac77 commented 3 years ago

@Jdbye Incredible discovery. I won't have time to work on #14 any time soon, but I look forward to it. That would be a big time saver for users and make MixedVR Manager even more convenient.