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

Issue 720250 link

Starred by 4 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Image Capture: Can't turn on flash with takePhoto({fillLightMode: "flash"})

Project Member Reported by fbeaufort@chromium.org, May 10 2017

Issue description

Device name: Pixel 7.1.2
Chrome: 60.0.3094.0	

Steps to reproduce:
(1) Go to https://beaufortfrancois.github.io/sandbox/image-capture/playground.html
(2) Select "camera2 1, facing back"
(3) Select "flash" for fillLightMode 
(4) Press takePhoto button

Expected result:
Flash should occur when taking photo

Actual result:
It doesn't.

For information, the JS code triggered is imageCapture.takePhoto({fillLightMode: "flash"})

See full adb logs attached. Beginning is pasted below:

05-10 09:32:06.708 29477 29489 E BufferQueueProducer: [ImageReader-1920x1080f23m2-29477-10] queueBuffer: BufferQueue has been abandoned
05-10 09:32:06.711  6039 10933 E Surface : queueBuffer: error queuing buffer to SurfaceTexture, -19
05-10 09:32:06.711  6039 10933 E Camera3-OutputStream: returnBufferCheckedLocked: Stream 9: Error queueing buffer to native window: No such device (-19)
05-10 09:32:06.711  6039 10933 E Camera3-Device: Can't return buffer to its stream: No such device (-19)
05-10 09:32:06.741 29477 29597 E BufferQueueProducer: [ImageReader-1920x1080f23m2-29477-10] queueBuffer: BufferQueue has been abandoned
05-10 09:32:06.741  6039 10933 E Surface : queueBuffer: error queuing buffer to SurfaceTexture, -19
05-10 09:32:06.741  6039 10933 E Camera3-OutputStream: returnBufferCheckedLocked: Stream 9: Error queueing buffer to native window: No such device (-19)
05-10 09:32:06.741  6039 10933 E Camera3-Device: Can't return buffer to its stream: No such device (-19)
05-10 09:32:06.775 29477 29568 E BufferQueueProducer: [ImageReader-1920x1080f23m2-29477-10] queueBuffer: BufferQueue has been abandoned
05-10 09:32:06.775  6039 10931 E Surface : queueBuffer: error queuing buffer to SurfaceTexture, -19
05-10 09:32:06.775  6039 10931 E Camera3-OutputStream: returnBufferCheckedLocked: Stream 9: Error queueing buffer to native window: No such device (-19)
05-10 09:32:06.775  6039 10931 E Camera3-Device: Can't return buffer to its stream: No such device (-19)
 
adblogs.txt
38.5 KB View Download
Description: Show this description
Labels: Type-Bug

Comment 3 by mcasas@chromium.org, May 11 2017

Owner: mcasas@chromium.org
Status: Assigned (was: Unconfirmed)
This is a legit bug that can be repro'ed in e.g. N6, sailfish,
since it applies to Camera2 API.  There seems to be some mix up
with torch as well, anyway, working on it.
Project Member

Comment 4 by bugdroid1@chromium.org, May 11 2017

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

commit b95ce72dc081549b258f2836aaf85c1c95b2356a
Author: mcasas <mcasas@chromium.org>
Date: Thu May 11 02:11:32 2017

Image Capture Android: make torch mode override other fill light mode(s)

Setting the torch (flash constantly on) should override other fill light
mode settings (i.e. off/auto/always).  This CL fixes that for both the
old and new API. Also, for the new API, torch needs the CONTROL_AE_MODE
specified.

(This CL does not fix the auto/always flash not working properly in
the new API because this needs a dance of CONTROL_AE_PRECAPTURE_TRIGGER
manipulation worth a CL of its own).

BUG=720250

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

[modify] https://crrev.com/b95ce72dc081549b258f2836aaf85c1c95b2356a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
[modify] https://crrev.com/b95ce72dc081549b258f2836aaf85c1c95b2356a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java

imageCapture.takePhoto({fillLightMode: "flash"}) still doesn't turn on torch when taking a photo on my Pixel Phone with Chromium 60.0.3097.0.

Comment 6 by mcasas@chromium.org, May 11 2017

Cc: fbeaufort@chromium.org
Status: Started (was: Assigned)
#4 has fixed some side issue with the torch, so that after it lands,

theTrack.applyConstraints({ advanced : [{ torch : true }]});

works in both the old and the new Android APIs.  

Forcing the flash with imageCapture.takePhoto({fillLightMode: "flash"}) 
should work with the old Android API (e.g. a Samsung Note II) but _not_ 
with the new Android API -- will work on that tomorrow !


Cc: mcasas@chromium.org
 Issue 721227  has been merged into this issue.
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 7 2017

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

commit c69a479170be23ec6fed72bf863b18c44cdbd694
Author: Miguel Casas-Sanchez <mcasas@chromium.org>
Date: Wed Jun 07 03:04:59 2017

Image Capture: refactor Android Camera2 code to simplify Session mgmt

ToT has two CaptureSessions, one for preview and one for photo,
that are alternated upon takePhoto(). Each has a CaptureRequest
(a "request" is like a config "packet"). This CL moves to having
a single Session with two Requests (one for preview and one for 
photo) and adds a third for the needed flash calibration round
(call a "precapture" in the API). 

The new Request dance is, w/o flash light:
 preview --> capture --> preview
and with flash:
 preview --> precapture --> capture --> preview.

Each Request is coupled with a persistent ImageReader: the existing 
|mImageCapture| (renamed to |mPreviewReader|) and a new |mPhotoCapture|. 
Having a single Session is good in itself because it takes 
significant time to change between them (~150ms!).

Other minor thingies:

- |mReconfigureCaptureTask| and CrPhotoSessionListener are 
not necessary and removed.
- no need to keep |mPreviewRequest| and |mPreviewRequestBuilder|,
so we just have the latter.
- new service function restartPreview() to bundle up the try-catch.

Bug: 720250,  721227 
Change-Id: Icaec2410942fe478dee73d0b0335987f963bb9bb
Reviewed-on: https://chromium-review.googlesource.com/526280
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477533}
[modify] https://crrev.com/c69a479170be23ec6fed72bf863b18c44cdbd694/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java

 Issue 760542  has been merged into this issue.
Cc: mscales@chromium.org
Status: Untriaged (was: Started)
Removing myself as owner of these issues are marking them 
for retriaging.
Owner: ----
Status: Available (was: Untriaged)
Project Member

Comment 14 by sheriffbot@chromium.org, Oct 23

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

Sign in to add a comment