New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 856658 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 1
Type: Bug-Regression



Sign in to add a comment

MediaStream inactive event not firing

Reported by xsvengo...@gmail.com, Jun 26 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce the problem:
1. Plug in a single webcam
2. Open the sample page provided
3. Observe that the console prints "got stream"
4. Unplug the webcam

What is the expected behavior?
Step 4 above should result in a console line "oninactive event raised"

What went wrong?
The inactive event was not raised on the MediaStream when the camera was unplugged.

Did this work before? Yes 67.0.3396.87 64-bit Stable

Does this work in other browsers? N/A

Chrome version: 68.0.3440.33 (Official Build) beta (64-bit) (cohort: Beta)  Channel: beta
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 30.0.0.113

I haven't seen any PSAs or any warnings for this, so my interpretation is that this is a regression. It looks like this event isn't a part of the standard, although it's been in Chrome while now (at least since M52) and I've been using it ever since the MediaStream.ended event was deprecated. Is it expected that developers use the MediaStreamTrack.ended event instead?
 
example.zip
38.2 KB Download
Labels: Needs-Triage-M68 Needs-Bisect
Labels: Triaged-ET TE-NeedsTriageFromHYD
Thanks for filing the issue!

As mentioned in steps to reproduce the problem in comment# 0 by the reporter, this issue needs webcam to test and confirm the issue, as ET team doesn't have webcam to test, hence routing this issue to Inhouse for further triaging the issue and adding TE-NeedsTriageFromHYD label to it.

Thanks!
Components: Blink>GetUserMedia
Cc: sindhu.chelamcherla@chromium.org
Labels: -TE-NeedsTriageFromHYD Needs-Feedback
Unable to reproduce this issue on 68.0.3440.33 and latest beta 68.0.3440.42 with steps mentioned in comment#0. Connected webcam and opened attached html file >> In console "got stream" is seen. Now disconnected webcam and observed "oninactive event raised". Attaching screenshot for reference.

@Reporter: Could you please check the issue on fresh profile which do not have any apps/extensions. Any further information on reproducing the issue would help in better triaging.

Thanks!

856658.png
30.0 KB View Download
Thanks for looking at this. It was happening consistently to me and now my version of Chrome updated on me to 68.0.3440.42 and I don't see the issue anymore. I didn't change anything with my profile or apps/extensions either. I wish I could give you more info, but I'm a bit puzzled myself! Maybe the update cleared something up on my machine that was causing the issue? If I do see the issue again I can post back in here
Project Member

Comment 6 by sheriffbot@chromium.org, Jun 28 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I am seeing it again and I'm still on 68.0.3440.42. It's very hard to reproduce and I'm really not sure what's causing it. I'm running into the issue as I'm developing a site that makes heavy use of the WebRTC api. Again, I'll post back in here if I can narrow this down to something that can be reproduced consistently.
I reset my Chrome settings and created a fresh profile on version 68.0.3440.42. I found that this bug happens while having two webcams plugged in, which would probably explain why I didn't see it earlier today. This issue is not present when there's only one webcam plugged in. I can consistently replicate the issue following these steps:
1. Plug in a two webcams
2. Open the sample page provided
3. Observe that the console prints "got stream"
4. Unplug the webcam that is opened by Chrome

Let me know if there's any logs or diagnostic things that can help
Cc: susan.boorgula@chromium.org
Labels: TE-NeedsTriageHelp
xsvengolix@ Thanks for the update.

As per comment #8, as this issue needs to be tested by plugging in two webcams and as these are not available at TE end to triage further, requesting Blink>GetUserMedia team to look into this issue and help in further triaging.
Hence adding 'TE-NeedsTriageHelp' for further help.

Thanks..
Labels: -Pri-2 ReleaseBlock-Stable M-68 Pri-1
Owner: guidou@chromium.org
Status: Assigned (was: Unconfirmed)
I can reproduce. Will work on a fix.
Not only is the inactive event not firing, but the ended event is not firing either and the readyState field of the video track is not updated.
I tracked the issue to r555697. Reverting it fixes the issue, but will work on a fix that doesn't require reverting r555697.
Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac
Project Member

Comment 14 by bugdroid1@chromium.org, Jul 3

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

commit 0fe699a8dfc9c3a6cc0203759561284d634f4a57
Author: Guido Urdaneta <guidou@chromium.org>
Date: Tue Jul 03 12:14:04 2018

Stop streams associated to removed devices in MediaDevicesManager.

This fixes a bug where removing a device did not result in stopping all
its associated streams.

A unit test for this requires a minor refactoring to remove the
MediaStreamManager dependency from MediaDevicesManager, and will be
provided in a follow-up CL. This CL is deliberately simple in order to
make merging easier.

Bug:  856658 
Change-Id: I84ef2856195cc7650bb08992d2095f8f853e9ea9
Reviewed-on: https://chromium-review.googlesource.com/1124323
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572176}
[modify] https://crrev.com/0fe699a8dfc9c3a6cc0203759561284d634f4a57/content/browser/renderer_host/media/media_devices_manager.cc
[modify] https://crrev.com/0fe699a8dfc9c3a6cc0203759561284d634f4a57/content/browser/renderer_host/media/media_devices_manager.h

Labels: Merge-Request-68
Requesting merge for r572176. Actual merge would be after the CL bakes for a couple of days in Canary.
Project Member

Comment 17 by sheriffbot@chromium.org, Jul 3

Labels: -Merge-Request-68 Hotlist-Merge-Review Merge-Review-68
This bug requires manual review: M68 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), kariahda@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Bulk update: M68 stable cut is scheduled for July 19th. This issue is marked as RB-Stable, so please take a look at it before. Thanks!
Status: Fixed (was: Assigned)
Marking as Fixed since this is working fine on the latest Canary.
The CL with the test hasn't landed yet: https://chromium-review.googlesource.com/c/chromium/src/+/1125731

Project Member

Comment 20 by bugdroid1@chromium.org, Jul 4

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

commit 2603c0dd1751f26d713e735355d5ddc87237a8f7
Author: Guido Urdaneta <guidou@chromium.org>
Date: Wed Jul 04 19:57:06 2018

Add testing for MediaDevicesManager updates to MediaStreamManager.

This CL:
1. Removes the dependency of MDM on MSM by using callbacks,
which facilitates testing, since MSM is not mockable.
2. Updates tests so that MDM updates to MSM (now via callbacks)
are tested.
3. Makes a minor update to attempt to stop removed devices if
there is any change in the set of devices, not just if there is
a change in the number of devices. This fixes the hypothetical
case where a device addition and removal occurs so quickly that
it is detected as a single event with no change in the number
of devices.

Bug:  856658 
Change-Id: If9c5632f88f41010299b3e6f22eb9b24fbc108dc
Reviewed-on: https://chromium-review.googlesource.com/1125731
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572639}
[modify] https://crrev.com/2603c0dd1751f26d713e735355d5ddc87237a8f7/content/browser/renderer_host/media/media_devices_manager.cc
[modify] https://crrev.com/2603c0dd1751f26d713e735355d5ddc87237a8f7/content/browser/renderer_host/media/media_devices_manager.h
[modify] https://crrev.com/2603c0dd1751f26d713e735355d5ddc87237a8f7/content/browser/renderer_host/media/media_devices_manager_unittest.cc
[modify] https://crrev.com/2603c0dd1751f26d713e735355d5ddc87237a8f7/content/browser/renderer_host/media/media_stream_manager.cc

Labels: -Merge-Review-68 Merge-Approved-68
approving merge to M68. Branch:3440
Project Member

Comment 22 by bugdroid1@chromium.org, Jul 6

Labels: -merge-approved-68 merge-merged-3440
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/93db910a30c9b0fc397de46663e7b1f5976a4f89

commit 93db910a30c9b0fc397de46663e7b1f5976a4f89
Author: Guido Urdaneta <guidou@chromium.org>
Date: Fri Jul 06 20:53:31 2018

Stop streams associated to removed devices in MediaDevicesManager.

This fixes a bug where removing a device did not result in stopping all
its associated streams.

A unit test for this requires a minor refactoring to remove the
MediaStreamManager dependency from MediaDevicesManager, and will be
provided in a follow-up CL. This CL is deliberately simple in order to
make merging easier.

Bug:  856658 
Change-Id: I84ef2856195cc7650bb08992d2095f8f853e9ea9
Reviewed-on: https://chromium-review.googlesource.com/1124323
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#572176}(cherry picked from commit 0fe699a8dfc9c3a6cc0203759561284d634f4a57)
Reviewed-on: https://chromium-review.googlesource.com/1125959
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/branch-heads/3440@{#606}
Cr-Branched-From: 010ddcfda246975d194964ccf20038ebbdec6084-refs/heads/master@{#561733}
[modify] https://crrev.com/93db910a30c9b0fc397de46663e7b1f5976a4f89/content/browser/renderer_host/media/media_devices_manager.cc
[modify] https://crrev.com/93db910a30c9b0fc397de46663e7b1f5976a4f89/content/browser/renderer_host/media/media_devices_manager.h

Labels: Needs-Feedback
Unable to reproduce this issue on  reported version 68.0.3440.33 and build without fix with one web cam connected. Observing both "got stream" and "oninactive event raised" messages in console log.

@guidou: Please help in verifying the fix on latest beta RC 68.0.3440.59 as TE team do not have 2 webcams to verify this further.

Thanks!
Status: Verified (was: Fixed)
I verified the fix on a locally built 68.0.3440.59 using two webcams.
I also verified that the current beta 68.0.3440.42 does have the bug.
Marking the bug as verified.
guidou@, thank you for the quick help!

Sign in to add a comment