immersive-web / webxr-samples

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

immersive-ar samples not working #61

Open anderskig opened 4 years ago

anderskig commented 4 years ago

Using Huawei P20 I can't run any of the immersive-ar samples.

I can click "Start AR" but when I do the following happens:

Chrome versions tested: Chrome Beta (81), Dev (82) and Canary (82) all with the same result. No extra flags added, but should not be needed with these versions?

Tested with remote debugging and no console errors show.

The immersive-vr samples work fine.

Is this a result of yet new breaking changes in the webXR spec or something specific with my phone?

anderskig commented 4 years ago

I borrowed a OnePlus 3 as well. AR samples does not work there either, but it behaves differently.

I can click "Start AR" and the following happens:

Edit: My bad, Apparently OnePlus 3 does not support ARCore (while OnePlus 3T) does. I would not expect the "Start AR" button to be clickable if ARCore is not available though?

bialpio commented 4 years ago

Thanks for the report! You are correct, there should be no additional flags required on the versions that you mention. In our current implementation, we do not fully initialize the runtime that will be used until you actually attempt to create the session - this means that the call to isSessionSupported will return a best-effort response, but the session creation might still fail on unsupported devices.

As for Huawei P20 - can you quickly verify that Chrome Beta 81 has the Android's camera permissions enabled? If the camera permissions are granted, could you file a feedback through Chrome's "Help & feedback" menu option? It'd help us investigate the issue if you follow the steps:

  1. On the phone, close the Chrome Beta 81 entirely (make sure it's not just suspended).
  2. Open Chrome Beta 81.
  3. Reproduce the issue.
  4. Still in Chrome, go to Menu -> Help & feedback -> Send feedback. Make sure to include the system log with the report. Please mention WebXR and maybe potentially my username (bialpio) so that it reaches me quicker.
klausw commented 4 years ago

Also, could you check if ARCore is working in general on these phones, apart from WebXR? See https://developers.google.com/ar/discover/supported-devices#supported_device_models .

I also set up a quick test page that should use Model Viewer's scene viewer on an ARCore-capable phone, without WebXR. Does this work for you? https://modelviewer-ar-test.glitch.me/

anderskig commented 4 years ago

@bialpio It was indeed a camera permission issue. I'm confused as how I managed to get in that state though. I downloaded beta, then dev, then canary for the sole reason of testing this, and I really don't understand why I would have denied permission to them all when popup was shown. I'm actually pretty sure I clicked allow on them all. But when checking app permissions it was denied for all three.

One interesting thing is I noticed a couple of differences between chrome beta and dev:

Anyway, samples work fine for me now. Thanks!

NNskelly commented 4 years ago

For the record, I'm experiencing the exact same symptoms on a Samsung S9 on beta 81.0.4044.18 (a build explicitly linked and implied compatible by an AndroidPolice article you were linked in a few weeks back - https://www.androidpolice.com/2020/02/15/chrome-beta-81-brings-augmented-reality-and-nfc-support-to-the-web/ ). Only in my case, it looks like camera permissions ARE enabled for both my release (80.x) and beta (81.x) builds within Android Settings -> App Settings. Oddly, 80 runs all VR demos successfully and asserts AR is unavailable, 81 beta asserts AR demos are available (but fails with session config errors) and "VR NOT FOUND" buttons on the VR examples I've tried. Will try upgrading to latest beta, but the coworker I'm looking into XR for mentioned a note on some github somewhere that the latest beta/canary builds themselves have broken XR. Does this sound like a situation I should report as above, or an ongoing chrome issue I should wait a few days to see stabilize?

Edit: same symptoms on beta 81.0.4044.34; also camera permissions within chrome settings are "Ask First" which appears to be the most permissive; only other option is "Blocked"

Further Update: Canary 82.0.4076.0 looks like it's working for AR. Got the camera permissions popup even after manually granting camera permissions in Android app settings, but that's probably standard security protocol. Coworker's canary 82.0.4075.0 WAS broken for AR; updating to 4076 fixed it again.

bialpio commented 4 years ago

Oddly, 80 runs all VR demos successfully and asserts AR is unavailable (...)

AR is not supported on Chrome 80 so this is expected.

81 beta asserts AR demos are available (but fails with session config errors) and "VR NOT FOUND" buttons on the VR examples I've tried.

Can you elaborate on "fails with session config errors"? Does that mean that the call to navigator.xr.requestSession() is failing? Also, can you share the URL to the specific sample that is failing for you?

VR NOT FOUND is definitely unexpected (both on Stable 80 and Beta 81) - can you report this?

Does this sound like a situation I should report as above, or an ongoing chrome issue I should wait a few days to see stabilize?

Issues on Canary are somewhat expected as it gets released daily (it's still good to let us know about them, just in case), but if you're seeing any issues in Chrome Stable or Beta, we definitely would like to hear about them. Chrome's "Send feedback" function is one way to report issues, https://crbug.com/ is another to consider.

NNskelly commented 4 years ago

ok; submitted 2 feedbacks on respective demos, with attached screenshot and (iirc) logs. VR issue is that on 81 beta (but not 80 release or iirc 82 canary), the experience start buttons are simply greyed out, VR NOT FOUND AR issue is basically what anderskig reported: on 81 beta (both the one currently available via the Play Store on Samsung S9 AT&T and the latest-latest APK independently installed, and not on latest 82 canary), tap the experience start button, agree to the camera/AR prompt (first time only), the button shakes/greys briefly, 3D background render halts, and an empty alert pops at the bottom of the screen. Attached debugger shows XRSession creation failed: The specified session configuration is not supported.

peiyumo commented 3 years ago

"Immersive-ar" mode is not working yet. I had tested offical sample on both Pixel3 and HUAWEI P30 Pro, none of them can show ar scene normally.

Then I had built a sample by follow this toturial.

All I got is this error : Could not create a session because: The runtime for this configuration could not be installed

As it passed the environment check, what kind of configuration should be there?

mattfedo-insight commented 3 years ago

Do we have any updates on the AR samples and how to load them properly? On most devices / browsers I am getting "Could not instantiate the session"

Simon1059770342 commented 2 years ago

ok; submitted 2 feedbacks on respective demos, with attached screenshot and (iirc) logs. VR issue is that on 81 beta (but not 80 release or iirc 82 canary), the experience start buttons are simply greyed out, VR NOT FOUND AR issue is basically what anderskig reported: on 81 beta (both the one currently available via the Play Store on Samsung S9 AT&T and the latest-latest APK independently installed, and not on latest 82 canary), tap the experience start button, agree to the camera/AR prompt (first time only), the button shakes/greys briefly, 3D background render halts, and an empty alert pops at the bottom of the screen. Attached debugger shows XRSession creation failed: The specified session configuration is not supported.

Hi Mate! Same problem here! Dis you solve that problem? THX!

AhsanJawaidAJ commented 2 years ago

can someone help me figure out how to use an android device with this app. The browser on my laptop says ar not found.