exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
994 stars 117 forks source link

nativeVr reports HMD present when none connected #524

Open sidequestlegend opened 5 years ago

sidequestlegend commented 5 years ago

is there a way to force "2D" mode? Like say I just have Steam VR installed, can i launch an aframe example without it trying to present to the VRDisplay? Can i utilize the FakeVRDisplay located here for that somhow?

https://github.com/webmixedreality/exokit/blob/master/src/core.js#L28

currently i'm getting:

{ Error: Hmd Not Found (108)
    at Object.nativeVr.requestPresent (C:\workspace\expanse-app\exokit\src\index.js:329:58)
    at VRDisplay.vrDisplay.onrequestpresent.layers [as onrequestpresent] (C:\workspace\expanse-app\exokit\src\core.js:1567:53)
    at VRDisplay.requestPresent (C:\workspace\expanse-app\exokit\node_modules\vr-display\index.js:211:12)
    at HTMLElement.value (https://aframe.io/releases/0.8.2/aframe.js:73308:28)
    at enterVRBound (https://aframe.io/releases/0.8.2/aframe.js:73182:48)
    at emit (events.js:182:13)
    at EventEmitter.emit (domain.js:442:20)
    at _emit (C:\workspace\expanse-app\exokit\src\Event.js:60:40)
    at window._emit (C:\workspace\expanse-app\exokit\src\core.js:1434:28)
    at _emit (C:\workspace\expanse-app\exokit\src\Event.js:38:14)
    at _recurse (C:\workspace\expanse-app\exokit\src\Event.js:46:7)
    at dispatchEvent (C:\workspace\expanse-app\exokit\src\Event.js:56:5)
    at _emitOneDisplay (C:\workspace\expanse-app\exokit\src\Document.js:222:16)
    at _tryEmitDisplay (C:\workspace\expanse-app\exokit\src\Document.js:215:11)
    at _delayFrames (C:\workspace\expanse-app\exokit\src\Document.js:203:13)
    at _delayFrames (C:\workspace\expanse-app\exokit\src\Document.js:226:11)
    at window.requestAnimationFrame (C:\workspace\expanse-app\exokit\src\Document.js:230:15)
    at tickAnimationFrame (C:\workspace\expanse-app\exokit\src\core.js:696:11)
    at Timeout._recurse [as _onTimeout] (C:\workspace\expanse-app\exokit\src\index.js:1401:12)
    at ontimeout (timers.js:424:11)
    at tryOnTimeout (timers.js:288:5)
    at listOnTimeout (timers.js:251:5)
    at Timer.processTimers (timers.js:211:10) code: 108 }
avaer commented 5 years ago

Hm, I think if there is no HMD connected OpenVR should have said so here. And therefore the vrdisplayactivate shouldn't have been emitted.

Does this mean OpenVR is saying there is a display connected and then erroring because it isn't?

avaer commented 5 years ago

To more directly answer the question, I think you should be able to disable VR support with -x none. But if OpenVR is misdetecting it might try to boot it anyway.

sidequestlegend commented 5 years ago

Yep that check is passing i.e nativeVr.VR_IsHmdPresent() === true when i have no HMD connected and Steam VR says Not Ready. The -x switch works well though!