immersive-web / webxr-samples

Samples to demonstrate use of the WebXR Device API
https://immersive-web.github.io/webxr-samples/
MIT License
997 stars 480 forks source link

VR and AR samples not working on Samsung Galaxy Note 9 (Chrome Dev and Canary) #29

Open dobi01 opened 5 years ago

dobi01 commented 5 years ago

Samsung Galaxy Note 9 (SM-N960F) OS: Android 8.1.0

Chrome: 71.0.3578.99 Chrome Canary: 73.0.3672.0 Chrome Dev: 73.0.3667.2

AR sample

Steps to reproduce the problem:

  1. Install ARCore
  2. Enable WebXRDevice API (#webxr) and WebXR Hit Test (#webxr-hit-test) in chrome://flags
  3. Visit https://immersive-web.github.io/webxr-samples/proposals/phone-ar.html?allowPolyfill=1
  4. Tap "Start AR" button
  5. Grant access to camera

What is the expected behavior? AR mode should start with live camera view in background.

What went wrong? AR mode does not start. Background doesn't show live camera view.

Console: Chrome Dev and Chrome Canary Uncaught (in promise) DOMException: Failed to construct 'XRWebGLLayer': This context is not marked as XR compatible. at onSessionStarted (https://immersive-web.github.io/webxr-samples/proposals/phone-ar.html?allowPolyfill=1:150:29) at https://immersive-web.github.io/webxr-samples/proposals/phone-ar.html?allowPolyfill=1:133:15

Chrome phone-ar.html?allowPolyfill=1:1 Uncaught (in promise) DOMException

Note: When running on dev server my own AR page without polyfill I get: Chrome Dev and Chrome Canary Uncaught (in promise) TypeError: this.gl.setCompatibleXRDevice is not a function

this.gl = this.renderer.getContext(); await this.gl.setCompatibleXRDevice(this.session.device); this.session.baseLayer = new XRWebGLLayer(this.session, this.gl);

VR sample

Steps to reproduce the problem:

  1. Install ARCore
  2. Enable WebXRDevice API (#webxr) and WebXR Hit Test (#webxr-hit-test) in chrome://flags
  3. Visit https://immersive-web.github.io/webxr-samples/input-selection.html?allowPolyfill=1

What is the expected behavior? VR content should be displayed in background. User can select an object and change it color.

What went wrong? VR content isn't displayed in background.

Console: Chrome Dev and Chrome Canary Uncaught (in promise) DOMException: Failed to construct 'XRWebGLLayer': This context is not marked as XR compatible. at onSessionStarted (https://immersive-web.github.io/webxr-samples/input-selection.html?allowPolyfill=1:190:29) at https://immersive-web.github.io/webxr-samples/input-selection.html?allowPolyfill=1:112:19

Chrome It works! VR content is displayed in background. User can select an object and change it color.

I'm fairly new to the web development and don't have access to any other ARCore compatible device right now, so I'm not sure if this behavior is related to the device itself or unstable WebXR Device API.

Does anyone have an idea how to construct 'XRWebGLLayer' (mark context as XR compatible)?

dobi01 commented 5 years ago

The issue was last update of Chrome Dev (January 11), because every sample was working fine on OnePlus with Chrome Dev 73.0.3643.0 (December 19).

wave-electron commented 5 years ago

Is this still an issue?

cgrohman commented 5 years ago

Wondering if anyone was able to get the AR examples working (Proposals tab)? Running Chrome Canary 77.0.3815.0, Samsung Galaxy S8. On the "fudd" branch I am able to select "Start AR" but the camera feed never begins and I am not receiving any errors via Dev Tools. Appreciate any help or pointers!

itamayo commented 4 years ago

Same here, nexus 5 AR examples not working, even enabling XR flags EDIT: Working enabling only following flags:

WebXR Device API, WebXR AR module & WbeXR Hit Test

klausw commented 4 years ago

Assuming you're using up to date stable Chrome (currently v79), "WebXR Device API" is enabled by default, and VR mode should work using either Cardboard or Daydream without needing any flag changes.

AR support on Chrome requires an ARCore-compatible device with the corresponding minimum Android version (at least Android 7/N, some devices need Android 8/O) as noted in that list. You need to enable "WebXR AR module" in chrome://flags for AR support, and add additional flags depending on what the specific sample or application is using, i.e. "WebXR Hit Test", "WebXR Incubations" (in newer Chrome versions) etc.