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

Issue 679210 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

getUserMedia does not report an error for audio sources that fail to initialize

Project Member Reported by tommi@chromium.org, Jan 8 2017

Issue description

When audio source initialization fails, e.g. if we hit the limit of concurrently allowed input sources, getUserMedia will report success and include a non functioning audio track with the returned media stream.

At the moment, the limit of audio tracks is 16, so one way to reproduce this is to open up 17 tabs that use audio input.  The last one to open will seemingly succeed but won't get any audio (assuming there's nothing else already using audio input - if that's the case, failure will occur sooner).
 

Comment 1 by tommi@chromium.org, Jan 8 2017

See also  issue 678697 .
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 9 2017

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

commit 81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04
Author: tommi <tommi@chromium.org>
Date: Mon Jan 09 20:18:15 2017

Fix getUserMedia so that failure is reported for invalid audio sources.
This changes getUserMedia to wait for initialization of local
audio sources before issuing the completion callback (either success or
failure).
Previously, if an error occurs between attempting to start a local
audio source and the render side OnStreamCreated callback, getUserMedia
would report successful completion with an audio track but no audio
would actually be delivered for that track.

BUG= 679210 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

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

[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/chrome/renderer/media/cast_receiver_audio_valve.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/chrome/renderer/media/cast_receiver_audio_valve.h
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/chrome/renderer/media/cast_receiver_session_delegate.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/external_media_stream_audio_source.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/external_media_stream_audio_source.h
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/local_media_stream_audio_source.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/local_media_stream_audio_source.h
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/rtc_peer_connection_handler_unittest.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/user_media_client_impl.h
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/user_media_client_impl_unittest.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/webrtc/processed_local_audio_source.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/webrtc/processed_local_audio_source.h
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/webrtc/processed_local_audio_source_unittest.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/content/shell/renderer/layout_test/blink_test_runner.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/media/audio/audio_input_device.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/media/audio/audio_input_device_unittest.cc
[modify] https://crrev.com/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04/media/base/audio_capturer_source.h

Comment 3 by tommi@chromium.org, Jan 9 2017

Status: Fixed (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 10 2017

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

commit 5d02cf8e38acafeea410906105d5fc11c3e3395b
Author: tommi <tommi@chromium.org>
Date: Tue Jan 10 18:00:02 2017

Reland of Fix getUserMedia so that failure is reported for invalid audio sources. (patchset #1 id:1 of https://codereview.chromium.org/2626533002/ )

Reason for revert:
Preparing reland

Original issue's description:
> Revert of Fix getUserMedia so that failure is reported for invalid audio sources. (patchset #2 id:20001 of https://codereview.chromium.org/2623443002/ )
>
> Reason for revert:
> Revert due to WebRTC tests failing:
>
> https://uberchromegw.corp.google.com/i/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/56312
>
> [4832:364:0109/131325.673:4351226:ERROR:browser_test_utils.cc(147)] Cannot communicate with DOMMessageQueue.
> c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(66): error: Value of: ExecuteScriptAndExtractString(shell(), javascript, &result)
>   Actual: false
> Expected: true
> Failed to execute javascript callAndRenegotiateToVideo({audio: true}, {audio: true, video:true});.
> From javascript: (nothing)
> When executing 'callAndRenegotiateToVideo({audio: true}, {audio: true, video:true});'
> c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(90): error: Failed
>
> and
>
> [4704:4156:0109/131352.840:4378402:ERROR:browser_test_utils.cc(147)] Cannot communicate with DOMMessageQueue.
> c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(66): error: Value of: ExecuteScriptAndExtractString(shell(), javascript, &result)
>   Actual: false
> Expected: true
> Failed to execute javascript getUserMediaInIframeAndCloseInSuccessCb({audio: true});.
> From javascript: (nothing)
> When executing 'getUserMediaInIframeAndCloseInSuccessCb({audio: true});'
> c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(90): error: Failed
>
> Original issue's description:
> > Fix getUserMedia so that failure is reported for invalid audio sources.
> > This changes getUserMedia to wait for initialization of local
> > audio sources before issuing the completion callback (either success or
> > failure).
> > Previously, if an error occurs between attempting to start a local
> > audio source and the render side OnStreamCreated callback, getUserMedia
> > would report successful completion with an audio track but no audio
> > would actually be delivered for that track.
> >
> > BUG= 679210 
> > CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
> >
> > Review-Url: https://codereview.chromium.org/2623443002
> > Cr-Commit-Position: refs/heads/master@{#442323}
> > Committed: https://chromium.googlesource.com/chromium/src/+/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04
>
> TBR=jochen@chromium.org,guidou@chromium.org,xhwang@chromium.org,tommi@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG= 679210 
>
> Review-Url: https://codereview.chromium.org/2626533002
> Cr-Commit-Position: refs/heads/master@{#442373}
> Committed: https://chromium.googlesource.com/chromium/src/+/f05caaa1349e44abd44a00f88506bf140a0bc887

TBR=jochen@chromium.org,guidou@chromium.org,xhwang@chromium.org,dewittj@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
BUG= 679210 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

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

[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/chrome/renderer/media/cast_receiver_audio_valve.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/chrome/renderer/media/cast_receiver_audio_valve.h
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/chrome/renderer/media/cast_receiver_session_delegate.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/external_media_stream_audio_source.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/external_media_stream_audio_source.h
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/local_media_stream_audio_source.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/local_media_stream_audio_source.h
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/rtc_peer_connection_handler_unittest.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/user_media_client_impl.h
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/user_media_client_impl_unittest.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/webrtc/processed_local_audio_source.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/webrtc/processed_local_audio_source.h
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/webrtc/processed_local_audio_source_unittest.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/content/shell/renderer/layout_test/blink_test_runner.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/media/audio/audio_input_device.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/media/audio/audio_input_device_unittest.cc
[modify] https://crrev.com/5d02cf8e38acafeea410906105d5fc11c3e3395b/media/base/audio_capturer_source.h

Comment 5 by tommi@chromium.org, Jan 10 2017

Status: Assigned (was: Fixed)
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 13 2017

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

commit 5d0910b9e09533bf6dfe128adcfb882bc2d5e845
Author: tommi <tommi@chromium.org>
Date: Fri Jan 13 20:50:09 2017

Fix getUserMedia so that failure is reported for invalid audio sources.

This is a reland:
* Original CL https://codereview.chromium.org/2623443002/
* The originally reviewed CL is in the first patch.
* A fix for the issue discovered on the "Win7 Tests (dbg)(1)" bot is in the second patch set.

This changes getUserMedia to wait for initialization of local audio sources before issuing the completion callback (either success or failure). Previously, if an error occurs between attempting to start a local audio source and the render side OnStreamCreated callback, getUserMedia would report successful completion with an audio track but no audio would actually be delivered for that track.

BUG= 679210 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

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

[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/local_media_stream_audio_source.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/local_media_stream_audio_source.h
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/rtc_peer_connection_handler_unittest.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/user_media_client_impl.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/user_media_client_impl.h
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/user_media_client_impl_unittest.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/webrtc/processed_local_audio_source.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/webrtc/processed_local_audio_source.h
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/webrtc/processed_local_audio_source_unittest.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/media/audio/audio_input_device.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/media/audio/audio_input_device_unittest.cc
[modify] https://crrev.com/5d0910b9e09533bf6dfe128adcfb882bc2d5e845/media/base/audio_capturer_source.h

Comment 7 by tommi@chromium.org, Jan 13 2017

Labels: M-57

Comment 8 by tommi@chromium.org, Jan 14 2017

Status: Fixed (was: Assigned)
Project Member

Comment 9 by bugdroid1@chromium.org, Jan 16 2017

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

commit 2d756ffa10cb0081b976d259d76aabf05018066b
Author: tommi <tommi@chromium.org>
Date: Mon Jan 16 14:09:00 2017

Add browser test for getusermedia and unavailable audio device.
This test checks if we report an error when we fail to open an
audio stream at the AudioManager level.

BUG= 679210 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

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

[modify] https://crrev.com/2d756ffa10cb0081b976d259d76aabf05018066b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
[modify] https://crrev.com/2d756ffa10cb0081b976d259d76aabf05018066b/media/audio/audio_manager.cc
[modify] https://crrev.com/2d756ffa10cb0081b976d259d76aabf05018066b/media/audio/audio_manager.h
[modify] https://crrev.com/2d756ffa10cb0081b976d259d76aabf05018066b/media/audio/audio_manager_base.cc
[modify] https://crrev.com/2d756ffa10cb0081b976d259d76aabf05018066b/media/audio/audio_manager_base.h

Sign in to add a comment