Does chromium support webxr API in linux?

916 views
Skip to first unread message

于洋

unread,
Dec 26, 2023, 3:52:06 PM12/26/23
to Chromium-dev, alco...@chromium.org, baj...@chromium.org, agr...@chromium.org, bia...@chromium.org
Hello~
Recently I begin to learn webXR APIs and plan to use it in Linux based OS' chromium.
I wonder does Chromium support webXR API in Linux now?

As the table showed in this page https://source.chromium.org/chromium/chromium/src/+/main:device/vr/README.md
there's only android and windows OS are supported,
I did not find any doc or guide to say chromium support webXR in Linux or not.
does chromium in linux also support webXR through openXR? or ARCore? it seems ARCore are for mobile device like android.

To verify my Ubuntu support webXR APIs or not, I access this test page "https://immersive-web.github.io/webxr-samples/" using chrome,
it said:
Your browser implements the WebXR API and may be able to run Virtual Reality or Augmented Reality experiences if you are using a supported OS and the appropriate hardware.
❌ - VR support not detected
❌ - AR support not detected

My Ubuntu Chromium's UA info:
Browser name: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/99.0.4844.51 safari/537.36

it seems currently Linux already supported webXR APIs right?
if so could you share related code dir or patch for linux platform?
Any reply will be appreciated :)

Alex Cooper

unread,
Jan 2, 2024, 2:05:24 PM1/2/24
to 于洋, Chromium-dev, baj...@chromium.org, agr...@chromium.org, bia...@chromium.org
Thanks for your message,

At present Chromium does not support immersive-vr or immersive-ar on Linux, though inline sessions (e.g. https://immersive-web.github.io/webxr-samples/inline-session.html) should be supported. As noted on the document you found this is largely due to the absence of traction for runtimes on Linux.

The document is slightly out of date in that we now have some OpenXR support on Android (behind a flag), but currently do not support (or plan to support at this time) OpenXr on Linux; however as an Open Source project patches are always welcome :). If you look through the history and the changes we've started doing to make OpenXr work for Android (largely found in this directory), you may be able to plug in to some of that architecture or re-use some logic to add support, but I'm not familiar with any requirements OpenXr may have on Linux. I will also note that the browser UA of 99 seems fairly old, and there's been a lot of Chromium development since then, particularly in WebXR since Chrome is currently on M120 for Stable.

Thanks,
Alex

Alex Cooper

unread,
Jan 3, 2024, 12:38:06 PM1/3/24
to 于洋, Chromium-dev, baj...@chromium.org, agr...@chromium.org, bia...@chromium.org
That is correct. Chrome includes an OpenXR Loader which looks for an appropriate OpenXR Runtime on the system and talks to that via the OpenXR APIs. Chrome does not ship an OpenXR implementation that talks directly to the devices. I am not aware of any such runtimes for linux, though I know that Monado (https://monado.freedesktop.org/) is working on more cross-device and cross-platform support, so you may have some luck there.

On Wed, Jan 3, 2024 at 2:36 AM 于洋 <yuyang.l...@gmail.com> wrote:
Hello, Alex

   Thanks very much for your reply.
   I'm tring to support webxr in arm linux platform, I think I could refer the openXR supported for android.
   and as I know,  the webXR calls openXR API and it communicate with xr runtime who get state from vr device, am I right?
   does chromium include the xr runtime ? or user need to install xr runtime to support webxr?
   if it includes, what runtime does it use in windows and android seperately?
   if it does not include, what runtime it needs to be installed?

BR,
Yu Yang.
   


   

于洋

unread,
Jan 3, 2024, 1:27:20 PM1/3/24
to Chromium-dev, Alex Cooper, Chromium-dev, baj...@chromium.org, agr...@chromium.org, bia...@chromium.org, 于洋
Hello, Alex

   Thanks very much for your reply.
   I'm tring to support webxr in arm linux platform, I think I could refer the openXR supported for android.
   and as I know,  the webXR calls openXR API and it communicate with xr runtime who get state from vr device, am I right?
   does chromium include the xr runtime ? or user need to install xr runtime to support webxr?
   if it includes, what runtime does it use in windows and android seperately?
   if it does not include, what runtime it needs to be installed?

BR,
Yu Yang.
   


   

在2024年1月3日星期三 UTC+8 03:05:24<Alex Cooper> 写道:
Reply all
Reply to author
Forward
0 new messages