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

Issue 662616 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Chromebook camera settings don't revert to default ones when closing it.

Project Member Reported by mcasas@chromium.org, Nov 5 2016

Issue description

Copied from [1]

>I play with a web app that lets me update my camera settings (saturation, brightness, zoom, etc.)
> I close this app
> I lose internet connection / I don't remember website / Web app is down (pick your favorite)
> I can't change back my camera settings!
> Restarting my Chromebook doesn't even work... I'm stuck with these settings ;(


I think the problem is that the settings persist after the WebCam
has been closed. 
VideoCaptureDeviceLinux {c,sh}ould restore the default values when
closing it, hence restoring the standard value for other Apps.

[1] https://github.com/w3c/mediacapture-image/issues/104#issuecomment-256912439
 
Cc: mcasas@chromium.org
 Issue 655094  has been merged into this issue.

Comment 2 by sshru...@google.com, Nov 23 2016

Components: -Blink>MediaStream>ImageCapture Blink>ImageCapture
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 9 2016

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

commit 9b3a179c91492c28c2eaf53daf52d6caebff77a0
Author: mcasas <mcasas@chromium.org>
Date: Fri Dec 09 23:38:01 2016

Image Capture v4l2: reset all user controls to default values when closing device fd

This CL adds logic for resetting all User Controls to its default
value upon closing the device file descriptor; otherwise, as the
bug proves, they persist across camera uses, e.g. the zoom level
is unchanged.

This would be relatively simple except for the fact that controls
come in two types: user controls and camera controls, and
that some controls need another one to be set or cleared
beforehand (e.g. white_balance_auto must be set to off
before white_balance can be set, etc).

See [1] for Spec
[1]  https://www.linuxtv.org/downloads/legacy/video4linux/API/V4L2_API/spec-single/v4l2.html#control

BUG= 662616 

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

[modify] https://crrev.com/9b3a179c91492c28c2eaf53daf52d6caebff77a0/media/capture/BUILD.gn
[modify] https://crrev.com/9b3a179c91492c28c2eaf53daf52d6caebff77a0/media/capture/video/linux/v4l2_capture_delegate.cc
[modify] https://crrev.com/9b3a179c91492c28c2eaf53daf52d6caebff77a0/media/capture/video/linux/v4l2_capture_delegate.h
[add] https://crrev.com/9b3a179c91492c28c2eaf53daf52d6caebff77a0/media/capture/video/linux/v4l2_capture_delegate_unittest.cc

Comment 4 by mcasas@chromium.org, Dec 12 2016

Labels: Needs-Verification
Status: Fixed (was: Assigned)
This is sadly still not workin for me in Chrome OS 57.2948.0.

Steps to reproduce:

1. Go to https://beaufortfrancois.github.io/sandbox/image-capture/playground.html
2. Change camera controls such as brightness, contrast, saturation and sharpness.
3. Close lid. Wait a bit...
4. Open lid.

Video is still using my custom camera controls ;(

I'm not able to detect some helpful logs. Which file would you need?
Good news is that zoom is actually reset ;) Yeah!

Comment 7 by mcasas@chromium.org, Dec 13 2016

Status: Started (was: Fixed)
#5: ouch, the code in #3 resets controls upon closing of the VideoCaptureDevice; 
I believe we just go away when Chrome crashes and/or the user closes the lid.  
I'll move the logic to the ctor/AllocateAndStart() method to guarantee that the 
first camera opening gets the correct values.  

Alternatively, would it make sense to have in the Spec:
- a resetSettings() method to return all controls to default
- a |default| value in the MediaSettingsRange [1] so that the
WebApp can default values on its own terms and timing?


[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/imagecapture/MediaSettingsRange.idl?q=MediaSettingsRange.idl&sq=package:chromium&dr

Comment 8 by mcasas@chromium.org, Dec 14 2016

Follow up CL under review: https://crrev.com/2568883005/
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 14 2016

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

commit 7c87eca4bdc531431eafa66c37e9468b1ccb5ca6
Author: mcasas <mcasas@chromium.org>
Date: Wed Dec 14 02:05:14 2016

ImageCapture v4l2: reset user controls when opening the device

ToT resets the control values to their default upon StopAndDeallocate()
of the device, but, as the bug says, sometimes Chrome is shut down
unexpectedly or -shivers- crashes.  This CL moves the resetting to
AllocateAndStart() method.

BUG= 662616 

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

[modify] https://crrev.com/7c87eca4bdc531431eafa66c37e9468b1ccb5ca6/media/capture/video/linux/v4l2_capture_delegate.cc

fbeaufort@ can you try verifying again? Thanks!
Status: Fixed (was: Started)
Verified in Chrome Canary 57.0.2958.0. Thank you!

QQ: How is that going to work for Chrome OS devices with no lid such as Chromebox and Chromebit?
Status: Verified (was: Fixed)
#12: controls are resetted every time the underlying device
is (re)opened, so if you, e.g. close a tab with an active 
capture on it and reopen it afterwards, that should find the
values back to their defaults as well.

Sign in to add a comment