Closed Bug 1436341 Opened 6 years ago Closed 6 years ago

On Windows the camera light is not turned off after you disabled the camera.

Categories

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

60 Branch
Unspecified
Windows
defect

Tracking

()

VERIFIED FIXED
mozilla60
Tracking Status
firefox-esr52 --- unaffected
firefox58 --- unaffected
firefox59 --- unaffected
firefox60 --- verified

People

(Reporter: Ovidiu, Assigned: pehrsons)

References

Details

Attachments

(2 files)

Affected versions]:

Tested on Nightly 60.0a1(2018-02-07)

[Affected platforms]:

Tested on Windows 10

[Steps to reproduce]:

Prerequisites:
 Make sure you have connected 1 camera.
 
 STR:

1. Open Firefox and start a video call by selecting the plugged camera to share.
2. Disable your camera. (Pay attention to the camera light.)
 


[Expected result]:

The camera light is turned off after ~3sec. 

[Actual result]:

The camera light is not turned off after ~3sec. 

Note: This is reproducible only on Windows.
Rank: 15
Priority: -- → P2
I tested on Surface Pro 4 that has Windows 10 and it has camera build in. When I use the built-in camera and try to disable it the light turns off like is supposed to, but if I connect a USB camera and do the same action the camera light from the connected camera is not turned off.
Assignee: nobody → bvandyk
Blocks: 1299515
Just got an external cam to test this out. I have not been able to repro thus far. I've tested with a LifeCam HD 3000[0], which turns its light on when using the cam *or* mic. As such, when both inputs are coming from the cam both need to be turned off in order to get the light to turn off.

I've tested on a few different configurations using appear.in:
- Laptop with built in cam and mic (no external webcam): light on built in cam turns off as expected.
- Laptop with built in cam and mac + webcam attached: lights on built in cam and external web cam turn off as expected. Devices not selected in gUM do no show lights. If webcam mic is used, it must be turned off to get light to turn off.
- Desktop with only webcam attached: light turns off on webcam as expected. Both camera and cam have to be turned of for this to happen given how the LifeCam works.
- Desktop with external mic + webcam: light turns off on webcam as expected. When using the other mic I only need to turn off the camera on the webcam in order for the light to turn off.

:Ovidiu, do you have any other machines you're able to repro on? Can you let me know what kind of webcam you're using? I wonder if we can narrow this down to some more specific hardware.

[0] https://www.amazon.com/Microsoft-3364820-LifeCam-HD-3000/dp/B008ZVRAQS
Flags: needinfo?(ovidiu.boca)
Hi Bryce,
I just tested this on Nightly 60.0a1(2018-03-06) using HD Pro Webcam C920[0] and the issue is reproducible. 
You are right if I use LifeCam HD 3000 and disable both V/A the camera light is turned off. 

[0]https://www.logitech.com/en-us/product/hd-pro-webcam-c920
Flags: needinfo?(ovidiu.boca)
Ok, we need to make this reproducible.

Consider this the STR:
1 Open https://jsfiddle.net/pehrsons/y2rvuqdL/embedded/result%2Cjs%2Chtml/
2 Click "Check cameras"
3 Approve all permission requests
Expected: One video element, disable, enable and stop button for each connected camera.

4 For each camera
  4.1 click Disable
  Expected: Camera light eventually turns off

5 Click the capture indicator in the address bar
Expected: Grey camera icon in address bar and under "Permissions"

6 For each camera
  6.1 click Enable
  Expected: Camera light turns on

  6.2 Click the capture indicator in the address bar
  Expected: Red camera icon in address bar and under "Permissions"

  6.3 click Stop
  Expected: Camera light turns off

  6.4 If this was not the last camera, Click the capture indicator in the address bar
  Expected: Grey camera icon in address bar and under "Permissions"


Ovidiu, for which cameras that you have access to does step 4.1 not render the expected result? Are there other points rendering unexpected results, perhaps 5?
Flags: needinfo?(ovidiu.boca)
We tested on Windows 10 Nightly 60.0a1 using Microsoft LifeCam HD 3000 and Logitec HD Pro Webcam C920, here are the results:

1.ok
2.ok
3.ok
4. The camera light from Logitec HD Pro Webcam C920 is still on 
   The camera light from Microsoft LifeCam HD 3000 is off

5. OK
6. OK - The camera light from Logitec HD Pro Webcam C920 was still on from step 4
        The camera light from Microsoft LifeCam HD 3000 is on
6.2 ok
6.3 ok
6.4 ok
Flags: needinfo?(ovidiu.boca)
FWIW I can repro with the Logitech Brio on Windows 10. It behaves the same as the C920 per comment 5.
Assignee: bvandyk → apehrson
Increasing prio off the assumption that all Logitech devices are impacted.
Status: NEW → ASSIGNED
Rank: 15 → 11
Not a regression. This is the new feature in bug 1299515 not working to its full extent.
Keywords: regression
Comment on attachment 8956799 [details]
Bug 1436341 - Stop() instead of Pause() device when stopping capture on Windows.

https://reviewboard.mozilla.org/r/225776/#review231628

Lgtm.
Attachment #8956799 - Flags: review?(jib) → review+
Comment on attachment 8956800 [details]
Bug 1436341 - Fix assertion for when a device operation fails.

https://reviewboard.mozilla.org/r/225778/#review231632
Attachment #8956800 - Flags: review?(jib) → review+
When this has landed (going to autoland soon, so posting this before I forget), it'd be great if QA could check on as many versions of Windows as possible, with as many cameras as possible. Especially that it's fixed on the logitech but also that others are still working.

Bryce, if you could also check with all the laptop builtins you have access to, that'd be great.

See the basic steps in comment 4. Also a second round with step 6 replaced by:

6 For each camera
  6.1 Open another application that uses the camera and make sure it's capturing live. For instance Skype, Chrome, another instance of Firefox, etc.
  6.2 While the capture in the other application is happening, click Enable.
  Expected: Camera readyState changes from "live" to "ended"

  6.3 If this was not the last camera, Click the capture indicator in the address bar
  Expected: Grey camera icon in address bar and under "Permissions"
Flags: qe-verify+
Flags: needinfo?(bvandyk)
Pushed by pehrsons@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/8fb4ddab4730
Stop() instead of Pause() device when stopping capture on Windows. r=jib
https://hg.mozilla.org/integration/autoland/rev/101b62aa7767
Fix assertion for when a device operation fails. r=jib
https://hg.mozilla.org/mozilla-central/rev/8fb4ddab4730
https://hg.mozilla.org/mozilla-central/rev/101b62aa7767
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Looks good to me. Saw some weirdness on one laptop before I bumped nightly (think I had one from yesterday or day before): wasn't getting my lifecam light turning off when disabled, but seems fine after bump.

Testing this on my Windows laptops with Nightly 60.0a1 (2018-03-08) (64-bit):

- Lenovo P51
  - Built in cam
    - (Step 4) Camera light turns off on disable
    - (Step 6a) Camera light turns back on + red camera icon + on stop grey camera icon remains on stop as lifecam is still active
    - (Step 6b) Status changes to ended + grey camera icon remains as lifecam still active
  - Lifecam HD-3000
    - (Step 4) Camera light turns off on disable
    - (Step 6a) Camera light turns back on + red camera icon + on stop icons are removed as last active camera is gone
    - (Step 6b) Status changes to ended + grey camera icon is gone as lifecam is last camera being used
- Macbook Pro
  - As above
Flags: needinfo?(bvandyk)
Hi Andreas,

We tested this on Windows 10 x64 with FF Nightly (2018-03-11) following the steps from comment 4 and everything works as expected. 
We had some different results after we tested this with steps from comment 15
"6 For each camera
  6.1 Open another application that uses the camera and make sure it's capturing live. For instance Skype, Chrome, another instance of Firefox, etc.
  6.2 While the capture of the other application is happening, click Enable.
  Expected: Camera readyState changes from "live" to "ended"

We started another capture on Chrome using this test page: https://jsfiddle.net/pehrsons/y2rvuqdL/embedded/result%2Cjs%2Chtml/ then while the capture of the other application was happening I opened the same site on Nightly and tried to start a capture, I wasn't able to do that, I received this error: 
Microsoft LifeCam 3000 - InternalError: Starting video failed
Logitec 920 - NotReadableError: Failed to allocate videosource
Flags: needinfo?(apehrson)
(In reply to ovidiu boca[:Ovidiu] from comment #19)
> Hi Andreas,
> 
> We tested this on Windows 10 x64 with FF Nightly (2018-03-11) following the
> steps from comment 4 and everything works as expected. 
> We had some different results after we tested this with steps from comment 15
> "6 For each camera
>   6.1 Open another application that uses the camera and make sure it's
> capturing live. For instance Skype, Chrome, another instance of Firefox, etc.
>   6.2 While the capture of the other application is happening, click Enable.
>   Expected: Camera readyState changes from "live" to "ended"
> 
> We started another capture on Chrome using this test page:
> https://jsfiddle.net/pehrsons/y2rvuqdL/embedded/result%2Cjs%2Chtml/ then
> while the capture of the other application was happening I opened the same
> site on Nightly and tried to start a capture, I wasn't able to do that, I
> received this error: 
> Microsoft LifeCam 3000 - InternalError: Starting video failed
> Logitec 920 - NotReadableError: Failed to allocate videosource

Thanks. This is expected, and similar to linux.

Well, the error from the LifeCam is actually non-spec. I suppose it allows simultaneous allocations but not simultaneous captures. Long term we'd want to make that InternalError a NotReadableError but short term it's not a priority.
Status: RESOLVED → VERIFIED
Flags: needinfo?(apehrson)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: