model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

WebXR issue on Samsung S22. No camera feed but AR works.

Open velickolb opened this issue 2 years ago • 44 comments

Description

I have issue with WebXR on Samsung s22 where camera feed is not showing up. Sometimes it completely black and sometimes its showing the web page from where AR is loaded. In both cases model is instantiated and all interactions are working. It affects all the AR pages where WebXR is used, example ones and all the others. Scene Viewer works fine. I have attached screenshot and video.

Demo

  • Screenshot: This is an image
  • Video: https://drive.google.com/file/d/1wzKdVQ_8Jx2bK2BFgIvyd5jfxDL6b7ZG/view?usp=sharing

Version

  • model-viewer: v1.12.0

Browser Affected

  • [ ] Chrome, version: 101.0.4951.61
  • [ ] Samsung Internet: 17.0.1.69

OS

  • [ ] Android 12

AR

  • [ ] WebXR

velickolb avatar May 25 '22 08:05 velickolb

I have the same problem, on Samsung Galaxy s22 camera feed is not showing up in google chrome with WebXR , i see a 3D model but the camera is black.

MladenZagajac avatar May 25 '22 09:05 MladenZagajac

I have experienced the same issue on Galaxy S22 in WebXR, when i start an AR session the screen is black like the camera isn't working but the model gets placed.

danilokrulj avatar May 25 '22 11:05 danilokrulj

Are there any updates on this topic, is this happening to anyone else?

MladenZagajac avatar May 30 '22 06:05 MladenZagajac

@AdaRoseCannon @klausw This sounds like a Samsung / WebXR problem. Can you verify the issue?

elalish avatar Jun 03 '22 21:06 elalish

Is dark mode on?

AdaRoseCannon avatar Jun 04 '22 06:06 AdaRoseCannon

Yes, but after turning it off it was still the same.

velickolb avatar Jun 06 '22 05:06 velickolb

I tried logcat to capture some logs and I got this error when trying to enter WebXR. Im guessing that it has something to do with the exynos cpu. I can not test the snapdragon version.

2022-06-05 11:08:23.075 8041-23236/? D/libEGL: ANGLE Info:Debug.cpp:183 (insertMessage): GL error: HIGH: External texture attached to framebuffer is not YUV.
2022-06-05 11:08:23.078 845-23407/? E/ExynosCameraRequestManager: [CAM(-1)][]-(hasStream[665]):Invalid Stream id (23) 

velickolb avatar Jun 06 '22 06:06 velickolb

That's helpful thank you!

AdaRoseCannon avatar Jun 06 '22 08:06 AdaRoseCannon

Any update on this issue? Facing the same issue with S22 running Exynos

v-prgmr avatar Jul 02 '22 09:07 v-prgmr

following, same issue here on s22 ultra

gattomanzo avatar Aug 01 '22 16:08 gattomanzo

One of my client has the issue with s22 exynos. Whoever have device with an issue in hand, can you please investigate/debug farther. There are millions of these devices, and it would be unexplainable for them why AR on their hi end devices does not work....

kolodi avatar Aug 20 '22 07:08 kolodi

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1355946 to follow up on the Chromium side.

Unfortunately we haven't been able to reproduce the issue - we don't have an S22 for testing, and it doesn't seem to be a general issue for Exynos devices, for example a Samsung Galaxy S7 Exynos appears to work normally.

klausw avatar Aug 23 '22 19:08 klausw

@AdaRoseCannon - do you happen to know someone at Samsung who I could contact to borrow an Exynos S22 for testing? They aren't being sold in the US.

Bigger picture, it's unclear if this is a Chromium bug (i.e. misusing a GL texture), a GPU driver bug, or just an incompatibility (i.e., Chromium assumes that a texture format is available, but this device would require using a different one.)

klausw avatar Aug 23 '22 19:08 klausw

@velickolb , would you be able to attach a longer logcat with more context to https://bugs.chromium.org/p/chromium/issues/detail?id=1355946 ? Specifically, it would help to know which of Chrome's processes (browser or GPU process) is emitting that error message. I've added more information about how to extract those logs in a comment there.

klausw avatar Aug 23 '22 20:08 klausw

I added a speculative workaround that's now available in Chrome Canary >= 107.0.5303.2. I still haven't been able to reproduce the issue or seen more detailed logs, so this is a bit of a stab in the dark, but please let me know in case this changes anything.

klausw avatar Sep 15 '22 23:09 klausw

I know this isn’t a model-viewer issue, but has anyone found the reason or a fix for this issue? I am using a S22 Ultra Exynos with Chrome/Samsung internet/Chrome Canary and I am facing the same issue, no camera feed whatsover after entering webXR’s AR mode. Unfortunately, @klausw ’s speculative workaround did not seem to do the trick for me. Any suggestions? Best, Julien

djebel-amila avatar Sep 26 '22 15:09 djebel-amila

Thanks @djebel-amila for the feedback. I'll try to get access to an Exynos S22 phone for further testing. Just to confirm, are all the phones affected by this issue Exynos S22 variants? You mentioned the S22 Ultra specifically, are the others using a plain S22 or a S22 Plus?

klausw avatar Sep 28 '22 16:09 klausw

Thanks @djebel-amila for the feedback. I'll try to get access to an Exynos S22 phone for further testing. Just to confirm, are all the phones affected by this issue Exynos S22 variants? You mentioned the S22 Ultra specifically, are the others using a plain S22 or a S22 Plus?

Hi, Thanks for your answer. It’s my understanding from reading this thread and the one on the webXR repo that the issue exists on S22 (as @fabian-muff reported it) and S22 Ultra at least, no one posted about S22 Plus. Some people facing the issue with a S22 Ultra and webXR’s example model-viewer said they found a quick-fix by inverting the order of the ar-modes parameters, from ar-modes="webxr scene-viewer quick-look" to ar-modes="scene-viewer quick-look webxr" but I’m not sure how relevant it may be.

Please let me know if I can be of help.

djebel-amila avatar Sep 29 '22 07:09 djebel-amila

Hello, @klausw I tested the fix you added to chrome canary. With Version 108.0.... nothing changet at the problem. I debugged some sessions on the webxr example page and there are no errors. The only one is the following, which it seems has nothing to do with the problem: image

I am using a Exynos S22 that I bought directly after the release in Switzerland.

fabian-muff avatar Sep 29 '22 08:09 fabian-muff

Samsung s22 model: SM-s901b/DS (exynos). I confirm that Scene Wiewer is working. So it must be not a hardware problem, but the browser or os. I've tried in Samsung Browser and Chrome. In both browsers there is no camera background feed in webxr at. Everything else is still working, planes are being detected and I can place 3D scene on them.

Scene Viewer is not what I can use though. In my case the 3d scene is being composed dynamically by the web app so when I go to the AR I cannot use the model url. I've tried to change the code to generate url dynamically for the glb file prepared on the fly similarly as it is for Quick Look (usdz). It doesn't work, the scene viewer is launched and asks you to find the plane, when the plane is found and it tries to shows the 3d model it crashes immediately.

kolodi avatar Sep 29 '22 09:09 kolodi

I am using a Exynos S22 that I bought directly after the release in Switzerland.

I am in Switzerland too. Imagine it’s just Swiss S22s 😳

djebel-amila avatar Sep 29 '22 09:09 djebel-amila

I am in Germany and my S22 does not give the camera feed in webxr mode.

I am using a Exynos S22 that I bought directly after the release in Switzerland.

I am in Switzerland too. Imagine it’s just Swiss S22s 😳

v-prgmr avatar Sep 30 '22 12:09 v-prgmr

@klausw can we provide any help?

fabian-muff avatar Oct 12 '22 07:10 fabian-muff

I have the same issue with my Samsung S22 Ultra. How can I help?

stspanho avatar Oct 23 '22 13:10 stspanho

Please see https://crbug.com/1355946#c7 for an update, I finally got an S22 and was able to reproduce it. In short, the root issue seems to be overzealous validation in the ANGLE-to-Vulkan layer that provides the native GLES driver on this platform. It does not allow use of a framebuffer color attachment backed by an RGB external texture, which is odd since this works fine on other devices including older Samsung Exynos phones. The specification is a bit unclear, but initial consensus seems to be that this is likely a bug and the validation check should be removed.

Unfortunately fixing this would need to happen at the GLES driver level, meaning that Samsung would need to ship an updated driver that includes an updated ANGLE library, this is a separate copy from the ANGLE library included in Chrome.

Doing a workaround in Chrome would be quite difficult. We can't use Vulkan directly since Chrome needs to share a GLES context with the ARCore library, and switching Chrome to using a YUV external texture is also tricky since it requires an extension and NDK support that I think we can't assume is generally present.

klausw avatar Oct 24 '22 15:10 klausw

@klausw Thanks a lot for the update and identifying the issue. Someone mentions trying to patch the ANGLE API, would that imply there’d be a chromium build that may work (until Samsung offers a driver update of some kind)?

djebel-amila avatar Oct 25 '22 07:10 djebel-amila

@djebel-amila wrote:

Someone mentions trying to patch the ANGLE API, would that imply there’d be a chromium build that may work (until Samsung offers a driver update of some kind)?

Sorry, that isn't possible in this case. Samsung ships their own copy of ANGLE to provide the system GLES driver, it's a wrapper around the native Vulkan API. Chrome's WebXR AR mode uses the system GLES driver and thereby Samsung's copy of the ANGLE library, and it's that system ANGLE library that would need to be patched. Changing Chrome's copy of the ANGLE library would have no effect on this issue since it isn't being used in WebXR AR mode.

And it's not possible to us Chrome's ANGLE library on top of the system Vulkan driver since the Chrome browser process and the ARCore library need to share an EGL context. Last I checked, there's no way to use ARCore with Vulkan directly, so we need to use the system GLES driver which uses the system ANGLE library.

(Apologies for being redundant here, I'm just trying to be as clear as possible since it's a confusing situation.)

klausw avatar Oct 25 '22 16:10 klausw

@klausw Thank you for the explanation. So I assume the only thing we can do is to wait. I don't think that this will have priority on Samsung's side. It's a pity. I just bought a new phone for testing WebXR :(

fabian-muff avatar Oct 26 '22 06:10 fabian-muff

@klausw Thanks for explaining, it’s very helpful. I‘ll try and reach some technical support service at Samsung, with little hope though.

djebel-amila avatar Oct 26 '22 08:10 djebel-amila

@djebel-amila i already did. They told me to write to [email protected] Maybe if you try it as well, they will do something ;)

fabian-muff avatar Oct 26 '22 08:10 fabian-muff