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

Issue 651910 link

Starred by 17 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 2
Type: Bug



Sign in to add a comment

Chrome does not throw getUserMedia error when any other application is using camera on Windows

Reported by pan.dev....@gmail.com, Sep 30 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

Example URL:
https://apprtc.appspot.com

Steps to reproduce the problem:
1. Join a meeting on Firefox on apprtc and share your camera
2. Try the same thing on Chrome. Chrome shows black screen
3. Check getusermedia related console logs

What is the expected behavior?
Chrome should throw error on not able to get camera access

What went wrong?
Chrome does not throw error on not able to get camera access. Instead, Chrome calls successcallback. Also, the screen is blank.

Note: This does not happen on Mac. It is Windows specific.

Did this work before? No 

Is it a problem with Flash or HTML5? N/A

Does this work in other browsers? Yes 

Chrome version: 53.0.2785.116  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
Chrome Issue.png
1.3 MB View Download
Cc: niklase@chromium.org tommi@chromium.org magjed@chromium.org
Components: -Internals>Media Blink>GetUserMedia Blink>WebRTC
Status: Available (was: Unconfirmed)
I confirmed this on win10, and I also checked that other apps (Skype) discovered that the camera was locked. magjed or tommi, are you familiar with this problem?
It also repros on Linux. This "feels" like a regression, I recollect getting errors on AppRTC when the camera was busy.
Cc: jansson@chromium.org
+jansson, do you know if this is covered by any test?
Cc: srcv@chromium.org phoglund@chromium.org
I believe it was tested manually at one point but I do not think it's part of the current running test suite (was boiled down a fair bit once WebRTC became quite stable). srcv@ maybe we should add this to the current test suite?

phoglund@ do you know if this covered in a browser test? If not, is it hard to add? It sounds like we need to start two separate instances of Chrome (because it's easier) and then request the camera in each instance.

Comment 5 by srcv@chromium.org, Oct 10 2016

Cc: srnarayanan@chromium.org
+srnarayanan@ who does WebRTC testing on Windows, Mac and Linux
Labels: OS-Linux
I'm able to repro this issue in Windows and Linux with 2 Chrome instances (Dev vs Beta/Canary)

Instance 1: 
Start a successful apprtc loopback call 

Instance 2: 
After the apprtc loopback call above is established, initiate another apprtc loopback call

Observed behavior:
apprtc loopback call shows a blank screen in Chrome instance 2 

----------------------

However in Mac, 
with a similar setup as above, apprtc loopback calls establish successfully in both the Chrome instances. (I don't see blank screen)
Is this the expected behavior?

Comment 7 by mcasas@chromium.org, Oct 17 2016

Owner: niklase@chromium.org
Status: Assigned (was: Available)
niklase@ could you please further triage this? Thx
Owner: chfremer@chromium.org
chfremer, can you take a look at what happens in this scenario?
I took a look and the current behavior appears to be "by design".
VideoCaptureImpl reports that the Track has started successfully [1] before even issuing the start command to the video subsystem in the Browser process [2]. The starting of the capture device in the Browser process correctly reports the failure, but that status change arrives separately and at a later time, after the response of getUserMedia() has already been issued back to the JavaScript engine.

[1] https://cs.chromium.org/chromium/src/content/renderer/media/video_capture_impl.cc?q=VideoCaptureImpl&dr=CSs&l=118
[2] https://cs.chromium.org/chromium/src/content/renderer/media/video_capture_impl.cc?q=VideoCaptureImpl&dr=CSs&l=140
Cc: chfremer@chromium.org
Owner: mflodman@chromium.org
mflodman, do you remember anything about this? I did run some bisection but I was unable to find a version where this works, so I guess it never has? 
Owner: braveyao@chromium.org
Cc: braveyao@chromium.org
 Issue 690457  has been merged into this issue.
Project Member

Comment 13 by bugdroid1@chromium.org, Feb 27 2017

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

commit a18b95669ed38c0931818534ce17f131a006e476
Author: braveyao <braveyao@chromium.org>
Date: Mon Feb 27 23:29:08 2017

getUserMeida: report device starting states

Chromium used to report device started immediately at requesting user media,
despite the device operation results. This causes several kinds of problems.
 - Notification of capture starting is shown before device starts.
 - gUM gets successful callback even if the device fails to start.
So we decide to make gUM return the real device starting states
(here we focus on the video capturing).
This is the first part of the complete modification.
The design doc is here, https://goo.gl/WTZkEl
The complete CL is here, https://codereview.chromium.org/2658643002

This CL implements the device-started-state reporting part. Each device will
report OnStarted event all the way back to VideoCaptureImpl when it's started
successfully(Error report has been done already).
This CL also includes all the necessary modifications due to the interface
change.
This CL will take no effect to getUserMedia behavior at present until another
CL which will handle the OnStarted event is landed.

BUG= 674959 ,  651910 

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

[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/media/capture/desktop_capture_device.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/media/capture/desktop_capture_device_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/media/capture/screen_capture_device_android_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_controller.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_controller.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_controller_event_handler.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_controller_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_host.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_host.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_manager_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_capture_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/content/renderer/media/video_capture_impl.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/content/android/screen_capture_machine_android.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/content/screen_capture_device_core.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/content/thread_safe_capture_oracle.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/content/thread_safe_capture_oracle.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/android/java/src/org/chromium/media/VideoCapture.java
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/android/video_capture_device_android.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/android/video_capture_device_android.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/fake_video_capture_device.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/fake_video_capture_device_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/file_video_capture_device.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/linux/v4l2_capture_delegate.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/mac/video_capture_device_decklink_mac.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/mac/video_capture_device_decklink_mac.mm
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/mac/video_capture_device_mac.mm
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/video_capture_device.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/video_capture_device_client.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/video_capture_device_client.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/video_capture_device_client_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/video_capture_device_unittest.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/video_frame_receiver.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/win/video_capture_device_mf_win.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/media/capture/video/win/video_capture_device_win.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/services/video_capture/public/interfaces/receiver.mojom
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/services/video_capture/receiver_mojo_to_media_adapter.cc
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/services/video_capture/receiver_mojo_to_media_adapter.h
[modify] https://crrev.com/a18b95669ed38c0931818534ce17f131a006e476/services/video_capture/test/mock_receiver.h

Status: Started (was: Assigned)
Design document "The design doc is here, https://goo.gl/WTZkEl"
is not publicly accessible; please make it accessible so that
"anyone with the link" can comment.

Project Member

Comment 15 by bugdroid1@chromium.org, Mar 14 2017

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

commit 1941549656951c9dbd61984b3fd7f8414a3536a6
Author: braveyao <braveyao@chromium.org>
Date: Tue Mar 14 23:50:07 2017

getUserMedia: handle the device starting status report.

Chromium used to report device started immediately at requesting user media,
despite the device operation results. This causes several kinds of problems.
 - Notification of capture starting is shown before device starts.
 - gUM gets successful callback even if the device fails to start.
So we decide to make gUM return the real device starting states
(here we focus on the video capturing).
This is the second part of the complete modification.
The design doc is here, https://goo.gl/WTZkEl
The previous CL is here, https://codereview.chromium.org/2673373003/

This CL does severals things when a OnStarted event from device arrives
- VideoCaptureImpl calls the state_update_cb, informing the track is completed.
- When all tracks are completed, return gUM with successful callback and send
  a message to browser process to show the notification in UI.
- Other related changes due to the asynchronous OnStarted event.
- Remove some test cases of desktop_capture, which tests nothing before
(due to the always-successful gUM callback) and fails after this cl
(gUM will get errorcallback if stream can't be started successfully).

BUG= 674959 ,  651910 

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

[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/chrome/test/data/extensions/api_test/desktop_capture/test.js
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/media_stream_dispatcher_host.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/media_stream_manager.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/media_stream_manager.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/video_capture_controller.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/video_capture_controller.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/video_capture_controller_unittest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/browser/renderer_host/media/video_capture_manager_unittest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/common/media/media_stream_messages.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/common/media/video_capture.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/media_stream_dispatcher.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/media_stream_dispatcher.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/media_stream_video_capturer_source.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/user_media_client_impl.h
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/video_capture_impl.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/video_capture_impl_manager_unittest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/content/renderer/media/video_capture_impl_unittest.cc
[modify] https://crrev.com/1941549656951c9dbd61984b3fd7f8414a3536a6/media/capture/video/fake_video_capture_device_unittest.cc

Labels: M-59
Status: Fixed (was: Started)
this seems to return a TrackStartError while the spec says it should be NotReadableError here: https://w3c.github.io/mediacapture-main/getusermedia.html#dom-mediadevices-getusermedia

Any chance you can fix this before M59 ships? This is a great feature and makes things easier but making people look for the wrong error will be hard to get rid of...
Cc: raymes@chromium.org guidou@chromium.org jyasskin@chromium.org
 Issue 635462  has been merged into this issue.
Cc: tnakamura@chromium.org
 Issue 167160  has been merged into this issue.
This issue is happening to me with the latest version of Chrome. I open the webcam using webrtc/getUserMedia in Firefox, connect to it, and then try the same app in Chrome. Chrome does not throw any errors, and displays a black screen where the live camera feed should be.

If I open in Chrome first and then try in Firefox, I do correctly get the error, and can therefore let the end user know they may have the webcam open in another application.

I feel like this is a regression from previous behavior in Chrome.
kevin@: Can you file a new bug and provide specific repro instructions?

Comment 22 by ita...@audyx.com, Jan 20 (3 days ago)

On Chrome 71, <still experiencing the same unreliability 

Comment 23 by guidou@chromium.org, Jan 20 (3 days ago)

the new regression is tracked in bug 922919

Sign in to add a comment