MozillaReality / FirefoxReality

INACTIVE - A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://mzl.la/reality
Mozilla Public License 2.0
770 stars 217 forks source link

[Pico] WebXR page doesn't enter immersive mode #3477

Closed picoxr closed 4 years ago

picoxr commented 4 years ago

Configuration

Firefox Reality version: 10-rc7 Firefox Reality build ID: bda5ecf

Hardware: Pico Neo 2 - Android 8.1 - PUI 3.11.3

Steps to Reproduce

  1. Enter website [https://projets.sphereapp.io/QA/ar/pompe/]
  2. Select left side icon "View in VR" and wait for loading to finish
  3. Observe if the scene enters immersive mode

Current Behavior

Cotents display as stereo-eye view on a 2D browser panel and the mode selection bar appears.

Expected Behavior

Can enter immersive mode

Possible Solution

Context

We are not observing the same issue on Oculus Firefox Reality v10.

Error Logs and Stack Traces

``` ```
bluemarvin commented 4 years ago

@fernandojsg Could you take a look at this and see where their code is having an issue.

fbizot commented 4 years ago

@fernandojsg @bluemarvin Hi, I'm the head of the development team who develop the software that create this content. For information, this experience and all other exported with our software run as expected with webXR on Firefox reality on all VR headset, except the Pico.

bluemarvin commented 4 years ago

@fbizot There should be no difference between FxR on Oculus, WaveVR, and PicoVR devices. Are you possibly sniffing for devices?

fbizot commented 4 years ago

@bluemarvin No, we don't sniff devices, we just implement webXR as expected. We just check if the device is compatible with webXR: if not, we try to use webVR. We have a similar problem with the built-in VR browser (based on Chromium) on the Pico device. In the built-in browser, the default mode is "Desktop". When we switch to "mobile mode" for having webxr available, it reloads back to the "desktop mode" and webXR cannot launch properly. If there is no difference between all version of Firefox on VR headsets, can we imagine an hardware problem or misconfiguration?

bluemarvin commented 4 years ago

WebXR works for other sites in FxR on PicoVR. There isn't any actionable information printed to the console when it fails other than a message that is isn't supported. Both WebXR and WebVR should be available in FxR on PicoVR. It would help us to debug the issue if you could let us know specifically what the error is that is causing immersive mode to fail.

bluemarvin commented 4 years ago

This looks like device sniffing to me (from main-viewer.js):

    static parseWebXRProfile(displayProfile) {
        if (this.WEBXR_PROFILE_DAYDREAM.test(displayProfile))
            return HMDType.SINGLE_ONE_BT_MOBILE_HMD;
        if (this.WEBXR_PROFILE_OCULUS_GO.test(displayProfile) ||
            this.WEBXR_PROFILE_OCULUS_GEARVR.test(displayProfile) ||
            this.WEBXR_PROFILE_HTC_FOCUS.test(displayProfile))
            return HMDType.SINGLE_TWO_BT_MOBILE_HMD;
        if (this.WEBXR_PROFILE_OCULUS_QUEST.test(displayProfile))
            return HMDType.DUAL_MOBILE_HMD;
        if (this.WEBXR_PROFILE_WMR.test(displayProfile) ||
            this.WEBXR_PROFILE_HTC_VIVE.test(displayProfile) ||
            this.WEBXR_PROFILE_OCULUS_RIFT.test(displayProfile))
            return HMDType.DESKTOP_HMD;
        return null;
    }
    static manageDisplay(displayProfileA, displayProfileB) {
        if (this._displayIsManaged || !displayProfileA)
            return;
        console.log(displayProfileA, displayProfileB);
        if (this._sessionType == SessionType.WebVR) {
            if (this.WEBVR_DISPLAY_CARDBOARD.test(displayProfileA))
                this._hmdType = HMDType.NO_CONTROLLER_MOBILE_HMD;
            else if (this.WEBVR_DISPLAY_DAYDREAM.test(displayProfileA) ||
                this.WEBVR_DISPLAY_MIRAGE.test(displayProfileA))
                this._hmdType = HMDType.SINGLE_ONE_BT_MOBILE_HMD;
            else if (this.WEBVR_DISPLAY_OCULUS_GO.test(displayProfileA) ||
                this.WEBVR_DISPLAY_OCULUS_GEARVR.test(displayProfileA) ||
                this.WEBVR_DISPLAY_SAMSUNG.test(displayProfileA))
                this._hmdType = HMDType.SINGLE_TWO_BT_MOBILE_HMD;
            else if (this.WEBVR_DISPLAY_OCULUS_QUEST.test(displayProfileA) ||
                this.WEBVR_DISPLAY_HTC_FOCUS.test(displayProfileA))
                this._hmdType = HMDType.DUAL_MOBILE_HMD;
            else if (this.WEBVR_DISPLAY_WMR.test(displayProfileA) ||
                this.WEBVR_DISPLAY_HTC_VIVE.test(displayProfileA) ||
                this.WEBVR_DISPLAY_OPENVR.test(displayProfileA) ||
                this.WEBVR_DISPLAY_OCULUS_RIFT.test(displayProfileA))
                this._hmdType = HMDType.DESKTOP_HMD;
        }
        else if (this._sessionType != SessionType.NONE)
            this._hmdType = this.parseWebXRProfile(displayProfileA) || this.parseWebXRProfile(displayProfileB);
        this._hasVRDisplay = true;
        this._displayIsManaged = !!this._hmdType;
    }
fbizot commented 4 years ago

Yes for managing specific controllers behaviour, but it's all.

The problem we have is that we have no alert or message. WebXR is just unavailable.

After several tests, the problem appears on other WebXR experiences, not only ours.

For example, In this ThreeJS demo : https://threejs.org/examples/?q=webxr#webxr_vr_ballshooter The experience appear but the VR button not appear and it's replaced by "WebXR not available". (Under Built-in browser: the browser keep in desktop mode and webxr can't run as expect - nothing appear ).

But on AFrame demo ( https://aframe.io/examples/showcase/helloworld/, it works as expected BUT the only change is that the AFRAME website explecitely request the mobile version of the browser using META.

Again all of this demos works great with all other Firefox versions on other platforms and devices. It's also for that that we can think that the problems comes from the hardware part NOT firefox.

bluemarvin commented 4 years ago

Both of those examples work fine now (you need to use a recent build: https://community-tc.services.mozilla.com/tasks/index/project.firefoxreality/master) I think your sniffing code is not working on PicoVR.

fbizot commented 4 years ago

Ok Thanks. I double check. Also I alert Pico that the built-in version of Firefox Reality is not updated as expected with the online update (PUI 3.11.3), if we have used a previous pre-released version of FxR.

bluemarvin commented 4 years ago

The latest release is 10.1 but it also has bugs in WebXR. We are working on an update with more WebXR fixes (found in the builds linked above) but are not quite ready to release. We hope to have 10.2 available in the next week or two. Pico is shipping with a very old preview build of FxR 10.

fbizot commented 4 years ago

Thanks @bluemarvin. I will test the latest release.

fernandojsg commented 4 years ago

@fbizot @bluemarvin I just tried it and I got the following warning Unable to start WebXR session DOMException: A user gesture is required. I can't see the code you posted @bluemarvin where is that coming from? in the debugger I see the code obfuscated. Is there any way I can access the unobfuscated code to see if we can find any issue?

fbizot commented 4 years ago

hi @fernandojsg The code comes from a non obfuscated version of our codes, but for several reasons I I can't leave this code online. After the discussion with @bluemarvin, it seems that the latest FxR version works better. WebXR can start now. We have problem to access controller and the good standing matrix (seems to be different that in the Oculus version), but it's not the same problem. Anyway it's the good start, and compatibility problems seems to be on our side. Thanks you very much for your help.

fernandojsg commented 4 years ago

@fbizot that's great! I'm glad you found the issue, please let us know if we can help you anyhow with this or future issues. @bluemarvin I can confirm that I can enter VR successfully now so closing it.