Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

captureImage callback not being called #467

Open
UmarBhutta opened this issue Dec 9, 2018 · 34 comments

Comments

@UmarBhutta
Copy link

commented Dec 9, 2018

After updating my project with new version(1.0.0-beta3.10 and 3.9) of camerakit and migrating to kotlin 1.3.11 for and coroutines 1.0.0 rapid calling for the image capture callback is being lost.
if you try to call captureImage method very quickly like clicking very fast. You will not get any callback for that click. Any suggestion?

@emersoncloud

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2018

@UmarBhutta thanks for the issue. To help us better diagnose could you provide some more information about your setup.

  1. Android Device
  2. Android Version
  3. Your XML setup and the code you're using to call captureImage.

Closing this issue for now, I'll reopen when you respond with the information. Thanks again!

@qmetzler-luna

This comment has been minimized.

Copy link

commented Dec 12, 2018

It can happen even when not clicking fast, just calling it several time in a row will break the captureImage randomly.
By breaking I mean the callback is not called anymore and the camera also doesn't make the auto focus.
I tried calling
camera.onPause()
camera.onStop()
camera.onStart()
camera.onResume()
and camera.captureImage again but the callback is still not called.

  1. Pixel 3
  2. 9 API 28
<com.camerakit.CameraKitView
            android:id="@+id/camera"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:fitsSystemWindows="true"
            android:keepScreenOn="true"
            app:camera_focus="continuous"
            app:camera_imageJpegQuality="100"
            app:camera_imageMegaPixels="2.0"
            app:camera_permissions="camera"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
override fun onStart() {
    super.onStart()
    camera.onStart()
}
override fun onResume() {
    super.onResume()
    camera.onResume()
}
private fun setupCamera() {
    camera.errorListener = CameraKitView.ErrorListener { _, cameraException ->
        Log.e("Taking picture", "error")
    }
    button.setOnClickListener {
        Log.e("Taking picture", "trying to take a picture")
        camera.captureImage { _, image ->
            Log.e("Taking picture", "callback called")
            imageCaptured(image)
        }
    }
}

Thank you!

@frogermcs

This comment has been minimized.

Copy link

commented Dec 13, 2018

Confirming - Pixel 3XL. Android 9. When I capture a couple times in a row, no callbacks are called from CameraKit. Not from captureImage, nor errorListener.

Interesting fact - when you stack "clicks", take app to background and bring it back, callback is delivered with the latest captured image.

Here are some random logs pointing on CamX:

2018-12-13 18:09:45.651 1164-1223/? E/libprocessgroup: Error encountered killing process cgroup uid 99085 pid 8676: No such file or directory
2018-12-13 18:09:46.599 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10157/pid_11303/memory.stat open failed: No such file or directory
2018-12-13 18:09:47.189 12521-12732/? E/Spotify: [Picasso-] Failed to loaded image:  -> content://com.spotify.music/image/
2018-12-13 18:09:47.582 12521-12521/? E/Spotify: [main] Failed to load image with uri: "".
    java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found
        at aavo.a(SourceFile:1325)
        at aavn.f(SourceFile:916)
        at aawa.a(SourceFile:165)
        at gro.a(SourceFile:121)
        at yyk.a(SourceFile:44)
        at zdm.a(SourceFile:206)
        at zdm.run(SourceFile:159)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
        at zfd.run(SourceFile:411)
2018-12-13 18:09:47.617 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10027/pid_8982/memory.stat open failed: No such file or directory
2018-12-13 18:09:47.926 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10024/pid_11258/memory.stat open failed: No such file or directory
2018-12-13 18:09:53.156 12933-12933/? E/tunein.player: Not starting debugger since process cannot load the jdwp agent.
2018-12-13 18:09:53.418 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10073/pid_11869/memory.stat open failed: No such file or directory
2018-12-13 18:09:53.811 12933-12933/? E/tunein.player: Invalid ID 0x00000000.
2018-12-13 18:09:56.744 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10168/pid_11444/memory.stat open failed: No such file or directory
2018-12-13 18:10:09.084 799-2141/? E/libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq with value: 1996800, fd: 19
2018-12-13 18:10:09.117 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10179/pid_9136/memory.stat open failed: No such file or directory
2018-12-13 18:10:09.164 821-821/? E/lowmemorykiller: /dev/memcg/apps/uid_10031/pid_8068/memory.stat open failed: No such file or directory
2018-12-13 18:10:09.428 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:09.976 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:09.991 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:10.008 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:10.024 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:10.042 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:10.058 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:10.074 623-623/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:10.075 785-1282/? E/native: easel_manager_callback.cc:35 COMMAND_PROCESSOR_3PA on easel exited0
2018-12-13 18:10:10.131 785-1282/? E/libc: Access denied finding property "ro.camera.req.fmq.size"
2018-12-13 18:10:10.132 785-1282/? E/libc: Access denied finding property "ro.camera.res.fmq.size"
2018-12-13 18:10:10.160 785-1282/? E/CamX: [ERROR][HAL    ] camxchicontext.cpp:3826 CloneNodeProperties() No memory allocated for pNodeProperties
2018-12-13 18:10:10.160 785-1282/? E/CamX: [ERROR][HAL    ] camxchicontext.cpp:3826 CloneNodeProperties() No memory allocated for pNodeProperties
2018-12-13 18:10:10.161 785-1282/? E/GOOGLE_CHINODE_HDRPLUS: CHINODECAPSINFO is smaller than expected
2018-12-13 18:10:10.162 785-13462/? E/libc: Access denied finding property "persist.gcam.debug"
2018-12-13 18:10:10.162 785-13462/? E/libc: Access denied finding property "persist.gcam.save_text"
2018-12-13 18:10:10.162 785-13462/? E/libc: Access denied finding property "persist.gcam.save_metering"
2018-12-13 18:10:10.162 785-13462/? E/libc: Access denied finding property "persist.gcam.save_payload"
2018-12-13 18:10:10.162 785-13462/? E/CameraMetadataUtils: InitializeLensGcamGeometricCalibration: 335: distortion is NULL.
2018-12-13 18:10:10.163 785-1282/? E/CamX: [ERROR][HAL    ] camxchicontext.cpp:3826 CloneNodeProperties() No memory allocated for pNodeProperties
2018-12-13 18:10:10.163 785-1282/? E/CamX: [ERROR][HAL    ] camxchicontext.cpp:3826 CloneNodeProperties() No memory allocated for pNodeProperties
2018-12-13 18:10:10.189 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1600 SetMetadataByTag() Invalid slot; cannot set metadata tag 80080003
2018-12-13 18:10:10.189 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1763 PublishMetadataList() Invalid slot, cannot publish metadata list
2018-12-13 18:10:10.278 785-1282/? E/CamX: [ERROR][STATS  ] camxaecengine.cpp:3876 FillLEDCalibrationDataInput() No LED calibration data
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS  ] gcamfastaeutil.cpp:1154 SetTuningData() [FastAE] ERROR! Failed to get the tuning data
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS_AEC] aec_led_calibration.cpp:560: aec_led_cal_apply_calibration Invalid pointer 0x723eb4e000 0x0
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS_AEC] aec_set.cpp:1346: aec_set_fps_range Aec_Error invalid input 0 
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS  ] camxae.cpp:2080 AECSetSensorInfo() Wrong initial sequence from HAL!
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS_AEC] aec_get.cpp:777: aec_get_param GET_EXP_PARAMS ERROR, Uninitialized exposure settings requested
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS_AEC] camxcaecstatsprocessor.cpp:1710 PopulatePropPoolFrameControl() Invalid exposure parameters: gain: 1.000000, exposureTime: 0
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][HAL    ] camxsession.cpp:3537 GetIntraRealtimePipelineId() Less than two realtime pipelines, no intra result
2018-12-13 18:10:10.280 785-1282/? E/CamX: [ERROR][STATS_AWB] camxcawbioutil.cpp:2527 FillLEDCalibrationDataInput() No LED calibration data
2018-12-13 18:10:10.284 785-1282/? E/CamX: [ERROR][STATS_AWB] awb_interface.cpp:1480: awb_interface_set_dualcam_calibration_data No dualcam calibration data
2018-12-13 18:10:10.284 785-1282/? E/GoogTuning: Error! Unsupported tuning mode (usecase: 65535, sensorMode: 65535) - using the default tuning header instead
2018-12-13 18:10:10.303 785-1282/? E/CamX: [ERROR][HAL    ] camxsession.cpp:3537 GetIntraRealtimePipelineId() Less than two realtime pipelines, no intra result
2018-12-13 18:10:10.313 785-1282/? E/CamX: [ERROR][HAL    ] camxsession.cpp:3537 GetIntraRealtimePipelineId() Less than two realtime pipelines, no intra result
2018-12-13 18:10:10.313 785-1282/? E/GoogTuning: Error! Unsupported tuning mode (usecase: 65535, sensorMode: 65535) - using the default tuning header instead
2018-12-13 18:10:10.313 785-1282/? E/CamX: [ERROR][HAL    ] camxsession.cpp:3537 GetIntraRealtimePipelineId() Less than two realtime pipelines, no intra result
2018-12-13 18:10:10.313 785-1282/? E/CamX: [ERROR][STATS_AF] camxautofocusnode.cpp:983 InitializeMultiStats() FATAL: Failed to get peer pipeline ID!
2018-12-13 18:10:10.343 785-1276/? E/CamX: [ERROR][STATS_AF] pdlib_lcr_utils.cpp:136 pdaf_lcr_get_vertical_blocks() Cound not find a good partition, set mega_block_y = 1
2018-12-13 18:10:10.372 785-1282/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:10.461 785-1276/? E/CamX: [ERROR][STATS_AF] camxcafioutil.cpp:904 ReadAECInput() PropertyIDAECInternal null data
2018-12-13 18:10:10.461 785-1276/? E/CamX: [ERROR][STATS_AF] camxcafioutil.cpp:931 ReadAECInput() PropertyIDAECFrameInfo null data
2018-12-13 18:10:10.461 785-1278/? E/CamX: [ERROR][STATS_AEC] aec_led_calibration.cpp:560: aec_led_cal_apply_calibration Invalid pointer 0x723eb4e000 0x0
2018-12-13 18:10:10.461 785-1278/? E/CamX: [ERROR][STATS_AEC] aec_set.cpp:1346: aec_set_fps_range Aec_Error invalid input 414 
2018-12-13 18:10:10.461 785-1278/? E/CamX: [ERROR][STATS_AEC] camxcaecstatsprocessor.cpp:1628 SetAlgoBayerHistValue() Unsupported bayer hist channel!
2018-12-13 18:10:10.461 785-1278/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3151 ProcessRequestFastAE() [FastAE] Failed to apply gain to the stats!
2018-12-13 18:10:10.461 785-1278/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:1229: aec_process_stats_parsing aec is null or invalid
2018-12-13 18:10:10.461 785-1278/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:7977: aec_process_preview_and_video Error: invalid stats
2018-12-13 18:10:10.465 785-1276/? E/CamX: [ERROR][STATS  ] gcamfastaestats.cpp:80 Create() [FastAE] Failed to create the FastAEStats object
2018-12-13 18:10:10.465 785-1276/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3137 ProcessRequestFastAE() [FastAE] ISP gain calculation failed!
2018-12-13 18:10:10.465 785-1276/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3151 ProcessRequestFastAE() [FastAE] Failed to apply gain to the stats!
2018-12-13 18:10:10.465 785-1276/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:1229: aec_process_stats_parsing aec is null or invalid
2018-12-13 18:10:10.465 785-1276/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:7977: aec_process_preview_and_video Error: invalid stats
2018-12-13 18:10:10.468 785-1275/? E/CamX: [ERROR][STATS  ] gcamfastaestats.cpp:80 Create() [FastAE] Failed to create the FastAEStats object
2018-12-13 18:10:10.468 785-1275/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3137 ProcessRequestFastAE() [FastAE] ISP gain calculation failed!
2018-12-13 18:10:10.468 785-1275/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3151 ProcessRequestFastAE() [FastAE] Failed to apply gain to the stats!
2018-12-13 18:10:10.469 785-1275/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:1229: aec_process_stats_parsing aec is null or invalid
2018-12-13 18:10:10.469 785-1275/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:7977: aec_process_preview_and_video Error: invalid stats
2018-12-13 18:10:10.471 785-1279/? E/CamX: [ERROR][STATS  ] gcamfastaestats.cpp:80 Create() [FastAE] Failed to create the FastAEStats object
2018-12-13 18:10:10.471 785-1279/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3137 ProcessRequestFastAE() [FastAE] ISP gain calculation failed!
2018-12-13 18:10:10.471 785-1279/? E/CamX: [ERROR][STATS  ] camxcaecstatsprocessor.cpp:3151 ProcessRequestFastAE() [FastAE] Failed to apply gain to the stats!
2018-12-13 18:10:10.471 785-1279/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:1229: aec_process_stats_parsing aec is null or invalid
2018-12-13 18:10:10.471 785-1279/? E/CamX: [ERROR][STATS_AEC] aec_process.cpp:7977: aec_process_preview_and_video Error: invalid stats
2018-12-13 18:10:10.577 785-1278/? E/CamX: [ERROR][CORE   ] camxnode.cpp:2107 GetDataCountFromPipeline() Attempting to get metadata count for tag a04f0005 when unpublished
2018-12-13 18:10:10.798 785-1275/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:984 GetEXIFExposure() ASD Output:NULL
2018-12-13 18:10:12.628 799-2141/? E/libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq with value: 1996800, fd: 19
2018-12-13 18:10:16.378 785-1277/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:984 GetEXIFExposure() ASD Output:NULL
2018-12-13 18:10:16.412 785-1279/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:984 GetEXIFExposure() ASD Output:NULL
2018-12-13 18:10:16.444 785-1277/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:984 GetEXIFExposure() ASD Output:NULL
2018-12-13 18:10:16.510 785-1278/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:984 GetEXIFExposure() ASD Output:NULL
2018-12-13 18:10:16.589 785-1275/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.589 785-1275/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.591 785-1275/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.591 785-1275/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.595 785-1278/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.596 785-1278/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.597 785-1279/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.597 785-1279/? E/CamX: [ERROR][HAL    ] camxmetadatapool.cpp:1447 GetMetadataByTag() Invalid Slot to get a metadata from
2018-12-13 18:10:16.598 785-1279/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:970 GetEXIFExposure() AEC Exposure Info:NULL
2018-12-13 18:10:16.598 785-1279/? E/CamX: [ERROR][JPEG   ] camxjpegexifparams.cpp:984 GetEXIFExposure() ASD Output:NULL
2018-12-13 18:10:18.144 799-2141/? E/libperfmgr: Failed to write to node: /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq with value: 1996800, fd: 19
2018-12-13 18:10:21.512 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.changepixelformat"
2018-12-13 18:10:21.568 902-1139/? E/fpc_tac: fpc_irq_wait_reset error FPC_ERROR_CANCELLED
2018-12-13 18:10:21.629 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.695 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.712 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.762 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.779 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.795 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.812 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.828 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.846 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.861 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.913 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.928 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.961 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:21.980 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:22.078 1164-1234/? E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
2018-12-13 18:10:22.481 785-1284/? E/native: easel_manager_callback.cc:35 COMMAND_PROCESSOR_3PA on easel exited0
2018-12-13 18:10:22.716 797-2626/? E/NxpTml: _i2c_write() errno : 5
2018-12-13 18:10:22.716 797-2626/? E/NxpTml: PN54X - Error in I2C Write.....
2018-12-13 18:10:22.716 797-2628/? E/NxpHal: write error status = 0x1ff
2018-12-13 18:10:22.716 797-797/? E/NxpHal: write_unlocked failed - PN54X Maybe in Standby Mode - Retry
2018-12-13 18:10:22.737 2506-2506/? E/libnfc_nci: [ERROR:NativeNfcTag.cpp(801)] nativeNfcTag_doDisconnect: tag already deactivated
2018-12-13 18:10:22.769 13831-13831/? E/roid.apps.scon: Not starting debugger since process cannot load the jdwp agent.
2018-12-13 18:10:22.772 2565-2565/? E/LibSecureUISvc: svc_sock_send_message(suisvc): invalid remote socket suitch
2018-12-13 18:10:22.772 2565-2565/? E/LibSecureUISvc: svc_sock_send_message(suisvc): invalid remote socket suilst
@frogermcs

This comment has been minimized.

Copy link

commented Dec 13, 2018

XML

<com.camerakit.CameraKitView
    android:id="@+id/cameraView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center|top"
    android:adjustViewBounds="true"
    app:camera_aspectRatio="1" />

Implementation:

public class MainActivity extends ClassifierActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        cameraView = findViewById(R.id.cameraView);
    }

    @Override
    protected void onStart() {
        super.onStart();
        cameraView.onStart();
    }

    @Override
    protected void onResume() {
        super.onResume();
        cameraView.onResume();
    }

    @Override
    protected void onPause() {
        cameraView.onPause();
        super.onPause();
    }

    @Override
    protected void onStop() {
        cameraView.onStop();
        super.onStop();
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        cameraView.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }


    public void onDetectClick(View v) {
        cameraView.captureImage((cameraKitView, picture) -> onNewImageByteArray(picture));
    }

    public void onNewImageByteArray(byte[] pictureBytesArray) {
        //...
    }
}
@MaximeMaravalLunabee

This comment has been minimized.

Copy link

commented Dec 20, 2018

Same problem here.
After import the library as module in my project, I finally avoid this issue by change

@Synchronized
    override fun capturePhoto(callback: (jpeg: ByteArray) -> Unit) {
        this.photoCallback = callback

        if (cameraFacing == CameraFacing.BACK) {
            lockFocus()
        } else {
            captureStillPicture()
        }
    }

by

@Synchronized
    override fun capturePhoto(callback: (jpeg: ByteArray) -> Unit) {
        this.photoCallback = callback

        if (cameraFacing == CameraFacing.BACK) {
            captureStillPicture()
        } else {
            captureStillPicture()
        }
    }

in Camera2.kt, but this is clearly not a good solution.

Any news @emersoncloud ?
Thanks

@UmarBhutta

This comment has been minimized.

Copy link
Author

commented Dec 20, 2018

ezgif-4-cde1b1db8db6
@emersoncloud it is happening on Samsung J7 pro.

My implementation is simple that is

mCameraView!!.captureImage { cameraKitView, bytes ->
handleImageCaptureCalls(bytes)
}

and xml is
<com.camerakit.CameraKitView
android:id="@+id/camera"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="0dp"
android:adjustViewBounds="true"
android:background="@color/colorPrimaryDark"
android:clickable="false"
android:keepScreenOn="true"
app:camera_aspectRatio="1"
app:camera_facing="back"
app:camera_flash="auto"
app:camera_focus="continuous"
app:camera_imageMegaPixels="3.2"
app:camera_permissions="camera"
app:camera_zoomFactor="1.2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

</com.camerakit.CameraKitView>

while version i am using is
implementation 'com.camerakit:camerakit:1.0.0-beta3.10'
implementation 'com.camerakit:jpegkit:0.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'

can you guide me how to solve it

@emersoncloud emersoncloud reopened this Dec 21, 2018

@DummyCo

This comment has been minimized.

Copy link

commented Dec 22, 2018

Same here, Pixel XL, Android 9

versions.camerakit_library = "1.0.0-beta3.10"
versions.camerakit_jpegkit = "0.1.0"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <com.camerakit.CameraKitView
            android:id="@+id/cameraKitView"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:adjustViewBounds="true"
            android:keepScreenOn="true"
            app:camera_flash="auto"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:camera_facing="back"
            app:camera_focus="continuous"
            app:camera_permissions="camera"/>
</androidx.constraintlayout.widget.ConstraintLayout>
build_versions.min_sdk = 19
build_versions.target_sdk = 28
build_versions.compile_sdk = 28
@huntj88

This comment has been minimized.

Copy link

commented Feb 7, 2019

@UmarBhutta my experience lines up with your video

ezgif-4-cde1b1db8db6

This is what I was seeing



@Synchronized
    override fun capturePhoto(callback: (jpeg: ByteArray) -> Unit) {
        this.photoCallback = callback

        if (cameraFacing == CameraFacing.BACK) {
            captureStillPicture()
        } else {
            captureStillPicture()
        }
    }

in Camera2.kt, but this is clearly not a good solution.

@MaximeMaravalLunabee I think my fix also fixes what you were doing



kinda fixed #504

@emersoncloud
what do you think?

@glenatron

This comment has been minimized.

Copy link

commented Feb 21, 2019

That CaptureStillImage from both the front and back camera fixes this problem for me also, but I assume there is a good reason it isn't supposed to work that way. Looks like when lockFocus is called it's getting through to the captureCallback.process section going down the STATE_WAITING_LOCK path and in a situation where the afState is neither null, nor one of the focused_locked variants it hit the first waitingFrames++ and then never seemed to re-enter the callback.

Interestingly when I closed my phone screen the callback immediately got triggered repeatedly, first resulting in ramping up the waitingFrames count until that triggered captureStillPicture() and then continuing to be called afterwards, looping now endlessly through the runPreCaptureSequence cycle in a way I would expect to eat through battery. Could it be that it is trying to run the preview and that somehow blocks this callback?

@gerdablum

This comment has been minimized.

Copy link

commented Feb 27, 2019

same issue on Nokia 7 plus (Android 9). With the code below the callback is triggered very randomly:

(camerakit:1.0.0-beta3.11, jpegkit:0.1.0)

 override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_camera)
    camera_kit_view.focus = CameraKit.FOCUS_AUTO
    capture_fab.setOnClickListener {
        camera_kit_view.captureImage(object: CameraKitView.ImageCallback {
            override fun onImage(p0: CameraKitView?, byteImage: ByteArray?) {
                Toast.makeText(this@CameraScanActivity,"You captured an image!", Toast.LENGTH_LONG).show()
                scanQRCode(byteImage);
            }
        })
    }
}
@Rottinson

This comment has been minimized.

Copy link

commented Feb 28, 2019

Same issue on Xiaomi 8, Android 9. This problem occurs after a few normal calls. Once the callback is not called, it will never be called again unless you re-enter the app.
(camerakit:1.0.0-beta3.11, jpegkit:0.1.0)

XML:

<com.camerakit.CameraKitView
        android:id="@+id/main_camerakitview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:keepScreenOn="true"
        app:camera_facing="back"
        app:camera_flash="auto"
        app:camera_focus="continuous"
        app:camera_permissions="camera">
</com.camerakit.CameraKitView>

Java code:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        cameraKitView = findViewById(R.id.main_camerakitview);
        takephotoButton = findViewById(R.id.main_takephotobutton);
        takephotoButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                cameraKitView.captureImage(new CameraKitView.ImageCallback() {
                    @Override
                    public void onImage(CameraKitView cameraKitView, byte[] bytes) {
                        Bitmap capturedBitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
                        capturedImageView.setImageBitmap(capturedBitmap);
                        String resultString = runModel(capturedBitmap);
                        resultTextView.setText(initialCapital(resultString));
                        progressBar.setVisibility(View.GONE);
                    }
                });
            }
        });
@azwar

This comment has been minimized.

Copy link

commented Mar 13, 2019

Any update about this issue? I have the same problem.

@theFrantic

This comment has been minimized.

Copy link

commented Mar 15, 2019

As far as I see there is a Pull Request to solve this problem...

#498

When will be available a release with this?

@austinkettner

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

We are not ignoring this, and plan to be back in touch by next week. This is one of our biggest bugs we plan to resolve. Thanks for the healthy discussion around this!

@theFrantic

This comment has been minimized.

Copy link

commented Mar 15, 2019

Very nice, thank you for the update and also for the great work, this library is great!

@Tsabary

This comment has been minimized.

Copy link

commented Apr 9, 2019

Same here, capture Image is called very randomly OnePlus 5t

@prikshit-hora

This comment has been minimized.

Copy link

commented Apr 19, 2019

Hi any updates on this issue

@ggfan

This comment has been minimized.

Copy link

commented Apr 19, 2019

sorry to ask, is this one already fixed in 3.12-expensify?

@alexcutovoi

This comment has been minimized.

Copy link

commented Apr 23, 2019

I have the same issue on HMD devices. Specifically HMD Global TA-1052.
Android 9.

@fabio-delorenzo-wowza

This comment has been minimized.

Copy link

commented May 17, 2019

same issue

@pecet66

This comment has been minimized.

Copy link

commented May 23, 2019

Samsung Galaxy S8, Android 9 - same issue.

@BeaYeah

This comment has been minimized.

Copy link

commented May 28, 2019

Same problem here.
After import the library as module in my project, I finally avoid this issue by change

@Synchronized
    override fun capturePhoto(callback: (jpeg: ByteArray) -> Unit) {
        this.photoCallback = callback

        if (cameraFacing == CameraFacing.BACK) {
            lockFocus()
        } else {
            captureStillPicture()
        }
    }

by

@Synchronized
    override fun capturePhoto(callback: (jpeg: ByteArray) -> Unit) {
        this.photoCallback = callback

        if (cameraFacing == CameraFacing.BACK) {
            captureStillPicture()
        } else {
            captureStillPicture()
        }
    }

in Camera2.kt, but this is clearly not a good solution.

Any news @emersoncloud ?
Thanks

¿How did you manage to import the library as a module?

@jjames19951

This comment has been minimized.

Copy link

commented Jun 21, 2019

Same issue here, very frustrating and I can't seem to find a way around it

@Twinsens

This comment has been minimized.

Copy link

commented Jun 25, 2019

Any updates for this issue?

@roya90

This comment has been minimized.

Copy link

commented Jun 26, 2019

I have the same issue with Samung S7.

@leoassuncao

This comment has been minimized.

Copy link

commented Jun 26, 2019

Same issue here with Samsung S10.
Any updates about it?

@roya90

This comment has been minimized.

Copy link

commented Jun 26, 2019

I think it might be because of the type of threading for me. I called it within asynctask, I'm trying to use Handler instead.

@marcosdecris

This comment has been minimized.

Copy link

commented Jun 27, 2019

Same here Samsung S6

@roya90

This comment has been minimized.

Copy link

commented Jun 27, 2019

It works with Handler

@marcosdecris

This comment has been minimized.

Copy link

commented Jun 27, 2019

@roya90 Can you show an exaple please?

@roya90

This comment has been minimized.

Copy link

commented Jun 27, 2019

I changed back to using the regular camera, but I found this link very helpful. https://www.youtube.com/watch?v=adPLIAnx9og

@alxgord

This comment has been minimized.

Copy link

commented Jul 1, 2019

Essential Phone PH-1
Android 10
camerakit:1.0.0-beta3.11
same issue

@austinkettner austinkettner self-assigned this Jul 5, 2019

@jamolkhon

This comment has been minimized.

Copy link

commented Jul 19, 2019

Downgrading to beta3.10 worked for me.

@jalacardio

This comment has been minimized.

Copy link

commented Jul 20, 2019

Downgrading to beta3.10 worked for me.

Same, it works on my emulator now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.