this is a little pain in the ass lately for me. Some of the devices on which I'm running my app, are getting this error.
Basically, application starts recording, goes to background. When app is being brought to front, it should perform mediarecorder.stop() and restart recording. Somehow, some of the devices have problem with this. In those situations, I'm getting black screen and "timed out waiting for incoming camera video frames" message. Camera is locked and can't be used anymore even when I kill the app.
Would appreciate any help with this. I'm trying to figure it out for a week now.
@Override
public void onPause() {
editor.putInt("checkBackground", 1);
editor.commit();
if (inRecord){
editor.putInt("autoResume", 1);
editor.commit();
}
if (inPreview){
if (camera != null) {
camera.stopPreview();
camera.setPreviewCallback(null);
camera.release();
camera = null;
}
inPreview = false;
gpsManager.stopListening();
}
super.onPause();
}
After some investigation, while app is going to background, I'm getting below messages in LogCat.
WORKING VERSION
08-13 12:30:16.245: E/BufferQueue(1684): [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!
08-13 12:30:16.245: E/CameraHal(1705): ExtIsp ! CameraFillBufferDone dequeueNativeBuffer failed vendor/st-ericsson/variant/hardware/libcamera/STEExtIspInternal.cpp:836
HANGING VERSION WITH BLACK SCREEN
08-13 12:12:01.385: E/BufferQueue(104): [SurfaceView] queueBuffer: SurfaceTexture has been abandoned!
08-13 12:12:01.385: E/SurfaceTextureClient(107): queueBuffer: error queuing buffer to SurfaceTexture, -19
08-13 12:12:01.385: E/CameraHAL(107): Surface::queueBuffer returned error -19
08-13 12:12:01.385: E/BufferQueue(104): [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!
08-13 12:12:01.385: E/CameraHAL(107): (41b7c548) hardware/ti/omap4xxx/camera/espresso/ANativeWindowDisplayAdapter.cpp:1199 handleFrameReturn - dequeueBuffer failed: No such device (19)