AnsweredAssumed Answered

OV5640 camera HAL v2 stability issue on IMX6  Android4.2 and Android4.3 BSP

Question asked by Lake hu on Dec 18, 2014
Latest reply on Jan 3, 2016 by wang zhigang

We use OV sensor in Freescale IMX6D for camera application.

It seems the BSP may be out of memory when we run any OpenCV camera application.

 

We have 1G memory and the same OpenCV application runs OK on other Android 4.2/4.3 platforms.

 

For Freescale BSP Android4,2/4.3, it will not say out of memory until 2~3 hours.

 

If we change the BSP to HAL camera API version1, everything is OK.

 

I am wondering if Freescale BSP camera API version2/HAP implementation has bug.

 

Though BSP says out of memory, the GUI operation is still OK.

 

Attach the whole log and test APKs.

 

Thank

 

 

Part of log for memory issue.  (Whole log, please refer to the zip file attached).

 

 

D/CameraBridge( 3083): mStretch value: 1.0

D/JavaCameraView( 3083): Preview Frame received. Frame size: 460800

I/OCVSample::Activity( 3083): onCameraFrame callback

D/JavaCameraView( 3083): Preview Frame received. Frame size: 460800

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- end handling imageSeparateDetecting

I/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- objects num==0, t_ms=150.5023

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- next step

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- before waiting

D/JavaCameraView( 3083): Preview Frame received. Frame size: 460800

D/JavaCameraView( 3083): Preview Frame received. Frame size: 460800

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: time from the previous call is 294.618333 ms

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: shouldCommunicateWithDetectingThread=1

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: lastBigDetectionDuration=294.090334 ms

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: shouldSendNewDataToWorkThread was 1, now it is 1, since time_from_previous_launch_in_ms=294.18, minDetectionPeriod=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- after waiting

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- start handling imageSeparateDetecting, img.size=640x480, img.data=0x0x631ef010

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: result: shouldHandleResult=1

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: get _rectsWhereRegions were got from resultDetect

I/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: tracked objects num==0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: rectsWhereRegions.size()=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: detectedObjectsInRegions.size()=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::updateTrackedObjects: N1=0, N2=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::updateTrackedObjects: start second cycle

D/CameraBridge( 3083): mStretch value: 1.0

D/JavaCameraView( 3083): Preview Frame received. Frame size: 460800

E/Camera2-Device( 2218): setStreamSlot: Unable to clone metadata buffer!

I/OCVSample::Activity( 3083): onCameraFrame callback

E/Camera2-StreamingProcessor( 2218): startStream: Camera 0: Unable to set preview request to start preview: Out of memory (-12)

E/Camera2 ( 2218): startPreviewL: Camera 0: Unable to start streaming preview: Out of memory (-12)

E/Camera2 ( 2218): setPreviewCallbackFlagL: Camera 0: Unable to refresh request in state STOPPED

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- end handling imageSeparateDetecting

I/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- objects num==0, t_ms=135.7310

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- next step

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- before waiting

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: time from the previous call is 207.972667 ms

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: shouldCommunicateWithDetectingThread=1

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: lastBigDetectionDuration=207.215334 ms

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: shouldSendNewDataToWorkThread was 1, now it is 1, since time_from_previous_launch_in_ms=207.23, minDetectionPeriod=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- after waiting

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- start handling imageSeparateDetecting, img.size=640x480, img.data=0x0x631ef010

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::communicateWithDetectingThread: result: shouldHandleResult=1

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: get _rectsWhereRegions were got from resultDetect

I/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: tracked objects num==0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: rectsWhereRegions.size()=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::process: detectedObjectsInRegions.size()=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::updateTrackedObjects: N1=0, N2=0

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::updateTrackedObjects: start second cycle

D/CameraBridge( 3083): mStretch value: 1.0

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- end handling imageSeparateDetecting

I/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- objects num==0, t_ms=86.7770

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- next step

D/OBJECT_DETECTOR( 3083): DetectionBasedTracker::SeparateDetectionWork::workcycleObjectDetector() --- before waiting

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

E/FslCameraHAL2( 2218): handleRequest: dequeue_frame failed

Original Attachment has been moved to: Edge-Camera-Test-Edge1.0-Edge2.x-Android4.2-4.3.zip

Outcomes