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

Issue 769388 link

Starred by 8 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Support audio-only capture (without screen/window/tab video)

Reported by madlittl...@gmail.com, Sep 27 2017

Issue description

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

Steps to reproduce the problem:
When using `chrome.desktopCapture.chooseDesktopMedia(['audio'], function(desktopMediaRequestId, options) { })` currently, the [`kEmptySourcesListError` -> `At least one source type must be specified.` error](https://chromium.googlesource.com/chromium/src/+/6a8d2a721d7d281dba0bb87fbd1d0e9358d6ce7d/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc#40) is thrown because `api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_AUDIO` doesn't add anything to the `source_lists` and you need to accompany with with some video capture like `['screen', 'audio']`.

Recently this area of code was updated to support audio-only capture but the `chrome.desktopCapture.chooseDesktopMedia` part of the API and UI doesn't take this into account yet. See https://bugs.chromium.org/p/chromium/issues/detail?id=662499 -> https://chromium-review.googlesource.com/c/chromium/src/+/656597

Perhaps `['screen'|'window'|'tab', 'audio']` is necessary to specify the context of audio but then when you use `getUserMedia` with only audio constraints, it shouldn't try to grab the video track or throw a `DevicesNotFoundError` error.

```
navigator.webkitGetUserMedia({
	audio: {
		mandatory: {
			chromeMediaSource: 'system'
		}
	}
}, function(mediaStream) {
	// ...
	console.log('audio tracks', mediaStream.getAudioTracks());
})
```

What is the expected behavior?
No error is thrown and only audio is captured.

What went wrong?
The `kEmptySourcesListError` -> `At least one source type must be specified.` error is thrown.

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 10.0
Flash Version: 

This should be filed under (reference, https://bugs.chromium.org/p/chromium/issues/detail?id=662499#c17):
 - Extensions>API
 - Blink>GetUserMedia>Desktop
 
chrome-desktop-capture-audio-test1.zip
1.3 KB Download
Cc: krajshree@chromium.org
Components: Platform>Extensions>API
Labels: Needs-Feedback Needs-Triage-M61
Tested the issue on Win-10 using chrome reported version #61.0.3163.100 and latest canary #63.0.3225.0.

Attached a screen cast and screenshot for reference.

Following are the steps followed to reproduce the issue.
------------
1. Launched chrome and added the extension chrome-desktop-capture-audio-test1 to chrome://extensions.
2. Clicked on background.html link.
3. Observed that an error got displayed as "Unchecked runtime.lastError while running desktopCapture.chooseDesktopMedia: At least one source type must be specified".

madlittlemods@ - Could you please verify the screen cast and screen shot and please let us know if is the issue.

Thanks...!!
769388.webm
2.7 MB View Download
769388.JPG
55.9 KB View Download
krajshree@ That is a perfect reproduction :+1:!
Project Member

Comment 3 by sheriffbot@chromium.org, Sep 28 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Bisect
Rajshree, is this a regression?
ligim...@ I don't think it is a regression. Just a side-effect of how the audio stream was captured.

It seems like the "Status" of this shouldn't be "Unconfirmed" given the reproduction.
Labels: -Needs-Bisect M-63 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.12.6, Win-10 and Ubuntu 14.04 using chrome reported version #61.0.3163.100 and latest canary #63.0.3226.0.

This is a non-regression issue as it is observed from M50 old builds. 
Note: In M50, on clicking the background.html link of the extension a different error is thrown as in the attached screen shot.

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
769388@M50.JPG
34.6 KB View Download

Comment 7 by guidou@chromium.org, Sep 29 2017

Components: -Blink>GetUserMedia Blink>GetUserMedia>Desktop
Status: Available (was: Untriaged)
Just to make sure you get this right: If you do a chooseDesktopMedia call that includes 'audio' it should be possible to call getUserMedia with audio-only constraints, is that a correct summary?
Two problems here I think:

1. chooseDesktopMedia UI doesn't work when only requesting 'audio'
2. getUserMedia doesn't allow audio only constraints for loopback audio capture.

I landed a patch for #2, but it broke Hangouts screenshare and got reverted.  I'll pick it up again but not until later this quarter.

I don't care about #1 since Media Router has its own UI for requesting desktop capture.  But the original poster would like this ability for their extension.
niklase@ Yes, that is a step in the right direction.

@mfo...@ brought up the both areas that ideally would be patched up. People might be scared away of shared video when the extension only needs audio.
Project Member

Comment 11 by sheriffbot@chromium.org, Oct 8

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -M-63 -Needs-Triage-M61
Status: Available (was: Untriaged)

Sign in to add a comment