openvr icon indicating copy to clipboard operation
openvr copied to clipboard

Can`t choose proper display (extended mode) for SteamVR

Open nikitos1550 opened this issue 10 years ago • 34 comments

Hello!

I have built driver_sample for windows and hard code there settings for my custom display, like this:

` if ( pSettings ) { DriverLog( "Using settings values\n" ); m_flIPD = pSettings->GetFloat( k_pch_SteamVR_Section, k_pch_SteamVR_IPD_Float, 0.063f );

                    char buf[1024];
                    pSettings->GetString( k_pch_Sample_Section, k_pch_Sample_SerialNumber_String, buf, sizeof(buf), "244047" );
                    m_sSerialNumber = buf;

                    pSettings->GetString( k_pch_Sample_Section, k_pch_Sample_ModelNumber_String, buf, sizeof(buf), "W2243" );
                    m_sModelNumber = buf;

                    m_nWindowX = pSettings->GetInt32( k_pch_Sample_Section, k_pch_Sample_WindowX_Int32, 1920 );
                    m_nWindowY = pSettings->GetInt32( k_pch_Sample_Section, k_pch_Sample_WindowY_Int32, 0 );
                    m_nWindowWidth = pSettings->GetInt32( k_pch_Sample_Section, k_pch_Sample_WindowWidth_Int32, 1920 );
                    m_nWindowHeight = pSettings->GetInt32( k_pch_Sample_Section, k_pch_Sample_WindowHeight_Int32, 1080 );
                    m_nRenderWidth = pSettings->GetInt32( k_pch_Sample_Section, k_pch_Sample_RenderWidth_Int32, 1920 );
                    m_nRenderHeight = pSettings->GetInt32( k_pch_Sample_Section, k_pch_Sample_RenderHeight_Int32, 1080 );
                    m_flSecondsFromVsyncToPhotons = pSettings->GetFloat( k_pch_Sample_Section, k_pch_Sample_SecondsFromVsyncToPhotons_Float, 0.0 );
                    m_flDisplayFrequency = pSettings->GetFloat( k_pch_Sample_Section, k_pch_Sample_DisplayFrequency_Float, 60.0 );
            }

` I have two displays, each is 1920x1080. Second is on the right of first(primary one). Everything start well. HMD icon is green, And even I can go through room setup calibration. 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 also added answers to queries for EDID VID and PID to driver_sample.

What am I doing wrong? Is driver_sample is up to date? Or did I miss something?

P.S. Serial and Model numbers strings I fill with some sample values.

nikitos1550 avatar Jul 20 '16 21:07 nikitos1550

Also I found this issue https://github.com/ValveSoftware/openvr/issues/97

With sample config:

"driver_null" : { "displayFrequency" : 90, "enable" : true, "id" : "Null Driver", "modelNumber" : "Null Model Number", "renderHeight" : 1512, "renderWidth" : 1344, "secondsFromVsyncToPhotons" : 0.10000000000000001, "serialNumber" : "Null 4711", "windowHeight" : 1080, "windowWidth" : 1920, "windowX" : 100, "windowY" : 100 }

I can`t run it in window mode, always fullscreen, always on primary display.

nikitos1550 avatar Jul 20 '16 22:07 nikitos1550

"windowX" : 100, "windowY" : 100, is the problem you got. you'd better to use "EnumDisplayMonitors" to get the coordinate of your second monitor when initializing.

shenyu0403 avatar Jul 22 '16 03:07 shenyu0403

"windowX" : 100, "windowY" : 100 is invalid values. Compositor will not start. "windowX" : 1920, "windowY" : 0 is valid, but image is on primary screen (like "windowX" : 0, "windowY" : 0) This is the problem.

nikitos1550 avatar Jul 22 '16 04:07 nikitos1550

I also have SteamVR-OSVR plugin for testing, it runs on second display without any problem. I have sources of both plugins, but I cant find the difference in data exchange between SteamVR and plugins, seems it is same. So I cant understand why when I am positioning to 1920,0 I still have image on position 0,0.

nikitos1550 avatar Jul 22 '16 04:07 nikitos1550

@nikitos1550 ,I also have the same problem,Can you share your solution

HelenXR avatar Dec 07 '16 06:12 HelenXR

@nikitos1550 I also have the same problem, Can you share your solution? Thanks.

cjlong1213 avatar Apr 20 '17 04:04 cjlong1213

@cjlong1213 I have get this . if you want to let your monitor enter direct mode ,#431,this post may help

then, I realized the HMD extended display and direct mode, if there is still a problem, you can contact my Email:[email protected],

HelenXR avatar Apr 25 '17 01:04 HelenXR

@HelenXR Thanks for your kindly help, actually I'm trying to build a custom driver for my HMD. Right now I have two computer monitors, the Lenovo display with solution of 1680x1050 and it is primary display, the Dell display with solution of 1920x1080 is my testing HMD display, I can load driver success and run compositer(Headset Window) OK in my primary display(Lenovo display). I want to run compositer at HMD display(Dell) with fullscreen whatever EXTEND mode or DIRECT mode. The default.vrsettings are as below: { "driver_sample" : { "enable" : true, "monitor" : "DELA09C", "supersample" : 1, "edid_vid" : 44048, "edid_pid" : 41116, "directMode" : false, "serialNumber" : "1234", "modelNumber" : "SampleModel 1", "windowX" : 1680, "windowY" : 0, "windowWidth" : 1920, "windowHeight" : 1080, "renderWidth" : 1920, "renderHeight" : 1080, "secondsFromVsyncToPhotons" : 0.011, "displayFrequency" : 60.0 } } I have set the values in my code as below: vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_UsesDriverDirectMode_Bool, false); vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, Prop_EdidVendorID_Int32, 0xAC10); vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, Prop_EdidProductID_Int32, 0xA09C); IsDisplayOnDesktop() function return TRUE, and IsDisplayRealDisplay() function return TRUE in my code. I still can not run correctly. What am I doing wrong? Did I miss something? Any help is highly apprecciate!

cjlong1213 avatar Apr 25 '17 08:04 cjlong1213

@cjlong1213 "I still can not run correctly." Doesn't it sound like your driver doesn't work? Did you get 108 or 400 wrong When startup steamVR?

HelenXR avatar Apr 27 '17 10:04 HelenXR

@HelenXR Thanks for your reply! I can startup steamVR with no errors, I want to run compositer window at second display(HMD) with fullscreen. In addition to rearrange the displays by windows, does any other way to solve this? Change settings?

cjlong1213 avatar Apr 28 '17 00:04 cjlong1213

@cjlong1213 About extend Mode: Displayed on the primary display (in the middle way of primary monitor,resolution is m_nWindowWidth *m_nWindowHeight), but did not try to be displayed on the second monitor, my custom HMD is work in direct mode(direct rendering mode can play better on VR graphics support, such as ATW, TW, VR-SLI and so on). Today I tried to make the extended display to the second monitor, and did not succeed for this I made a SCREEN class of the small program to implement an application to display second display function, it can work after debugging, but openVR I haven't found the answer, based on that, I think it should be with "m_nWindowX", but I try to modify later, did not play a role, because openVR does not completely open source: - (, I did not continue. @TheDeveloperGuy Can you give us some help for extern mode display in second monitor? About direct Mode(I am using):

  • Set EDID and display resolution.
  • register whitelist(AMD graphics card not need,Nvidia graphice card is necessary),below is a osvr whitelist example:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm]
"1641970VRWhiteList"="SVR,*;"

HelenXR avatar Apr 28 '17 09:04 HelenXR

hi,@cjlong1213 It took me some time today to be able to output the display image to the second monitor I have 2 monitors, the primary display is: 1920*1080, another display is: 1366*768. Windows is set to expand mode, modify the part of the code to allow the image to second monitors.

//CHeadMountDisplayDevice  is My HMD class.
bool CHeadMountDisplayDevice::IsDisplayOnDesktop() 
{
	return true;
}
bool CHeadMountDisplayDevice::IsDisplayRealDisplay() 
{
	return true;
	//return false;
}
//modify setting files:
      "windowX" : 1920,
      "windowY" : 0,
      "windowWidth" : 1366,
      "windowHeight" :768,
      "renderWidth" : 1366,
      "renderHeight" :768,

The steamVR home will be able to show up to second monitors (on the right of the Dell monitor): 111

HelenXR avatar May 08 '17 09:05 HelenXR

hi, @HelenXR I have modified the settings as you suggested, but still can not run the steamVR home to second monitor. I have 2 monitors, the primary display resolution is: 19201080, another is: 16801050. setting files: "windowX" : 1920, "windowY" : 0, "windowWidth" : 1680, "windowHeight" :1050, "renderWidth" : 1680, "renderHeight" :1050,

The steamVR home show up to the middle of primary display as below:

image

Is there anything I am wrong?

cjlong1213 avatar Jun 07 '17 03:06 cjlong1213

@cjlong1213 It's normal for me to test on my openVR driver project. You can use the same code so that we have the same experimental environment.

HelenXR avatar Jun 07 '17 08:06 HelenXR

Hello!

It is strange issue, and I also face it. Spent a lof of time to understand what is going on. Somehow you can`t name your driver null or sample (maybe some other names also). So, solution is to name your driver with your own project name. driver_null - will NOT work driver_sample - will NOT work driver_blablabla - will work

Maybe problem is more deep, I don`t know. But simple renaming of my driver solved it. Before I raised such question here, but it was closed by Valve developers.

nikitos1550 avatar Jun 07 '17 09:06 nikitos1550

P.S. this name issue is only applicable for extended mode.

nikitos1550 avatar Jun 07 '17 09:06 nikitos1550

P.P.S original driver_null that you can find in steamVR default installation has same issue.

nikitos1550 avatar Jun 07 '17 09:06 nikitos1550

@nikitos1550 yes,That's a cutey issue~~~ I find below message in vrcompositor.txt' when driver name is sample.

Forcing debug mode for sample driver.

other driver name will not display this message~ A bit annoying, openVR source code is not open source......

HelenXR avatar Jun 08 '17 01:06 HelenXR

@nikitos1550 Great! Many thanks! This issue bothered me for a long time, so it is a naming compatibility of Valve...

cjlong1213 avatar Jun 08 '17 03:06 cjlong1213

Also thanks to https://github.com/sencercoltu @sencercoltu he also spent time with me researching this issue. @cjlong1213 pls check your email

@HelenXR I think openVR is somehow open, but not opensource, most interesting things are closed, so you have to research them by yourself, like sensor fusion, etc. Also spen a lot of time for NVIDIA white list, it is closed, but same time you can find solution in the internet (these days, seems, it is not a secret anymore). Also guys, most of you are from china, is it possible to chat with you some time, interesting what changed about VR there last half year, there were a lot of startups, a lot of new hardware announces, but still can`t find something new on taobao.

nikitos1550 avatar Jun 08 '17 05:06 nikitos1550