New issue
Advanced search Search tips

Issue 793859 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Chrome_Android: Intermittent freeze when starting camera via getUserMedia

Project Member Reported by chfremer@chromium.org, Dec 11 2017

Issue description

Chrome Version: 61.0.3124.0 and newer. This has been determined via manual bisect. 61.0.3123.0 and older do not have this issue.

OS: Android

What steps will reproduce the problem?
1. Navigate to https://webrtc.github.io/samples/src/content/getusermedia/gum/
2. See if camera opens successfully or if Chrome freezes
3. If it opened successfully, close Chrome using the app switcher 
4. Reopen Chrome, which should now immediately try to open the URL from 1.
5. Continue at Step 2.
Repeat 5-10 times to see if it happens.

What is the expected result?
Camera stream is displayed on the page

What happens instead?
No camera stream is displayed. Chromium freezes (does not react to user input anymore). After a while a message pops up asking to either wait or close Chromium.

Affected Android devices seem to include but may not be limited to:
Nexus 5x
Nexus 6
Nexus 6P
Samsung S5
Samsung Note 5 
Sony Xperia X Performance
Motorola DROID Turbo
Samsung S6

On some of the device/OS version configs, the issue seems to happen 50% of the time, on others it happens more rarely.
 
The result is that the issue started with the jump from Chrome 61.0.3123.0 to Chrome 61.0.3124.0. Logs for this range: https://chromium.googlesource.com/chromium/src/+log/61.0.3123.0..61.0.3124.0?n=10000

Issue most likely related to commit https://chromium.googlesource.com/chromium/src/+/c69a479170be23ec6fed72bf863b18c44cdbd694

As next step, we will verify that reverting the commit mitigates the issue.

I have prepared a CL [1] to revert the suspected commit and confirmed on the Nexus 6 and 6P that it mitigates the issue (meaning it happend 0 out of about 20 tries with that CL applied).

Unfortunately this CL would also revert some things that have landed after the CL that started triggering this issue. So ideally, instead of reverting all that, we would find the actual root cause and apply a fix.

I will take some time to look into finding the root cause.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/820674
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 8 2018

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

commit 68b440535588b20776bdf50524ecc9168d7c5e8f
Author: Christian Fremerey <chfremer@chromium.org>
Date: Mon Jan 08 23:46:39 2018

[Video/image capture] Revert refactoring CL that triggers intermittent freeze on Android

Refactoring CL being reverted:
https://chromium.googlesource.com/chromium/src/+/c69a479170be23ec6fed72bf863b18c44cdbd694

This also removes a block of code about "focus adjustments" which was added on
top of the refactoring and requires it.

The revert has been verified manually to fix the symptoms on a set of 20+ devices.

Bug:  793859 
Change-Id: I9758b5dd6391682bee57a13756188d39cef20218
Reviewed-on: https://chromium-review.googlesource.com/820674
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527815}
[modify] https://crrev.com/68b440535588b20776bdf50524ecc9168d7c5e8f/content/browser/webrtc/webrtc_image_capture_browsertest.cc
[modify] https://crrev.com/68b440535588b20776bdf50524ecc9168d7c5e8f/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java

Run into same issue. Very easy to reproduce on my device (OnePlus 3). 
Just run:

navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then(stream => stream.getTracks().forEach(e => e.stop()));

multiple times in chrome dev console while debugging any web page.
In my case chrome stably freeze after 3-4 runs of this command.
Without stopping tracks it doesn't freeze.
The revert has made it to Canary builds starting with version 65.0.3316.0.
Let us verify that this mitigates the issue and does not introduce any new problems. After that we can request merge to beta and stable.
Labels: Merge-Request-64 Merge-Request-63
Tested on a few devices and looks good so far.

Requesting merge into beta and stable.
Project Member

Comment 7 by sheriffbot@chromium.org, Jan 9 2018

Labels: -Merge-Request-64 Hotlist-Merge-Review Merge-Review-64
This bug requires manual review: We are only 13 days from stable.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 8 by cmasso@google.com, Jan 10 2018

Since this issue is not a regression in M64, can we let the fix bake longer in M65 and avoid any risk of merging it this late in M64?

Comment 9 by cmasso@google.com, Jan 10 2018

Labels: -Hotlist-Merge-Review -Merge-Request-63 -Merge-Review-64 Merge-Approved-64
Approving the merge for M64 based on email thread and offline discussion. Thank you!
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 10 2018

Labels: -merge-approved-64 merge-merged-3282
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bab24860ca1c07222580dd8b83d01d2bcc1081b8

commit bab24860ca1c07222580dd8b83d01d2bcc1081b8
Author: Christian Fremerey <chfremer@chromium.org>
Date: Wed Jan 10 23:20:49 2018

[Video/image capture] Revert refactoring CL that triggers intermittent freeze on Android

Refactoring CL being reverted:
https://chromium.googlesource.com/chromium/src/+/c69a479170be23ec6fed72bf863b18c44cdbd694

This also removes a block of code about "focus adjustments" which was added on
top of the refactoring and requires it.

The revert has been verified manually to fix the symptoms on a set of 20+ devices.

TBR=chfremer@chromium.org

(cherry picked from commit 68b440535588b20776bdf50524ecc9168d7c5e8f)

Bug:  793859 
Change-Id: I9758b5dd6391682bee57a13756188d39cef20218
Reviewed-on: https://chromium-review.googlesource.com/820674
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#527815}
Reviewed-on: https://chromium-review.googlesource.com/861164
Reviewed-by: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/branch-heads/3282@{#483}
Cr-Branched-From: 5fdc0fab22ce7efd32532ee989b223fa12f8171e-refs/heads/master@{#520840}
[modify] https://crrev.com/bab24860ca1c07222580dd8b83d01d2bcc1081b8/content/browser/webrtc/webrtc_image_capture_browsertest.cc
[modify] https://crrev.com/bab24860ca1c07222580dd8b83d01d2bcc1081b8/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java

Is there any more work planned for this issue?
Status: Fixed (was: Started)
Nope. Sorry I forgot to close this.

Sign in to add a comment