android-Camera2Basic icon indicating copy to clipboard operation
android-Camera2Basic copied to clipboard

Capturing with flash on Samsung S6 (6.0.1) causes the camera to become unresponsive.

Open sugarmanz opened this issue 10 years ago • 14 comments

When capturing a still-shot w/o flash, the app works as intended. But, when a flash occurs, the camera "view" freezes. The app itself is still responsive, as clicking the info button still brings up the dialog. No error messages display to logcat.

sugarmanz avatar Jul 30 '16 17:07 sugarmanz

Hi, I also facing the same issue on Samsung S6 Edge (6.0.1). But in Samsung S6 (5.1.1), it's working fine. Seems Marshmallow have some issue for capturing with flash

sujewan avatar Aug 03 '16 05:08 sujewan

I don't think it is exculsively Marshmallow. I am able to capture flash on other 6.0.1 devices (i.e. Nexus 6, 6p). So maybe Samsung/Marshmallow combo.

On Aug 3, 2016 1:02 AM, "sujewan" [email protected] wrote:

Hi, I also facing the same issue on Samsung S6 Edge (6.0.1). But in Samsung S6 (5.1.1), it's working fine. Seems Marshmallow have some issue for capturing with flash

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-Camera2Basic/issues/56#issuecomment-237139881, or mute the thread https://github.com/notifications/unsubscribe-auth/AI0646Ll038Qy2F2rn3DtJzQzK49YK__ks5qcCDBgaJpZM4JY2cC .

sugarmanz avatar Aug 03 '16 11:08 sugarmanz

It should be a Samsung S6/ S6 edge + marshmallow combo. Because I tried with Samsung S7 Edge with v6.0.1 - Flash capturing is working fine

sujewan avatar Aug 03 '16 12:08 sujewan

I'm facing same issue in Galaxy S6, any progress.!?

kishorejethava avatar Aug 16 '16 11:08 kishorejethava

Nope. Not yet.

sugarmanz avatar Aug 18 '16 19:08 sugarmanz

Same issue here on Note 5. Any update?

isaachunyu avatar Sep 01 '16 21:09 isaachunyu

Any news? This is still a bug on my Samsung Galaxy S6 with Android 6.0.1

brossferatu avatar Nov 30 '16 13:11 brossferatu

I have the same issue too. Has anyone a fix for this problem

mjf009 avatar Apr 17 '17 14:04 mjf009

I have a Samsung Galaxy S6 i this i how fix the flash, I change the setAutoFlash() method with this: flashOn is a boolean that comes of my button to turn on/off the flash

private void setAutoFlash(CaptureRequest.Builder requestBuilder) {
        if (mFlashSupported) {
            requestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AE_MODE_OFF);
            requestBuilder.set(CaptureRequest.FLASH_MODE,CameraMetadata.FLASH_MODE_OFF);

            if(flashON)
                requestBuilder.set(CaptureRequest.FLASH_MODE,CameraMetadata.FLASH_MODE_TORCH);
        }
    }

Ashky avatar Jun 23 '17 21:06 Ashky

@Ashky this works but what if I want to use flash only when in dark areas. I want the flash to work automatically like it does on non Samsung devices.

Any ideas how to make this work?

yoavya avatar Jul 05 '17 14:07 yoavya

@yoavya maybe this is that you need

requestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AE_MODE_OFF); requestBuilder.set(CaptureRequest.FLASH_MODE,CameraMetadata.CONTROL_AE_MODE_ON_AUTO_FLASH);

https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#CONTROL_AE_MODE_ON_AUTO_FLASH

Ashky avatar Jul 05 '17 21:07 Ashky

@Ashky what you suggest only starts the camera torch constantly. Also CONTROL_AF_MODE should accept AF related modes and not AE mode the same for FLASH_MODE that only accepts FLASH_MODE_OFF FLASH_MODE_SINGLE FLASH_MODE_TORCH there is no CONTROL_AE_MODE_ON_AUTO_FLASH for this mode. Unfortunately.

yoavya avatar Jul 06 '17 08:07 yoavya

I was able to workaround this by NOT stopping/starting the preview capture request when taking a picture. I was looking into Camera2Raw example where I did not have this issue, and I noticed they dont stop the preview there, so I tried it and it worked. Basically comment this lines: method unlockFocus(): // mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback, // mBackgroundHandler);

method captureStillPicture(): // mCaptureSession.stopRepeating(); // mCaptureSession.abortCaptures();

skmll avatar Oct 26 '17 10:10 skmll

This sample has been migrated to a new location where we can accept Pull Requests (check README for more information).

As recommended by GitHub, we are closing all issues and pull requests now that this older repo will be archived.

If you still see this issue in the updated repo, please reopen the issue/PR there. Thank you!

codingjeremy avatar Sep 19 '19 22:09 codingjeremy