OpenCV_NativeCamera: startPreview() fails on Nexus 5 (Android, Kitkat)
Hello,
I've got one issue with Nexus5. I have one project with native access to camera. It works properly on SGS+ (Android 2.3.6), but id does not on Kitkat on Nexus 5.
I tried it also with OpenCV Sample - native-activity, and I receive the same error:
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Cameras: (null)
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Picture Sizes: 3264x2448,3200x2400,2592x1944,2048x1536,1920x1080,1600x1200,1280x960,1280x768,1280x720,1024x768,800x600,800x480,720x480,640x480,352x288,320x240,176x144
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Picture Formats: jpeg
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Preview Sizes: 1920x1080,1280x960,1280x768,1280x720,1024x768,800x600,800x480,720x480,640x480,352x288,320x240,176x144
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Preview Formats: yuv420p,yuv420sp,
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Preview Frame Rates: 15,24,30
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Thumbnail Sizes: 512x288,480x288,256x154,432x288,320x240,176x144,0x0
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Whitebalance Modes: auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight,twilight,shade
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Effects: none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Scene Modes: auto,landscape,snow,beach,sunset,night,portrait,sports,steadyphoto,candlelight,fireworks,party,night-portrait,theatre,action
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Focus Modes: infinity,auto,macro,continuous-video,continuous-picture
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Antibanding Options: off,60hz,50hz,auto
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Flash Modes: off,auto,on,torch,red-eye
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): initCameraConnect: autofocus is set to mode "continuous-video"
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): initCameraConnect: preview format is set to yuv420sp
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Starting preview
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): Preview started successfully
03-20 11:37:31.352: E/OpenCV::camera(3293): calling (*pGetPropertyC)(0x74ddef50, 2)
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::getProperty(2)
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::setProperty(0, 1280.000000)
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::setProperty(1, 720.000000)
03-20 11:37:31.352: I/OCV:libnative_activity(3293): >>>>>Camera initialized at resolution 1280x720
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::applyProperties()
03-20 11:37:41.362: E/OpenCV_NativeCamera(3293): applyProperties: failed setPreviewTexture call; camera might not work correctly
03-20 11:37:41.362: D/OpenCV_NativeCamera(3293): Starting preview
03-20 11:37:46.362: E/OpenCV_NativeCamera(3293): initCameraConnect: startPreview() fails. Closing camera connection...
Is there anything I can do with this?
After update to 2.4.9 it still fails, but in another way: I/OCV:libnative_activity(6144): Camera initialized at resolution 640x480 D/OpenCV_NativeCamera(6144): CameraHandler::applyProperties() E/OpenCV_NativeCamera(6144): applyProperties: failed setPreviewTexture call; camera might not work correctly D/OpenCV_NativeCamera(6144): Starting preview D/OpenCV_NativeCamera(6144): Preview started successfully E/OpenCV::camera(6144): calling (pGetPropertyC)(0x76407a60, 0) D/OpenCV_NativeCamera(6144): CameraHandler::getProperty(0) E/OpenCV::camera(6144): calling (pGetPropertyC)(0x76407a60, 1) D/OpenCV_NativeCamera(6144): CameraHandler::getProperty(1)
Blank screen on Nexus, and it is extremely hard to kill the app.
Hello There... I also seeing the same issue in Android 4.4.2. The native camera fails with follwing text in app_error.txt: "
backtrace: #00 pc 00026306 /system/lib/libgui.so (android::BufferQueue::releaseBuffer(int, unsigned long long, void, void, android::sp<android::fence> const&)+141) #01 pc 00018455 /data/app-lib/com.apptouch-1/libnative_camera_r4.4.0.so (CameraHandler::initCameraConnect(bool (* const&)(void, unsigned int, void), int, void, android::CameraParameters)+1948)
" Has any one got this issue resolved. Is there setting in buffer memory to be done in kernel. Hope to hear positively!