libnative_camera crash on Android 4.4.2
It seems that most of the Android 4.4.2 devices are not compatible with libnative_camera. My NativeActivity app is crashing with the following backtrace:
#00 pc 000253b2 /system/lib/libgui.so (android::BufferQueue::setCurrentDirtyRegion(int)+37)
#01 pc 00018439 /data/app-lib/nightradio.phonopaper-1/libnative_camera_r4.4.0.so (CameraHandler::initCameraConnect(bool (* const&)(void*, unsigned int, void*), int, void*, android::CameraParameters*)+1936)
or
#00 pc 00026578 /system/lib/libgui.so (android::BufferQueue::releaseBuffer(int, unsigned long long, void*, void*, android::sp<android::Fence> const&)+143)
#01 pc 00018439 /data/app-lib/nightradio.phonopaper-1/libnative_camera_r4.4.0.so (CameraHandler::initCameraConnect(bool (* const&)(void*, unsigned int, void*), int, void*, android::CameraParameters*)+1936)
Please can anyone build the libnative_camera_r4.4.2?
I have managed to build the 4.4.0 version for 4.4.2. It doesn't crash anymore, preview seems to start fine, but data callbacks are not called. I'll try to get this to work. Alexander Smorkalov, if you see this, have you attempted to get 4.4.2 working?
After unsuccessfully hacking on 4.4.2 for a few days, I decided to downgrade to 4.4.0. Only to find out that native camera doesn't work for me on 4.4.0 Nexus 5 either. Same problem as here: http://answers.opencv.org/question/30311/opencv_nativecamera-startpreview-fails-on-nexus-5/
Figured out why callbacks were not called on 4.4.2. I'm building a native executable instead of a shared library. Turns out that in such case I'm responsible for creating a binder thread: IPCThreadState::self()->joinThreadPool(). Otherwise when mediaserver tried to communicate with preview BufferQueue, it just hanged because nothing was handling the request. Anyways, now both 4.4.0 and 4.4.2 still have the problem I referred to in the previous comment.
Hello There... I also seeing the same issue in Android 4.4.2.
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!