OpenCV Native Activity crashes on Google glass (Bug #3808)


Added by Shakith Fernando over 10 years ago. Updated over 9 years ago.


Status:Open Start date:2014-07-12
Priority:Normal Due date:
Assignee:Daniil Osokin % Done:

0%

Category:android
Target version:-
Affected version:2.4.9 (latest release) Operating System:Android
Difficulty: HW Platform:ARM
Pull request:

Description

When running the OpenCV Native Activity, it gives a a fatal error. My device is google glass 18.11 with Android 4.4.2. More details here. http://answers.opencv.org/question/36862/getting-the-camera-to-work-with-opencv-native/.

07-10 22:35:27.694: D/OpenCV::camera(1818): Libraries folder found: /data/app-lib/org.opencv.engine-1/
07-10 22:35:27.694: D/OpenCV::camera(1818): CameraWrapperConnector::connectToLib: folderPath=/data/app-lib/org.opencv.engine-1/
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r4.3.0.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r4.0.3.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r4.4.0.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r2.3.3.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r4.2.0.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r2.2.0.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r4.0.0.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r4.1.1.so
07-10 22:35:27.694: E/OpenCV::camera(1818): ||libnative_camera_r3.0.1.so
07-10 22:35:27.694: D/OpenCV::camera(1818): try to load library 'libnative_camera_r4.4.0.so'
07-10 22:35:27.717: D/OpenCV::camera(1818): Loaded library '/data/app-lib/org.opencv.engine-1/libnative_camera_r4.4.0.so'
07-10 22:35:27.717: D/OpenCV_NativeCamera(1818): CameraHandler::initCameraConnect(0x5a839f5d, 0, 0x5ac1df20, 0x0)
07-10 22:35:27.717: D/OpenCV_NativeCamera(1818): Current process name for camera init: org.opencv.samples.NativeActivity
07-10 22:35:27.858: D/OpenCV_NativeCamera(1818): Instantiated new CameraHandler (0x5a839f5d, 0x5ac1df20)
07-10 22:35:27.858: I/OpenCV_NativeCamera(1818): initCameraConnect: [antibanding=auto;antibanding-values=off,auto,50hz,60hz;auto-convergence-mode=frame;auto-convergence-mode-values=;auto-exposure-lock=false;auto-exposure-lock-supported=true;auto-whitebalance-lock=false;auto-whitebalance-lock-supported=true;awb-damping=false;brightness=50;camera-name=S5K4E1GA;contrast=100;current-iso=100;effect=none;effect-values=none,negative,solarize,sepia,mono,natural,vivid,color-swap,blackwhite,whiteboard,blackboard,aqua,posterize;exif-image-description=;exif-make=Google;exif-model=Glass 1;exif-software=Glass-1 XE18.11 1223935;exposure=auto;exposure-compensation=0;exposure-compensation-step=0.1;exposure-mode-values=manual,auto,night,backlighting,spotlight,sports,snow,beach,aperture,small-aperture;flash-mode=off;flash-mode-values=off;focal-length=2.95;focus-mode=infinity;focus-mode-values=infinity;gbce=false;gbce-supported=true;glbce=false;glbce-supported=true;horizontal-view-angle=54.8;ipp=ldc-nsf;ipp-values=off,ldc,nsf,
ldc-nsf;iso=auto;iso-mode-values=auto,100,200,400,
07-10 22:35:27.858: D/OpenCV_NativeCamera(1818): Supported Cameras: (null)
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Picture Sizes: 2592x1944,2560x1888,2528x1856,2592x1728,2592x1458,2560x1888,2400x1350,2304x1296,2240x1344,2160x1440,2112x1728,2112x1188,2048x1152,2048x1536,2016x1512,2016x1134,2000x1600,1920x1080,1600x1200,1600x900,1536x864,1408x792,1344x756,1296x972,1280x1024,1280x720,1152x864,1280x960,1024x768,1024x576,640x480,320x240
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Picture Formats: unused,yuv420sp,yuv420p,yuv422i-yuyv,rgb565,bayer-rggb,jpeg
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Preview Sizes: 1920x1080,1280x960,1280x720,1024x768,1024x576,960x720,800x480,768x576,720x576,720x480,768x576,640x480,640x368,640x360,512x384,512x288,416x304,416x240,352x288,320x240,320x192,256x144,240x160,224x160,176x144,160x120,128x96,960x1280,720x1280,768x1024,576x1024,720x960,480x800,576x768,576x720,576x768,480x720,480x640,368x640,384x512,288x512,304x416,240x416,288x352,240x320,192x320,144x256,160x240,160x224,144x176,120x160,96x128
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Preview Formats: yuv420sp,yuv420p,yuv422i-yuyv,yuv420p
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Preview Frame Rates: 5,10,15,20,24,30,60
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Thumbnail Sizes: 640x480,160x120,200x120,320x240,512x384,352x144,176x144,96x96,0x0
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Whitebalance Modes: auto,daylight,cloudy-daylight,tungsten,fluorescent,incandescent,horizon,sunset,shade,twilight,warm-fluorescent
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Effects: none,negative,solarize,sepia,mono,natural,vivid,color-swap,blackwhite,whiteboard,blackboard,aqua,posterize
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Scene Modes: auto,closeup,landscape,aqua,sports,mood,night-portrait,night-indoor,fireworks,document,barcode,super-night,cine,old-film,action,beach,candlelight,night,party,portrait,snow,steadyphoto,sunset,theatre
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Focus Modes: infinity
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Antibanding Options: off,auto,50hz,60hz
07-10 22:35:27.866: D/OpenCV_NativeCamera(1818): Supported Flash Modes: off
07-10 22:35:27.881: D/OpenCV_NativeCamera(1818): initCameraConnect: preview format is set to yuv420sp
07-10 22:35:27.889: D/OpenCV_NativeCamera(1818): initCameraConnect: preview format is set to 640x480
07-10 22:35:27.889: A/libc(1818): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1885 (.NativeActivity)


logcat.txt - Logcat (6.4 kB) Shakith Fernando, 2014-07-17 01:45 am

camera_wrapper.cpp (40.9 kB) Shakith Fernando, 2014-07-17 01:45 am

crash.log - Detailed crashlog (39.8 kB) Shakith Fernando, 2014-07-17 08:34 am


Related issues

related to Bug #3542: Native-activity sample crashes on GalaxyS3 Android 4.3 Done 2014-02-13
related to Bug #2359: Native camera does not work on HTC One S with Android ICS... Open 2012-09-17
related to Bug #3792: Native Camera not working with Sony Xperia Z running Andr... Open 2014-07-04
duplicated by Bug #3706: CvNativeActivity sample does not work on Google Glass New 2014-05-22

Associated revisions

Revision a9ce2333
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3808 from guopei:patch-2

History

Updated by Daniil Osokin over 10 years ago

Hi Shakith, thanks for response! However, we don't have any google glasses to debug and fix this. If you can help with debigging, we can try to fix it.

  • Assignee set to Shakith Fernando
  • Category set to android

Updated by Shakith Fernando over 10 years ago

Thanks Daniil. Yes. I can help to debug. Let me know what needs to be tested.
First thing I tried was to increase MAGIC_TAIL number assuming it is a memory access violation. That didn't help.
#define MAGIC_TAIL 16384 //from 4096

Updated by Shakith Fernando over 10 years ago

Shakith Fernando wrote:

Thanks Daniil. Yes. I can help to debug. Let me know what needs to be tested.
First thing I tried was to increase MAGIC_TAIL number assuming it is a memory access violation. That didn't help.
#define MAGIC_TAIL 16384 //from 4096

Update-
This hasn't been verified as it seems the native camera library with opencv manager is always being loaded instead of the native camera library with application apk that gets added using jni and android.mk. How to force application to use the library I recompiled? Seems to be fixed by setdefaultpathlib it seems in camera activity file. I am trying to create a debugging environment to test changes and recompile the native camera library.

Updated by Shakith Fernando over 10 years ago

I have created debug environment to recompile the camera_wrapper and test native_camera* lib with the native activity application on the google glass.
The fatal error is pinpointed to line 694 in camera_wrapper.cpp. See attached logcat and attached camera_wrapper.cpp . MAGIC_TAIL is 16384.

Any suggestions to start?
Maybe a null check of handler->queue and handler->listener?

Updated by Shakith Fernando over 10 years ago

Shakith Fernando wrote:

I have created a debug environment to recompile the camera_wrapper and test native_camera* lib with the native activity application on the google glass.
The fatal error is pinpointed to line 694 in camera_wrapper.cpp. See attached logcat and attached camera_wrapper.cpp . MAGIC_TAIL is 16384.

Any suggestions to start?
Maybe a null check of handler->queue and handler->listener?

Updated by Shakith Fernando over 10 years ago

Here is the detailed logcat output.

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4786

Also available in: Atom PDF