aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.43k stars 3.91k forks source link

WebXR not working on Chrome Desktop Windows #4709

Open dmarcos opened 3 years ago

dmarcos commented 3 years ago

Chrome has switched from vendor specific APIs to OpenXR. Oculus and Valve have shipped experimental runtimes on their respective beta channels. It requires users to opt in. Once the OpenXR implementations ship on the release channels WebXR will work automatically. No changes required on the A-Frame side. Keeping this open as a reference.

kk262777 commented 3 years ago

For me WebXR no longer works for my Valve Index and Chrome. I contacted Valve support and they said it's an known bug and they are working on a fix.

korinVR commented 3 years ago

The latest Steam VR beta contains a related update (for Vive). I haven't tried it yet though.

https://steamcommunity.com/games/250820/announcements/detail/3041591392731443550

Fix for applications in app containers failing to connect (ex. WebXR)

toji commented 3 years ago

I can confirm that Valve's OpenXR implementation was broken with WebXR in the latest stable release, but the most recent beta (1.16.10) did indeed fix it for me. You can opt in to the beta channel to get the fix right away, and my understanding is that it should roll into the stable release in maybe a week or so?

guillefix commented 3 years ago

It still doesnt work for me. It either doesnt do anything when I press "Enter VR", or it displays the scene, but doesnt track the HMD

dmarcos commented 3 years ago

@guillefix Can you share headset / runtime / link to reproduce? Have you tested with the A-Frame examples

zalo commented 3 years ago

For what it's worth: adding --disable-features=XRSandbox to my Chrome shortcut allows me to use AFrame's VR Examples in SteamVR on my Oculus CV1 with the latest Stable Chrome (89). No dice on getting Public Test Channel in the native Oculus Compositor to work...

One behavior I notice is that the VR button disappears upon entering VR... and the browser crashes if I try to use the back button while in VR.

dmarcos commented 3 years ago

I gave this another try on my machine while investigating a reported bug with Vive.

With the WebXR samples I get same issue described above

I can click the Enter VR button but in headset I only see a "Chrome 90 Next Up" SteamVR modal and content never presents.

I tried both with Steam VR release channel (1.16.10) and beta (1.17.6). Same results with both

I'm on Windows 10 Pro (20H2 / 19042.928) and Chrome 90. Also same result with Chrome Canary (92).

I'm testing on a Vive Pro with original Vive wands.

@toji Is this still a known / open issue? Thank you

haolink commented 3 years ago

I was able to reproduce the issue described above in Chromium Edge 90 on Windows 10 21H1 on SteamVR (both release and beta). The only supported backend is OpenXR.

In my case --disable-features=XRSandbox did the trick - that would seem to me that the issue is in the hands of SteamVR's OpenXR implementation and not A-Frame/Edge/Chrome.

I was using a Valve Index to test.

dmarcos commented 3 years ago

@haolink Thanks so much for the info

zalo commented 3 years ago

He also poked Joe about it on the SteamVR forum : https://steamcommunity.com/app/250820/discussions/8/2448217320134520064/

JoeLudwig commented 3 years ago

No need to poke me over there. I'm watching this issue.

SteamVR support for OpenXR and this extension shipped months ago. I was running it this morning from a local build, but apparently something is going wrong with builds shipped via Steam.

Are there any log files in either Chrome or Edge that would provide insight into where it failed? Did it get through the OpenXR loader and actually load vrclient_x64.dll, for instance?

dmarcos commented 3 years ago

@JoeLudwig Thanks for the info. I don't have a headset around at the moment to test.

Where are the log files you need stored? Maybe someone can give it a try and collect the info.

haolink commented 3 years ago

Hello @JoeLudwig - thank you for that I wasn't aware you were the same person. Sorry for bugging you on both sides. I was trying to generate logs for Chrome as well as SteamVR using the instructions provided at https://developer.valvesoftware.com/wiki/SteamVR/Combined_Logging (for SteamVR) as well as https://www.chromium.org/for-testers/enable-logging (for Chrome).

The first results were pretty discouraging: the Session seems to be initialised fine on both sides - I was using a very simple WebXR example available at https://immersive-web.github.io/webxr-samples/immersive-vr-session.html .

I ended up digging deeper and download the source code of Chromium from googlesource to be able to debug it - whether the XRSandbox is enabled or not, Chromium doesn't seem to behave any differently when it comes to initialising OpenXR (performed in openxr_device.cc in the methods RequestSession and OnRequestSessionResult ). The submitted XRRuntimeSessionOptionsPtr object as well as the received XRSessionPtr object seem to be identical, they even contain information such as a display information for my Valve Index which seem plausible (view port size of 1912x2124) .

The main difference between the XRSandbox mode and the legacy mode is how Chromium initiliases its sub processes. When XR is requested for the first time, chrome.exe spawns a sandboxed sub process with lower permissions with several code mitigations. This process seems to be able to contact OpenXR but not render anything.

JoeLudwig commented 3 years ago

Apps running in app containers don't have access to the SteamVR log directory. So the SteamVR logs show up somewhere inside the app container. They would be called xrclient_.txt if they're using OpenXR.

In a toy test app I managed to find them and learn stuff about them, but I don't think that generalizes very well. Combined logging won't work because that just writes to a log file that the app container can't write to.

BTW, I tracked down my difficulty getting WebXR to work to a configuration issue with my dev machine. It's working fine for me now.

haolink commented 3 years ago

Hello Joe. Thanks for your input. I managed to find the xrclient.txt files. I submitted 4 of them.

Sandbox disabled:
-Chrome: xrclient_chrome_nosandbox.txt -MS Edge: xrclient_msedge_nosandbox.txt

Sandbox enabled:
-Chrome: xrclient_chrome_sandboxed.txt -MS Edge: xrclient_msedge_sandboxed.txt

So yeah, it's pretty clear:

Wed May 19 2021 21:38:40.588 - ComposeLayerProjection: failed to submit view 0: VRCompositorError_SharedTexturesNotSupported
Wed May 19 2021 21:38:40.588 - CD3D11VRRenderer::Initialize(): Failed to create input layout for vertex shader shaders/distort_vs.fxo!
Wed May 19 2021 21:38:40.588 - Error creating VR renderer.
Wed May 19 2021 21:38:40.588 - ComposeLayerProjection: failed to submit view 1: VRCompositorError_SharedTexturesNotSupported
Wed May 19 2021 21:38:40.599 - CD3D11VRRenderer::Initialize(): Failed to create input layout for vertex shader shaders/distort_vs.fxo!
Wed May 19 2021 21:38:40.599 - Error creating VR renderer.

So it seems VRCompositorError_SharedTexturesNotSupported - is our issue at hand?

capnmidnight commented 3 years ago

I had previously been able to use WebXR through Windows MR in Chromium 89. I don't recall if it worked in 90, but as of 91 it does not work anymore. 92 in the beta channel is similarly broken, but 93 in the dev channel works.

What's interesting is that, if my controllers are turned off, it works in 91, until the controllers are turned on.

The addition of --disable-features=XRSandbox had no effect.

Don't know if that's helpful to anyone. I know the original conversation was about SteamVR devices, but maybe this isn't a problem of Valve's OpenXR driver, but rather of an implementation issue in Chromium itself.

toji commented 3 years ago

@capnmidnight: Do you have a Samsung Odyssey by chance? There was a recent fix for an error that occurred when connecting controllers for that device.

capnmidnight commented 3 years ago

Yep, that is correct. Thank you.

aitchpea commented 2 years ago

This is an oldish thread and it has a good chunk about Oculus - but I thought I would add that my combination of HTC Vive headset + Chrome 94 and SteamVR beta 1.20.1 would not work in looking at any WebXR (or AFrame WebVR) content and did as described above (i.e. showed a startup logo for Chrome but nothing more).

For me the addition of --disable-features=XRSandbox fixed the issue (I mention this as my googles did not get anything specific to my issue so wanted to help reduce other peoples search time to find a solution)

haolink commented 2 years ago

@JoeLudwig Hello - I'm sorry to ping you directly. Has there been any progress on the issues especially with the logs provided above. So far it still only seems to work if the XRSandbox on Chromium based browsers is disabled - while it does work on Firefox. Would it be an issue to forward to Chromium or is it an SteamVR related issue as (at least some people) claim it would work with Oculus devices running OpenXR within Chromium.

You essentially wrote in the comment 847246039 in this ticket how it would be working on your development machine by now. Any estimate when the fix might roll out onto SteamVR betas? So far it doesn't seem to have arrived there yet. Thank you ^^.

fybits commented 2 years ago

For me the addition of --disable-features=XRSandbox fixed the issue (I mention this as my googles did not get anything specific to my issue so wanted to help reduce other peoples search time to find a solution)

Fixed my issue as well. Thank you so much!

vt5491 commented 2 years ago

Oculus rift user here: --disable-features=XRSandbox worked for me too, once I set the openXRRuntime on oculus app to oculus (previously, I had steam vr). Now I can get xr mode on chrome and edge (but not firefox).

$ "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-features=XRSandbox

oculus_screen_shot

joostVRbeelding commented 2 years ago

I am trying to get this to work, but run into problems.

The --disablefeatures option work only when I run Chrome as administrator. Then I am able to run the AFrame examples.

But when I run the Unity WebXR desert example I get problems. I can load the scene and it works fine in 2D. When I click on the VR icon the view on the screen splits in two, but I get the error Uncaught TypeError: Cannot read properties of null (reading 'transform') In the console: Uncaught TypeError: Cannot read properties of null (reading 'transform') at XRManager.getGamepads (webxr.js:227:35) at XRManager.animate (webxr.js:347:28) at XRSession. (webxr.js:147:28)

When I tried it in Edge the scene also loads and works fine in 2D. When I clicked on the VR icon the screen split and the headset was tracking. I could see the image on the screen move. One of the controllers was off and when I switched it on I got the same uncaught TypeError.

So I then did a test without the controllers. Now also in Chrome the headset is tracked, but the image in my Vive is still completely black. And at some point Chrome crashed, so I had tp type this twice....

I am using an HTC Vive and SteamVR 1.21.12, with current OpenXR environment set to SteamVR. The Khronos OPenXR version in the registry is 1

dmarcos commented 2 years ago

Thanks everybody for the detailed reports

@toji @klausw Are these issues collected anywhere? Should we submit the details somewhere? Thanks!

msvawer commented 2 years ago

Hello thank you for this work.

I think my question is related- question I'm having trouble finding answers to- I have an Oculus Link cable, and when connected/in developer mode I can view WebXR experiences, ( chrome Version 99.0.4844.84 (Official Build) (64-bit) btw).. But without my link cable connected I am not able to do the experiences

My question is...is there a way to view these same WebXR experiences without a link cable? Do most people with a Quest have a link cable? I thought no? But maybe I'm wrong.

Can someone explain or point me in a direction

I am asking because I would like to share WebXR experiences with friends (I'm thinking people who have an Oculus 2, but not a link cable and don't have developer mode as an option...

I am asking here because to be honest I haven't really been able to find simple documentation on how to view WebXR (especially for non-developers) (info like what headsets currently work, what web browsers you can use, if a link cable is required, if developer mode is required etc Where is that information??

WebXR site simply says this "Enable VR by rendering the scene using the platforms VR capabilities."

And Oculus mostly has developing for webxr info

capnmidnight commented 2 years ago

Oculus Browser, which is installed by default on the Quest, supports WebXR. Actually, it probably has the best WebXR support of any browser. If a particular WebXR experience doesn't work in Oculus Browser, it's probably a problem with that site in particular.

De-Panther commented 2 years ago

@joostVRbeelding which demo? The mozilla unity exporter was dropped a long time ago. This one should work https://de-panther.github.io/unity-webxr-export/Build

cabanier commented 2 years ago

Oculus Browser, which is installed by default on the Quest, supports WebXR. Actually, it probably has the best WebXR support of any browser. If a particular WebXR experience doesn't work in Oculus Browser, it's probably a problem with that site in particular.

If a website is making the assumption that it's running on Quest with Quest controllers, it's definitely a site problem.

joostVRbeelding commented 2 years ago

@joostVRbeelding which demo? The mozilla unity exporter was dropped a long time ago. This one should work https://de-panther.github.io/unity-webxr-export/Build

Oh man, why do I hate my job.... :-) I just spent more than an hour trying things out, troublshooting, writing a lengthy reply about what did not work (also in the demo link you sent) and that Unity did not show me the updated version.

And then I did get the update notice in the Package Manager and after updating to package 0.14.0 the VR stuff works. Also in the demo version. I don't know how this can be related, espcially for the demo version, but the VR part works now.

The desktop part still doesn't work, however. I can not move using the arrow keys or wasd and I can not look around using the mouse. This happens both in the demo version and in my own build.

I hope that's an easier fix than the VR stuff.

Thanks!

CrowtreesStudio commented 2 years ago

I'm running a Lenovo Explorer in Windows 10.

Initially, I was using Firefox with the WebXR flags set to true including WebVR. Running native VR content everything appears normal and as expected in Microsoft's MR Portal and SteamVR Home. Running WebXR in A-Frame or trying out the WebXR examples page, the controllers do not display although the headset is tracked normally.

Using Ada Rose Cannon's WebXR Boilerplate, I see the correct controllers (no hand geometry) which are tracked correctly but the buttons/triggers have no functionality. The thumbstick will project a teleport arc but this then 'sticks' (displayed) without any means to trigger the actual teleport.

On trying Chrome or Edge did not launch the A-Frame project(s), the 'VR' button simply turned red on clicking. Using the WebXR example page I had a tool-tip feedback on clicking "Enter VR" button saying: 'The specified session configuration is not supported'.

alcooper91 commented 2 years ago

@CrowtreesStudio Can you share the required/optional features you're requesting?

If you can install (from the Microsoft store) "OpenXR Tools for Windows Mixed Reality" and share the information from under "OpenXR Runtime" that would help as well.

It seems like the controller issues are likely a browser bug, and it may be worthwhile to file a new issue for that (if you do, please mention it should be routed to Blink>WebXR/alcooper@); but I'm not sure about A-Frame failing to enter VR when the boilerplate is (if you can link to the specific sample that would be great as well), so that could be an A-Frame issue.

dmarcos commented 2 years ago

@CrowtreesStudio Can you share a link to the A-Frame example that reproduces the issue? Thank you and sorry for the inconvenience.

luisscholl commented 2 years ago

Just to add my experience for future searches.

Using Chrome (100.0.4896.127) and a Valve Index a-frame works as expected.

However SteamVR always crashes when exiting Chrome from the SteamVR menu or via hot reloading (which ends the immersive session and loads SteamVR's Home). Opting into the SteamVR beta reduces the crashes significantly. In about 2 hours of development with frequent hot reloading SteamVR crashed once after opting into the beta.

CrowtreesStudio commented 2 years ago

@dmarcos This is a link to an earlier version of Ada's boilerplate I'm using to test with. https://crowtreesstudio.github.io/Adas_XR_boilerplate/index.html In this version I can see the controllers and produce the teleport arc as described in my first post.

This is the XR example I tried which which produces the tooltip error "The specified session configuration is not supported" when clicking the VR button in Chrome and Edge. https://immersive-web.github.io/webxr-samples/immersive-vr-session.html

What maybe confusing in my original post is that I'm talking about two issues I'm having: One is that the controllers do not display and/or function correctly in WebXR and secondly, I'm unable to launch a VR file from Chrome or Edge.

I downloaded the OpenXR Tools as you suggest @alcooper91 and screenshot is below.

PS I just tested Babylonjs XR using the Hill Valley example (https://www.babylonjs.com/demos/hillvalley/) and it behaves identically to the above, so something else is going on and it's not specific to A-Frame or Three.js. Sorry if that adds further confusion. My usual methods of problem solving are failing me now and I find myself frustrated and confused as to how to proceed.

PSS Quick note: I've been using Firefox with webxr flags set to true to test with since Chrome and Edge don't like me at the moment. Just tested above links and now controllers don't even show up. A little consistency would be great :(

openxr

haolink commented 2 years ago

Just to add my experience for future searches.

Using Chrome (100.0.4896.127) and a Valve Index a-frame works as expected.

I'll just quickly ask - this is my configuration as well - did you have to use --disable-features=XRSandbox as launch parameter or did it work without? For me I have to assign these still.

Because while it's nice that it's working this way, it's not production ready this way if you need to explain to users that they need to modify their Chrome launch parameters. Firefox works.

dmarcos commented 2 years ago

@luisscholl @haolink @CrowtreesStudio Thanks so much for collecting and sharing the info.

CrowtreesStudio commented 2 years ago

@haolink I wouldn't even know how to disable a feature as you describe. I'm using this 'out of the box' as I'm primarily a designer with intermediate coding skills. Like you, I'm looking for a solution that also works 'out of the box' and requires no extra work on the players/users. For my students, A-Frame provides a scaleable experience and (as they are design students) requires minimal coding experience. No problem @dmarcos, I appreciate yours and everyone's time on this. Thank you.

luisscholl commented 2 years ago

@haolink I only enabled "WebXR Incubations" at chrome://flags. (You can enter chrome://flags into the URL bar.) I did not have to use --disable-features=XRSandbox. Should have mentioned this earlier.

alcooper91 commented 2 years ago

I've filed https://crbug.com/1319971 for the controller issues you were seeing @CrowtreesStudio Let's keep further discussion there to try to isolate this from some of the other issues about entering VR.

I think our error messages are fairly generic (though there should be more detail in the dev tools console which you can pull up with ctrl+shift+I), but it's worth noting that you can only have one active WebXR session at a time, so if it didn't fully exit a previous session, that could cause it to fail. If you can enter, it would be great if you could try the following sites and report what happens/what you see in the bug I linked above: https://immersive-web.github.io/webxr-samples/controller-state.html https://immersive-web.github.io/webxr-samples/input-profiles.html

alcooper91 commented 2 years ago

@haolink part of the SteamVR installer should have set appropriate permissions on your SteamVR folder during installation to enable working without disabling the sandbox, as Chrome needs appropriate permissions to access the code while Sandboxed; so it sounds like something went wrong during your installation or an update where those permissions weren't set on the folder. Someone from Valve may be able to help you troubleshoot that.

haolink commented 2 years ago

@alcooper91 Thank you very much. Apparently it might have been related to the fact that I've used SteamVR for 5 years and never had to reinstall it - the permissions for OpenXR sandboxing apparently weren't set up. I fully uninstalled it, removed its settings files and reinstalled it. Tada, everything working fine. Thank you very much.

wmurphyrd commented 1 year ago

Thanks @dmarcos for tipping me off to this thread. Let me contribute my issues and findings.

Relatively new PC build: Windows 11, SteamVR, Valve Index. Fairly sure WebXR had worked successfully on this build in the past, but not 100% certain

Issue: Started up VR and saw a "SteamVR Updated" notice. Tried enter a WebXR immersive session but headset view hung forever on "Up Next: Chrome." Restarting browser or PC doesn't help. Check on WebXR sample site and VR Support is detected, but same result with WebXR sample Immersive VR Session

Toubleshooting attempt result
--disable-features=XRSandbox Resolved issue; can enter immersive session
Reinstall SteamVR through steam store Worsened issue; seeing "VR Support not detected" on WebXR sample
Manual clean install of SteamVR (as described here) Issue fully resolved; works without needing to disable XR Sandbox

I really thoroughly tested the clean install fix on multiple sites through multiple browser sessions and was confident it was solved. However, I came back a week later to find it broken again. Once again I had a "SteamVR updated" notice and once again have the forever hang on "Up next" unless I disable the XRSandbox.

Is SteamVR breaking WebXR every time it updates?

Also one other detail, even in the fully working state above, I could not exit one WebXR immersive session and then successfully enter another without restarting the browser. This separate issue is currently being tracked in Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1354399

Update: did another SteamVR clean install an it is fixed again

De-Panther commented 1 year ago

Now I have issues image

I guess this time it's the Oculus OpenXR env that don't want to work. I'm using Quest1 with Link/Air Link. When using Oculus for OpenXR, I get the error in the screenshot above. When switching to SteamVR for OpenXR, I can enter VR mode, but after a few times of entering and exiting VR there are some drawing issues, and then I need to re-open the browser.

iq3connect commented 1 year ago

We are seeing the same XRSession creation failed error on desktop Chrome/Edge after recent updates to Oculus runtime and Chrome/Edge. All I see is Chrome loading message in my Quest/2 (w link cable enabled). Oculus OpenXR is the active runtime in my registry,

De-Panther commented 1 year ago

My current solution was to re-install the desktop Oculus App, then it suggested to "update" from version 49 to 47. With version 47, WebXR works for me using the Oculus OpenXR runtime.

iq3connect commented 1 year ago

My current solution was to re-install the desktop Oculus App, then it suggested to "update" from version 49 to 47. With version 47, WebXR works for me using the Oculus OpenXR runtime.

Thanks will try that. I was on 47 and everything was fine. The update introduced the problem. Also, I am using the D-Link VR airbridge. I hope I don't loose support for that in V 47.

poolplayer0720 commented 1 year ago

My oculus app updated to V50 today and solved the issue with WebXR

De-Panther commented 1 year ago

Oculus App version 50 works for me as well.

sookie928 commented 1 year ago

same here XRSession creation failed error and hand-tracking detection error on Edge holographic for Hololens 2 after last updates.

De-Panther commented 1 year ago

Hololens 2 is not desktop...