elvissteinjr / DesktopPlus

Advanced desktop access for OpenVR
GNU General Public License v3.0
462 stars 29 forks source link

Application not launching #18

Open XaverXD opened 3 years ago

XaverXD commented 3 years ago

Hi there, for the last couple of weeks I've had some issues with launching Desktop+. I installed it via Steam and enabled the auto-launch option in steamvr. Now everytime I try to launch the application something happens and the application closes after about 2-3 seconds (at least the task stops and steam tells me it's not running anymore). There is also nothing happening in steamvr.

So far I've tried:

I've also looked for error-dumps in the installation-directory and tried looking for a vrclient_DesktopPlus.txt in the logs-folder of steam. Suprisingly there is no vrclient_DesktopPlus.txt, but a vrclient_DesktopPlusUI.txt.

I've attached the last entry of the UI-Logfile.

vrclient_DesktopPlusUI_LastEntry.txt

Since it reads Returning AlreadyRunning for LaunchDashboardOverlay steam.overlay.1494460 because that is running as 39468 and thinking that 39468 represents a PID for a process, I tried killing the task running under the PID 39468. Unfortunately this didn't help, because there was no task running with that PID.

Thank you for your help, Xaver

elvissteinjr commented 3 years ago

Desktop+'s logging is still very barebones and only logs on a few critical errors, though OpenVR init errors should be reported if they come up. Init errors will display a message box, runtime ones land in error.log, but you would've seen one if it was there. The absence of both vrclient_DesktopPlus.txt and an init error is certainly odd.

The log entries with AlreadyRunning for LaunchDashboardOverlay are somewhat normal when using the "Restart with Steam" option. For that, Desktop+ UI gets rid of the existing instance, then prompts Steam to launch a new one. Steam doesn't instantly recognize apps closing however, so it keeps calling LaunchDashboardOverlay() until it succeeds (or 3 seconds are over). In this case it seems like it never succeeded with getting rid of the other instance... which is odd since it resorts to killing the process if it doesn't respond to the quit message. That wouldn't work if DesktopPlus.exe was running elevated at the time of course.

DesktopPlus.exe may be stuck in some loop for whatever reason, but the kicker here is that initializing OpenVR is pretty much the first thing happening before looping on anything so I'd expect said log files to appear... but they're clearly not here.

So much for my thoughts. Kind of lost here as well. Can you check what SteamVR's Overlay Viewer lists for overlays? You can find it under Developer -> Overlay Viewer in the SteamVR desktop menu. Can you check if any older builds work perhaps? I'd say particularly significant ones would be v2.3 (added Graphics Capture) and v2.2 (added multi-overlay support).

While it shouldn't stop Desktop+ from launching, I recommend making sure SteamVR isn't auto-launching the Steam version while you troubleshoot. There isn't any backwards compatibility with running a newer DesktopPlusUI.exe with an older DesktopPlus.exe, so make sure it's not running in the background when switching between versions.

Lastly, anything unusual about your setup? I'd hope it would run fine on most systems or at least error out properly, but would be good to have your specs at hand just in case.

Sorry I can't really offer a direct solution right now. I'm willing to go through troubleshooting as long as you are as well, at least.

XaverXD commented 3 years ago

First of all, thank you very much for the advice. Desktop+ v2.2 works for me (however v2.3 does not).

The Overlay Viewer lists the following Overlay-Keys when trying to launch the latest version (v2.4.6 Beta):

My specs:

Furthermore, my system is running Windows 10 Pro 10.0.18363 and a custom Linux Debian-Distro (dual boot, using windows for SteamVR) and I use the stable release of SteamVR 1.16.10.

elvissteinjr commented 3 years ago

Hm, everything looks about normal. considering the current situation. No Desktop+ overlays in there. UI doesn't load OpenVR if Desktop+ isn't running. It checks for that by looking for the message-only window of the app, so it's safe to assume the main app's process isn't running at all. Probably silently crashing?

Your specs should be well supported. The only change in the startup code since v2.2 is loading the Graphics Capture DLL. It's weird though since DesktopPlusUI.exe does exactly the same on launch. Nevertheless I've attached a stub version of it. It pretty much just reports no support for Graphics Capture and does nothing else. DesktopPlusWinRT-Stub.zip That way could at least narrow down the issue. That DLL should work with any Desktop+ version so far, since its interface hasn't changed yet. Just drop in and replace the DLL that ships with Desktop+ in v2.3 and up.

Since you run a custom Debian distro I take it you know your way around stuff? Another obvious viable way would be to build Desktop+ yourself and run it through a debugger. Should be fairly painless if you have Visual Studio 2019 installed. It's fine if you don't want to or can't, though.

XaverXD commented 3 years ago

So I've tried using the steam-version with the stub of the dll and it worked flawlessly. My best guess is, that it has something to do with the drivers of my graphics card, but I can't confirm it.

I have also downloaded the sourcecode of Desktop+ but so far I wasn't able to find the time to debug it. I'll probably look into it this evening.

elvissteinjr commented 3 years ago

That narrows it down at least, so that's something. Another good way to narrow it down further would be to check out the Win32CaptureSample. Desktop+'s Graphics Capture code is based on it so if that doesn't work either it might not be just my fault. Then again, there should be no captures being started automatically in the default config... so yeah, still a bit odd. Worth checking out though.

elvissteinjr commented 3 years ago

Any updates if you were able to run Desktop+ through a debugger yet? I just had third guy with this issue last night over on the Steam forums.

Common trait so far is a GTX 10-series GPU and a Ryzen CPU... though to be fair that both applies to my system as well and I can't reproduce it (with matching drivers and OS version). Would love to actually fix it. Probably isn't Graphics Capture in general either since the current SteamVR beta would straight up not work then since it now includes window capture as well... so hm.

XaverXD commented 3 years ago

First of all, sorry for the late response.

So a couple of weeks ago, I build the application from the source, but for some strange reason, everything was working smoothly. The only thing I noticed was a small bug that occurred when restarting SteamVR with two windows mirroring 2 different monitors. For some strange reason, the window that was mirroring my second monitor was absolutely huge and placed in a completely different location than when I restarted SteamVR. When trying to change the position of the window, the window oddly snapped to its original position and shrank down to the size it had when I originally left SteamVR. I'll do some more testing on that in the future.

At the moment I'm not entirely sure what has caused the problem in the first place or how it suddenly worked when rebuilding the source. I'd guess it has something to do with the building process (though this would be also weird since the stub you included earlier worked just fine as well). To be honest, I'm at a complete loss as to why it works now. If I find something new, I'll let you know, but so far that's it.

rib commented 3 years ago

Hi, I'm also having similar sounding issues with trying to launch Desktop+ :/

I can run the app and if I look at the steamvr developer -> overlay viewer I can see a load of DesktopPlus overlays listed but I just don't see of them in VR.

Also if I build and run the above Win32CaptureSample that runs ok on my machine.

I'm trying to test with an Oculus Rift S

Oculus Runtime: Version 30.0.0.36.502 SteamVR: 1.19.3 (I switched to the beta to see if that would work after the stable version wasn't working) OS: Windows 10.0.19042 Build 19042 Processor: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4001 Mhz, 4 Core(s), 8 Logical Processor(s) GPU: GTX 970

Not sure what to try atm

elvissteinjr commented 3 years ago

If it doesn't show up in VR, chances are that the main process, DesktopPlus.exe, crashed or quit prematurely for some reason. The user interface lives in a separate process (DesktopPlusUI.exe) and also owns a couple of overlays, so it's possible you've just been seeing them (they have "UI" in their names). That just me guessing though. Have you checked which processes are still running? As of right now, if the main process isn't running, the tab in the SteamVR dashboard vanishes as well. There should still be an icon in the notification area/tray if the UI is running in VR mode, however. For Oculus users it's also important to actually be running things through SteamVR, but since you went through the Overlay Viewer I assume you know that and this is not the issue here.

Can check if the stub WinRT DLL linked above works for you? I've still not been able to reproduce this issue and while it doesn't appear to be widespread, it certainly is popping up here and there it seems.

Since you've built the Win32CaptureSample yourself, it might be worth a try building Desktop+ as well and run it under a debugger to see if anything comes up. Build process should be fairly painless at least.

Sorry for the trouble.

rib commented 3 years ago

Ooooh, wait actually I think I just didn't know what to expect. I thought that running Desktop+ would automatically pop up an overlay that I could interact with while in other apps. I just found that from the SteamVR system menu there is a 'Desktop+' icon there and I can see my desktop there, but I don't see how I can have that as an overlay while using another app. Sorry if I've simply misunderstood how the app operates.

(checking the processes, I indeed see both processes are running fine, and also tried out the WinRT DLL which worked - but yeah it sounds like I just didn't know how the interface was meant to be accessed)

elvissteinjr commented 3 years ago

I just found that from the SteamVR system menu there is a 'Desktop+' icon there and I can see my desktop there, but I don't see how I can have that as an overlay while using another app. Sorry if I've simply misunderstood how the app operates.

The User Guide has a few step-by-step examples that should help here. I'm currently working on redoing the UI and greatly simplify the process for things like this, but for now it might need to take a minute get familiar with. Again, for Oculus keep in mind that overlays can't display in-game if the game is using the Oculus runtime directly. Apparently this is almost the norm these days even for Steam versions when they detect a supported device and needs fiddling on a per-game basis to them run through SteamVR. I'd recommend testing things with something that only uses SteamVR first.

rib commented 3 years ago

In my case the app I'm running (Blender) is definitely running against steamvr (I'm running it explicitly with the steamvr OpenXR driver using XR_RUNTIME_JSON=/path/to/steamxr_win64.json and can confirm that it's selecting the steamvr driver/runtime instead of the oculus runtime.

For my initial testing though I've also just been using the steamvr home app.

Reading the guide though I was again getting the impression that it wasn't working as I was expecting since I still couldn't figure out how to get the desktop to show as an overlay outside of the dashboard.

AAAaaah I just figured out via the builtin tips/walk through feature that 🚨 "The first overlay is special" 🚨 ! which was the key detail that should probably be the first thing to highlight in the guide and readme.

Yeah it definitely seems like it could help to simplify the readme/guide/tips information. In some ways the information is perhaps a bit too fragmented, being split across the readme, guide and tips UI. It could really help to also make the information more discoverable via the steam page, either under discussions or guides (at least that was the first place I looked to try and figure out how to use the app before discovering that it was on github).

I would guess that the main use case people have when downloading Desktop+ is that they want to show an app/desktop overlay in VR that's not just in the steamvr dashboard so it could be ideal if the UI would make that more obvious and all the various guides could prioritize explaining how to do that.

Even though the UI is perhaps a bit obscure, thanks for making Desktop+, it seems to all be working, now that I realise how to use it.