Closed Bug 1191298 Opened 10 years ago Closed 10 years ago

getUserMedia fails for audio if constraints are specified

Categories

(Core :: WebRTC: Audio/Video, defect, P1)

42 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla43
Tracking Status
firefox41 --- unaffected
firefox42 + verified
firefox43 --- verified

People

(Reporter: paweldomas, Assigned: jib)

References

(Blocks 1 open bug)

Details

(Keywords: regression, testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36 Steps to reproduce: Calling getUserMedia with constraints for audio only stream fails: { audio: true, video: false } Actual results: MediaStreamError { name: "NotFoundError", message: "The object can not be found here.", constraintName: "", stack: "" } Expected results: Audio only media stream should be returned. This happens with the latest nightly build 42.0a1 (2015-08-04). I have USB camera with integrated microphone, but it also fails on all of my laptops. Calling with the constraints below works fine: { audio: true, video: true }
Could you attach a minimal testcase to reproduce the issue, please.
Component: Untriaged → WebRTC: Audio/Video
Flags: needinfo?(paweldomas)
Keywords: testcase-wanted
Product: Firefox → Core
Sorry I should have done it in the first place: http://pastebin.com/SY1vU6uy It turned out that it works when { audio: true }, but it does not allow to specify optional constratins like we do in the example above. It used to work until few days ago.
Flags: needinfo?(paweldomas)
Attached file getusermediatest.html
Blocks: 1156472
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(padenot)
OS: Unspecified → All
Hardware: Unspecified → All
Version: Trunk → 42 Branch
Tracked for 42, because this is a regression, and expectation would be that the audio would work consistently.
backlog: --- → webRTC+
Rank: 10
Priority: -- → P1
Hey Paul, this looks like fallout from your audio capture landing.
Assignee: nobody → padenot
(clearing NI, I'm on it).
Flags: needinfo?(padenot)
After talking with Jan-Ivar, he thought of a better fix and knows the area better, so he's taking this one.
Assignee: padenot → jib
Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression)
Attachment #8645767 - Flags: review?(padenot)
We don't support the (non-spec) constraints in comment 0, so they're ignored, but we fail even on an empty {}, which is a regression: http://jsfiddle.net/03d0frua
Summary: getUserMedia fails for audio only → getUserMedia fails for audio if constraints are specified
Comment on attachment 8645767 [details] MozReview Request: Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression) Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression)
Attachment #8645767 - Flags: review?(rjesup)
Extending review to jesup. I'll take the first review I get.
Comment on attachment 8645767 [details] MozReview Request: Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression) https://reviewboard.mozilla.org/r/15547/#review13953 Ship It!
Attachment #8645767 - Flags: review?(rjesup) → review+
Looks good, but this needs tests, let me know if you want me to write some.
Flags: needinfo?(jib)
I'm a bit unsure how to test this since our fake devices don't really have constraints yet, so there's nothing to work against for a test. Even the linux loopback devices don't have this AFAIK? test_getUserMedia_constraints.html only really exercises the code and tests known failure paths for any device. The success path in it doesn't really do anything other than test that the syntax passes. If you have tests in mind for this then that would be great!
Flags: needinfo?(jib)
It's hard/impossible to test this in automation currently (and this affects other aspects of constraints). Let's manually test this, and file a bug for automated tests, and another bug (blocking the test bug, and likely some others (or others we should file)) for adding support for constraints to the fake devices and/or the loopback devices. (Loopback is probably better, as it tests more of the real code paths, but for constraints testing this may not matter.) Lack of being able to test these has bitten us before, so this should be a high P2 at least.
Flags: needinfo?(padenot)
It might be hard to write integration tests for this because it indeed relies on devices enumeration, but that sounds like something that should be mocked and tested with unit tests.
Flags: needinfo?(padenot)
Filed the bug (and hooked to the bug for making the fake/loopback devices more real)
I'm good with c++ unit tests or updating the fake/loopback devices. This is an important-enough regression (and too hard to back out the regressing code) I'd like to manually test this, land it, and then backfill with tests. I'm good with making tests a P1 (and there are less hurdles in getting a c++ unit test added compared to changes to the loopback devices, though perhaps more code to write).
See Also: → 1088621
Attachment #8645767 - Flags: review?(padenot)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment on attachment 8645767 [details] MozReview Request: Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression) Approval Request Comment [Feature/regressing bug #]: Bug 1156472 [User impact if declined]: Users will no longer get prompted to share their cameras or microphones on sites that specify audio-constraints of any kind. Even if they provide zero audio constraints e.g. they pass {audio: {}} instead of {audio:true} to getUserMedia, then getUserMedia will always fail immediately with NotFoundError instead of prompting the user. [Describe test coverage new/current, TreeHerder]: Tested locally. Landed on m-c a week ago. [Risks and why]: Very low risk, because the new code mirrors similar code that exists for video, but was missing for audio. Only code dealing directly with audio constraints is modified (plus a minor variable rename in video for symmetry). [String/UUID change made/needed]: none
Attachment #8645767 - Flags: approval-mozilla-aurora?
Comment on attachment 8645767 [details] MozReview Request: Bug 1191298 - don't fail on unknown audio constraints e.g. getUserMedia({ audio: {} }) (regression) Fix a regression, taking it.
Attachment #8645767 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Flags: qe-verify+
Reproduced with 42.0a1 (from 2015-08-05). Verified fixed with 42.0b2 and 43.0a2 (from 2015-09-29), across platforms [1]. [1] Windows 7 64-bit, Ubuntu 14.04 64-bit and Mac OS X 10.10.4
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: