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

DirectMode did not work #1

Open
vicdxxx opened this issue Apr 19, 2017 · 20 comments
Open

DirectMode did not work #1

vicdxxx opened this issue Apr 19, 2017 · 20 comments

Comments

@vicdxxx
Copy link

vicdxxx commented Apr 19, 2017

Hi, buddy, I achieve a DirectMode in last version of OpenVR driver(Some hack maybe). But I can not finish a simple display in Jan 31 version, and I made a new driver which steamVR have a error 307. I know new version use PID and VID replace isHMDPresent and other feature in github official release log. I achieve them. Then, I follow your code to modify mine, and ignore those properties I thought it is unnecessary(trouble here?). I do not sure what I have ignored
Any help is highly apprecciate!

@sencercoltu
Copy link
Owner

sencercoltu commented Apr 19, 2017 via email

@sencercoltu
Copy link
Owner

sencercoltu commented Apr 19, 2017 via email

@vicdxxx
Copy link
Author

vicdxxx commented Apr 20, 2017

Thank you very much, I nearly finsih Directmode on Jan31 version refer your code. The problem left is no output image in my hmd, while all other stuffs seem correct, no error occurs, and steamvr icon turn to green. IsDisplayRealDisplay return value did trouble me, and I was not clear about "remoteDisplay" before.

@dashingstag
Copy link

dashingstag commented Apr 20, 2017

Hi I am also facing the same problems in my own driver in that i can activate it in extended mode and it loads in my hmd if i set the HMD as my main display.

However, I can't seem to get it to work in direct mode which I assume the former type which is that it would directly display my output on my HMD. I am thinking since it can do it on extended mode it should be easy to get it to display directly or am I missing something?

I set IsDisplayondesktop to false and IsDislayRealDisplay to true to try to get it to work in "direct" mode but the compositor fails to load.

Sorry this isn't really an issue for your driver but since we are on the topic I thought I could ask. Any help would be appreciated. I have taken a look at your hmd driver but I am still unsure which parts would be relevant.

In addition, may I ask how did you get your edid pid and vid? I got my edid from a monitor asset manager but it gives me a 256 bit number . According to wiki there's a manufacturer id but how do i get the pid and vid?(my display has a usb that i can get the pid and vid from but I assume the edid pid and vid is from the monitor itself?)

Thanks for any guidance.

@sencercoltu
Copy link
Owner

sencercoltu commented Apr 20, 2017

@dashingstag:

https://en.wikipedia.org/wiki/Extended_Display_Identification_Data

According to the EDID values my manufacturerid is 4D D9 02 D6 (in bytes 8-11 of the 256 byte EDID info).

A = 00001 = 1 = ACSII 65 = 64 + 00001
B = 00010 = 2 = ASCII 66 = 64 + 00010
...
Z = 11010 = 26 = ASCII 90

so

4DD9 to bits = 0100110111011001
0 10011 01110 11001
10101 = 19 => 64 + 19 = 83 = S in ascii
00110 = 14 => 64 + 14 = 78 = N in ascii
11001 = 25 => 64 + 25 = 89 = Y in ascii
Vid = SNY

Pid = 02 D6, swap bytes and it becomes D602

Check Device Manager->monitor->Properties->Details->HardwareId's, if the id matches (MONITOR/SNYD602 in my case), you got the right EDID VID/PID values. Convert to decimal and enter them in your steamvr.vrsettings file. If your card is AMD, your display should go in direct mode, if it's NVIDIA, I have no clue, beg NVIDIA to whitelist your EDID.

@cjlong1213
Copy link

Hi, guys, I just DIYed a HMD and made a custom openvr driver for it. I can't choose proper display for SteamVR at extended mode, I have built driver_sample fromhttps://github.com/ValveSoftware/openvr
I have two displays, each is 1680x1050. Second is on the right of first(primary one).
Everything start well. HMD icon is green.
I expect to see SteamVR demo on second monitor, but it is on first/primary monitor.
Looks like as I set position to 0,0. I tried 1680,0 but it do not work. the default.vrsettings are as below:
{
"driver_sample" : {
"enable" : true,
"serialNumber" : "1234",
"modelNumber" : "SampleModel 1",
"windowX" : 1680,
"windowY" : 0,
"windowWidth" : 1680,
"windowHeight" : 1050,
"renderWidth" : 1680,
"renderHeight" : 1050,
"secondsFromVsyncToPhotons" : 0.011,
"displayFrequency" : 60.0
}
}

Thanks in anvance for any guidance.

@vicdxxx
Copy link
Author

vicdxxx commented Apr 21, 2017

Thanks guy! I success! I will continue to undertand more details about this. It is very kind of you.

@dashingstag
Copy link

dashingstag commented Apr 21, 2017

@sencercoltu

when you say convert to decimal do you mean (in your case)
4DD9 to deci is 19929
SNY to deci is 837889
both aren't 55629 ?
EDIT: OH so you mean you have to SWAP 4D D9 as well to D9 4D to get 55629 which is the VID?

In my case my VID/PID is 12 6A 03 00 = DSJ0003 so my VID would be
12 6A swapped around to 6A 12 = 27154? wow it is like they don't want you to get the vid/pid. 👍

Also, do you know if it is different from "hmd_presence" in the driver.vrdrivermanifest?

Note: i think there is a typo in your message at "D4D9 to bits = 0100110111011001" should be "4DD9 to bits = 0100110111011001"

After doing this I get the result my steamvr fails to initialise and gives me a 109 error :/ I guess that means my hmd isnt whitelisted then.

@vicdxxx
Copy link
Author

vicdxxx commented Apr 21, 2017

I have same problem with @cjlong1213 in desktop Mode when set isOnDesktop return true and realDisplay return false;

@dashingstag
Copy link

@cjlong1213

Yea I have the same issue. But I bypassed this by setting my HMD as the primary monitor. I am trying to fnd a method to directly display on my HMD without setting it as my primary display as well :(

@sencercoltu
Copy link
Owner

sencercoltu commented Apr 21, 2017

@dashingstag
Bytes 8-11 are 4D D9 02 D6
4D D9 is the edid VID => swap to D94D = 55629
02 D6 is the edid PID => swap to D602 = 54786
values are stored little-endian

and there was a typo in my previous comment, it should be 4dd9 not d4d9, correcting it now.

@sencercoltu
Copy link
Owner

If you don't have access to the EDID bytes, you can calculate your EDID values like this:
Get your monitors hardware id from Device Manager->monitor->Properties->Details->HardwareId.
Mine is MONITOR/SNYD602. we will use SNYD602

Take the first 3 letters. S in ASCII is 83, N is 78, Y is 89. (http://www.asciitable.com/)

Now subtract 64 from all values. Result will be 19, 14 and 25.

Convert the values to binary (eg. in windows Calculator->Programmer mode):
19 = 10011
14 = 01100
25 = 11001

Aggregate the 3x5 bits into two bytes: (bit 15 is zero, so we can ignore it)
10011 01110 11001

Convert to decimal:
100110111011001 = 19929 = 0x4DD9

Swap bytes to D94D. This is my VID: 55629.
The PID is simpler.
Take the last 4 letters of the HardwareId, D602 in my case. This is my PID: 54786.

Enter these to your vrsettings.settings file under Steam/config folder.
Return IsDisplayOnDesktop false, and IsDisplayRealDisplay true in your driver, and steamvr should put your monitor into direct mode if your GPU is an AMD. No clues about NVIDIA.

@vicdxxx
Copy link
Author

vicdxxx commented Apr 24, 2017

I got what EDID contain VID and PID following your tips, new problem coming, SteamVR games runing with black screen in my driver direct mode... but it work in extended mode. I did use the textures as output so I can see the home scene while no game scene with game launch successfully.

@cjlong1213
Copy link

cjlong1213 commented May 3, 2017

@dashingstag @vicdxxx
Hi, guys. Do you solve the extended mode issue? Would you share the solution. Many Thanks!

@dashingstag
Copy link

@cjlong1213
Not yet. Might change to a hmd that is Nvidia whitelisted.

@AlanHau
Copy link

AlanHau commented Jun 20, 2017

Hi guys,

I am using NV card, can I know what's whitelist? Is it in Nvidia control panel? I tried it, but can not have direct mode work

Thanks.

@shensheng27
Copy link

@AlanHau you need contact nvida to whitelist your diy hardware, so nvida graph card will let your hardware in direct mode. If you are developing openVR plugins for your hardware, i suggest implementing the ivrvirtualdisplay interface (which need no direct mode) first to check if the result is ok

@AlanHau
Copy link

AlanHau commented Jun 21, 2017

@shensheng27 Thanks. I will have a try.

@cjlong1213
Copy link

Hi guys,

You can enable direct mode setup as below:

  1. set IsDisplayOnDesktop() return false and set IsDisplayRealDisplay() return true
  2. register properties(VendorID&ProductID) to Steam runtime
  3. wihtelist your hardware to graphic card(NVIDIA)
    open regedit then create a new key [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm]
    "1641970VRWhiteList"="SNY,*;"
  4. invoke NvAPI_DISP_EnableDirectMode(VendorID, 0)
    You can find NvAPI from Vrworks by NVIDIA. This way is using the SteamVR own direct mode, or you mast implement the IVRDriverDirectModeComponent

@dashingstag
Copy link

where do you find NvAPI_DISP_EnableDirectMode(VendorID, 0)?

I downloaded vrworks sdk 2.5 and nvapi but I can't find that utility function.

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

No branches or pull requests

6 participants