Easiest way to get some debug output

The place for all discussion of the Oculus Rift compatible open source 3D drivers.
Post Reply
dornED
One Eyed Hopeful
Posts: 3
Joined: Sat Aug 23, 2014 4:06 pm

Easiest way to get some debug output

Post by dornED »

Hey everyone! First off, I’d like to thank all the developers of this awesome piece of software for the effort they did and do put in to it. I know it’s not easy to give up so much spare time. So, really, thank you!

I got my DK2 recently and was playing around with Vireio 2.03, with and without custom dll/fx files that I found in some Vireio Skyrim thread to improve DK2 compatibility. Everything worked beautifully and I have to say it’s quite the experience! Nice work!

So far so good, but as soon as I started other games it obviously wasn't so nice anymore. I know this is a work in progress, so I actually don’t mind that at all. I’d rather have one awesome proof-of-concept than a half ass experience in 50 different games.

Since I had some spare time and the interest, I took different bits of fx files and made one that’s just a zoomed out SBS with a simple distortion correction. Additionally I disabled all tracking. The idea is to make a mode that is as compatible as possible, so more games will work with it. It now looks a lot like the floating desktop programs that are around, minus the movement (the screen is fixed, which is fine for me at the moment). While it’s probably the dumbest possible implementation of it (the game still runs in 1080p), it works surprisingly well for my purposes.

So, now that I have the basics working, I’d like to get some more games to run in this mode.
So far I have seen 3 failure modes with the games I tried:

1. game crashes
2. game renders a single, normal view over the entire screen (this then also happens with the normal SBS view; seems like Vireio is not hooked, even when copying the dlls over)
3. game renders 2 views, but they are not 3D, i.e. there is no separation

What I would like to do is work my way up this list, so start with a game that has 2 views but no 3D and get it to work, since those seem to be the easiest targets.
What I did up until now is to play around with both the profiler and the in-game menu to get some separation, but to no avail. I also read all the documentation I could find, a lot of wiki entries and read through some threads here, but I did not get any further.

So, seemingly having reached a dead end on the GUI-path (unless I missed something obvious), what I would really like at this point is to have some debug output, which (finally) gets me to the reason why I'm posting: Where would the best/easiest/fastest place be to get some simple debug output? Are there log files that can be enabled or would it be best to pull the code and run in debug mode (or something similar)? In case of the latter: Are the build instructions on GitHub up to date? I’m asking because it mentions Oculus SDK 0.2.5c.


TLDR: What’s the easiest way to get some simple debug output of a non-working game in Vireio?

Thanks for listening and keep up the good work!
Oculus Rift DK2 / 3x 50" 1080p Plasma-TVs
Windows 7 Pro 64bit
Intel i7 960
3x Nvidia GTX 470 in SLI / Surround
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Easiest way to get some debug output

Post by cybereality »

When I was working on development, I was using DebugView and calling OutputDebugString inside the code somewhere.

It's useful to output simple messages to assist with debugging.
dornED
One Eyed Hopeful
Posts: 3
Joined: Sat Aug 23, 2014 4:06 pm

Re: Easiest way to get some debug output

Post by dornED »

Thanks for the quick reply!

I ran DebugView but it kept freezing when I started Perception. Running Perception first and then running DebugView worked fine however. Quite handy! Thanks for the hint.

Unfortunately I couldn't find an obvious culprit, so I am now in the process of installing everything in order to build the code (the DirectX SDK is giving me headaches at the moment, won't install...).
I'll probably start looking in the DxProxy > Stereo folder (VS sln), StereoView.cpp looks intriguing. If any developer has experienced similar failure modes (2 views but no 3D) and knows of a better place to start poking around, please let me know! I'm not a huge fan of the first couple of hours (or even days) it usually takes to get familiar with a lot of other peoples code, so if someone could soften the blow a bit I'd appreciate it immensely!


EDIT:
Everything works fine now, project is built and runs as expected. I can put in new messages that get picked up at runtime by DebugView.
Sadly, breakpoints don’t work. I assume this is because of the dll injection magic. If someone here knows more about this, I’d love to know if it can (or can’t) be done. Working without breakpoints is a pain…
Oculus Rift DK2 / 3x 50" 1080p Plasma-TVs
Windows 7 Pro 64bit
Intel i7 960
3x Nvidia GTX 470 in SLI / Surround
dornED
One Eyed Hopeful
Posts: 3
Joined: Sat Aug 23, 2014 4:06 pm

Re: Easiest way to get some debug output

Post by dornED »

Well, I guess if no one else will comment here then I’ll just continue my little monologue, in the hopes that it might be of use to someone.

The good news first: You can enable breakpoints by attaching to the game exe!
Instructions for Visual Studio 2012:
1. start debugging
2. start game
3. select Debug -> Attach to Process
4. select the game exe from the list
After that it will break at your breakpoints. Yay :D


As for my progress getting the game with no separation to work:
The view transform matrices for both eyes seem to be set correctly (and update when changed with the in-game menu), so they are translating in X by something like IPD/2 (taking world scale into consideration) in + and - direction respectively.
It seem like these matrices (ViewAdjustment::transformLeft/Right) are either not used or overwritten somewhere else.
I’m still quite unfamiliar with how exactly Vireio functions, so I could of course be way off :D

If someone has an idea where I could look next, I would really appreciate a hint.
Oculus Rift DK2 / 3x 50" 1080p Plasma-TVs
Windows 7 Pro 64bit
Intel i7 960
3x Nvidia GTX 470 in SLI / Surround
User avatar
Neil
3D Angel Eyes (Moderator)
Posts: 6882
Joined: Wed Dec 31, 1969 6:00 pm
Contact:

Re: Easiest way to get some debug output

Post by Neil »

I knew there was a debugger we recommended; I had to go through some old chats and emails to remember the name.

Have you tried "Tracespy"?

http://tracespy.codeplex.com/

Regards,
Neil
Post Reply

Return to “Development / General Discussion”