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
768 stars 217 forks source link

System lockup when accessing navigator.mediaDevices API on VIVE Focus #929

Closed shang-huang closed 2 months ago

shang-huang commented 5 years ago

Hardware

HTC Vive Focus

Steps to Reproduce

  1. Turn on the camera permission for FxR manually in settings.
  2. Access web page with code below (Reference):

    <video id="player" controls></video>
    <script>
    var player = document.getElementById('player');
    
    var handleSuccess = function(stream) {
    player.srcObject = stream;
    };
    
    navigator.mediaDevices.getUserMedia({ audio: true, video: true })
      .then(handleSuccess)
    </script>

    Current Behavior

    Vive Focus pop information like "Can't track position" and whole system seems crashed.

Expected Behavior

When test on Google Pixel with Vive Wave services installed, the camera view shows normal.

Possible Solution

Context

Version: FirefoxReality-1.1.2-30091627-wavevr-arm-release-signed-aligned.apk

Error Logs and Stack Traces

``` Crash (signature: `libc.so@0x3fcec`) ```
cvan commented 5 years ago

@shang-huang: Thank you taking the time to report this. This is important. We will investigate this crash and post updates in this issue. Stay tuned.

cvan commented 5 years ago
philip-lamb commented 5 years ago

Can we get a backtrace? Does that require minidump access permissions?

cvan commented 5 years ago

Can we get a backtrace? Does that require minidump access permissions?

You can see the stack traces by clicking on the individual reports in this list.

If you launch the URL about:crashparent, you can simulate a crash.

I just now added some documentation to the Wiki that I hope curious folks will find useful:

Developer Tools > Crashes

Let me know if there's anything else I can help clarify.

philip-lamb commented 5 years ago

The crash report is puzzling. I'll have a go at replicating.

philip-lamb commented 5 years ago

OK, I have partially replicated this.

Note that the step of manually enabling camera access in the System Preferences is required. Without this step, the page just shows a media control that does nothing (also no prompt to show media). But with the permission added, the reported behaviour (app locks up/disappears, system shows "Can't track position") is observed. The app does NOT however crash (process is still running) and no crash data appears in the event log -- so I expect that the crash message above is from a different cause.

In one way, we should question what the expected behaviour is here; accessing the camera is going to interrupt the system's use of the cameras for tracking, so having the report that tracking is lost is pretty natural. On the other hand, this shouldn't lock up the system. This might be a Wave system bug around shared access to the cameras.

I've attached a logcat across the event. Page containing the media controls loads around 2019-02-21 13:16:51.556 (you can see a JS message), and system puts up tracking lost notice at 2019-02-21 13:16:52.705. The Firefox Reality PID is 3214 in this log. logcat-929.txt

philip-lamb commented 5 years ago

One additional note: I would assume that since the camera image is being requested by the web view, it's probably geckoview using the standard Android camera API. It'd be a useful test case to see what happens attempting camera access via the wavevr api.