New issue
Advanced search Search tips

Issue 674594 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug
Proj-XR
Proj-XR-VR



Sign in to add a comment

Move all GVR API usage while presenting to VrShell's GL thread.

Project Member Reported by mthiesse@chromium.org, Dec 15 2016

Issue description

The GVR API is not threadsafe. It's probably fine to use the non-presenting delegate on the UI thread as we currently are, but when we start up the presenting delegate we should re-bind to the VRServiceImpl, but on the GL thread, and stop using the non-presenting delegate. The gamepad API should also only use the GVR API from the GL thread.
 
(Assigning this to Brandon for now. I'm happy to help out with this, but it'll take some ramping up on mojo/gamepad code.)
Cc: bajones@chromium.org
Labels: -Pri-2 Pri-1
Owner: ----
This sounds like a correctness issue with the potential for crashes or similar issues. Is anyone working on this?

How does this relate to overall refactoring efforts? 
Status: Untriaged (was: Assigned)
I'm working on a patch now that makes pose reading threadsafe, so I think the main remaining issue is controller access from multiple threads.

There are some other non-threadsafe usages on initialization, but that's probably lower priority.

Comment 5 by sko...@chromium.org, Jan 12 2017

Status: Available (was: Untriaged)
Michael, ping on where the patch you reference in Comment 4 is.  

Comment 6 by sko...@chromium.org, Jan 12 2017

Cc: -mthiesse@chromium.org
Owner: mthiesse@chromium.org
Status: Assigned (was: Available)
https://codereview.chromium.org/2624633002/ is out for review.
Status: Started (was: Assigned)
Labels: -M-57
Unless others disagree, we're not seeing this cause any issues in practice, so it's not worth back-porting to M57 at this point.
Labels: M-58
Sounds like it should get resolved in M58 then.
Project Member

Comment 11 by bugdroid1@chromium.org, Feb 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c6465c3b85e664ca700e1c04bebf637c7846243

commit 4c6465c3b85e664ca700e1c04bebf637c7846243
Author: mthiesse <mthiesse@chromium.org>
Date: Wed Feb 01 23:40:17 2017

Refactor GvrDelegate ownership into GvrDelegateProvider and fix more threading violations.

This CL does two main things: It refactors controlling when the GvrDelegate is created and destroyed into the GvrDelegateProvider, and it refactors out some instances of using the GVR api in a non-threadsafe way.

Some minor functional changes may be visible with this patch - namely that we no longer (possibly) send a DisplayConnected event for a display that isn't ready yet due to the gvr api not being available. This should be an improvement in all cases.

BUG= 674594 ,  655297 

Review-Url: https://codereview.chromium.org/2658643003
Cr-Commit-Position: refs/heads/master@{#447643}

[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/BUILD.gn
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_compositor.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_compositor.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_gl_thread.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_shell.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_shell.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_shell_delegate.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_shell_delegate.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_shell_gl.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/chrome/browser/android/vr_shell/vr_shell_gl.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_delegate.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_device.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_device.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_device_provider.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_device_provider.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/android/gvr/gvr_gamepad_data_fetcher.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/test/fake_vr_device.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/test/fake_vr_device.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/vr_device.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/vr_device.h
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/vr_display_impl.cc
[modify] https://crrev.com/4c6465c3b85e664ca700e1c04bebf637c7846243/device/vr/vr_display_impl.h

The only remaining thread-unsafe GVR API usages are now in the gamepad API.
Great, thanks! Should we open a separate bug and assign the relevant components so we can close this one as having solved most issues?
Status: Fixed (was: Started)
File  issue 687992 .
Components: Blink>WebXR

Sign in to add a comment