2016-04-21 16:31:19 -0600 | received badge | ● Popular Question (source) |
2014-02-26 15:19:04 -0600 | received badge | ● Student (source) |
2014-01-15 16:10:44 -0600 | asked a question | Why does using VideoCapture on android when the screen is off causes the camera to lock until rebooted? I am using OpenCV 2.4.8 and I am trying to make an Android Application that uses the camera in the background when the screen is off. However, when ever I try to use VideoCapture in a Service, the camera becomes locked and the only way to recover is to reboot your device. To reproduce this problem, I created a dummy service that takes 200 frames every 5 minutes and does nothing with them. If I run the Service with the screen on, it works fine. If the phone is plugged into my computer and I am monitoring logcat, it does not lock even if the screen is off. However if I run it with the screen off and not debugging on my computer, the camera will eventually freeze or the phone with reboot. This is true if I replace VideoCapture with android.hardware.Camera too. Is there something in Android or the camera drivers that prevents the camera from being used if the screen is off? I've tried it on the following devices and it locks RAZR M (this one locks the fastest) Nexus 7 Gen 2 Samsung Galaxy Note 3 Asus Transformer TF700 It does not lock on Samsung Galaxy S3 SGH-T999 TMobile with 4.3, but it did before the 4.3 update Below is the logcat for OpenCV with a bad camera get OpenCV_NativeCamera: Connecting to CameraService v 2.3 OpenCV_NativeCamera: initCameraConnect: Unable to connect to CameraService OpenCV::camera: CameraWrapperConnector::connectWrapper ERROR: the initializing function returned false OpenCV::camera: Native_camera returned opening error: 6 (more) |