Fixed
Status Update
Comments
se...@gmail.com <se...@gmail.com> #2
To make life even more bizarre, I ran into another situation where camera.open()
worked in the sense that it didn't hang as in the previous example, but a following
camera.setParameters() did hang:
Log.i("OIC", "JUNKcam5");
try { camera.setParameters(parameters); }
catch (Exception e) { Log.e("OIC", e.getMessage(), e); }
Log.i("OIC", "JUNKcam6");
then only gave as output
JUNKcam5
In this case too, the built-in camera app would just hang with a black screen, and I
had to power off the phone to get back.
Regards
worked in the sense that it didn't hang as in the previous example, but a following
camera.setParameters() did hang:
Log.i("OIC", "JUNKcam5");
try { camera.setParameters(parameters); }
catch (Exception e) { Log.e("OIC", e.getMessage(), e); }
Log.i("OIC", "JUNKcam6");
then only gave as output
JUNKcam5
In this case too, the built-in camera app would just hang with a black screen, and I
had to power off the phone to get back.
Regards
jb...@google.com <jb...@google.com> #3
This issue is assigned to an engineer for further evaluation
se...@gmail.com <se...@gmail.com> #4
Great. I still regularly run into this problem while developing my camera app, say
once or twice a day. It looks a bit like the camera does not always get released, and
once detached from a given app (when the app crashes or perhaps leaks some context
when it exits normally) no app can connect to it anymore, including my own app. I
still only know of the power cycle to get the camera back.
once or twice a day. It looks a bit like the camera does not always get released, and
once detached from a given app (when the app crashes or perhaps leaks some context
when it exits normally) no app can connect to it anymore, including my own app. I
still only know of the power cycle to get the camera back.
jb...@google.com <jb...@google.com> #5
Could you attach the output of adb bugreport or at least adb logcat -v threadtime the
next time this happens? This'll assist with diagnosing the issue. Thanks.
next time this happens? This'll assist with diagnosing the issue. Thanks.
se...@gmail.com <se...@gmail.com> #6
I will do so when it happens again, but I remember that there was
never any error or warning in the LogCat output. It just stopped
giving new lines. Only "bisection" with my own inserted Log messages
let me identify the exact line where the app just froze, as described
before. It was always one of the camera.* commands, but not always the
same command. One thing that "helps" to run into the problem more
often is to recompile the app in Eclipse and launch the updated APK
via the USB cable while the program is still running on the phone:
Eclipse happens to just kill the app's process without letting it
first go through onPause() and onDestroy() to let my app properly
release the camera, and that certainly increases the probability of
the camera "hanging" until after a full power-cycle. Of course the
need for a complete power cycle to "reset" the G1 camera is
unacceptable under any circumstance.
Thanks
never any error or warning in the LogCat output. It just stopped
giving new lines. Only "bisection" with my own inserted Log messages
let me identify the exact line where the app just froze, as described
before. It was always one of the camera.* commands, but not always the
same command. One thing that "helps" to run into the problem more
often is to recompile the app in Eclipse and launch the updated APK
via the USB cable while the program is still running on the phone:
Eclipse happens to just kill the app's process without letting it
first go through onPause() and onDestroy() to let my app properly
release the camera, and that certainly increases the probability of
the camera "hanging" until after a full power-cycle. Of course the
need for a complete power cycle to "reset" the G1 camera is
unacceptable under any circumstance.
Thanks
jb...@google.com <jb...@google.com> #7
Since this is probably a low-level issue (very possibly below Android itself in
fact), some of the other logs captured by adb bugreport (e.g. the kernel log) are
likely to contain more information than logcat.
fact), some of the other logs captured by adb bugreport (e.g. the kernel log) are
likely to contain more information than logcat.
se...@gmail.com <se...@gmail.com> #8
You are probably right, JBQ.
Well, with the "trick" to let Eclipse launch a recompiled APK (for exactly the same
code) while my program was still running on the phone, I managed to "hang" the camera
already in the second run. After this happened I ran adb bugreport > junkcam.txt. The
camera would not also not work anymore with other camera apps such as SnapPhoto or
the built-in Camera app, so I'll have to power-cycle my dev phone 1 for the umptieth
time now...
Attached is the adb bugreport output. Hope you will find a useful trace of what
happened with the camera.
Thanks
Well, with the "trick" to let Eclipse launch a recompiled APK (for exactly the same
code) while my program was still running on the phone, I managed to "hang" the camera
already in the second run. After this happened I ran adb bugreport > junkcam.txt. The
camera would not also not work anymore with other camera apps such as SnapPhoto or
the built-in Camera app, so I'll have to power-cycle my dev phone 1 for the umptieth
time now...
Attached is the adb bugreport output. Hope you will find a useful trace of what
happened with the camera.
Thanks
jb...@google.com <jb...@google.com> #9
Superb, thanks. This'll hopefully help our camera experts figure out what might be
going wrong.
going wrong.
se...@gmail.com <se...@gmail.com> #10
Thanks JBQ. Hope so too! I just started looking into the junkcam.txt results...
As you can see from searching for the string "setParameters()" in junkcam.txt, the
QualcommCameraHardware output is quenched in the second run right after this command,
and from the output after "openCameraHardware: call createInstance" reading
"createInstance: X return existing hardware" in the second run I gather that indeed
the camera had not been released. That by itself is no so strange because Eclipse
killed my process non-gracefully by not letting it release the camera hardware first,
but the bad consequence is now that the camera is no longer bound to the previous
instance of my (killed) app and my new instance cannot bind to it so it cannot
release it either. It looks like the camera is kind of "floating", thinking that it
is still bound to a process that is no longer there, and thus blocking access by any
other apps or app instances.
Clearly there ought to be a means for the camera to recover from such nasty deadlock
situations.
Regards
As you can see from searching for the string "setParameters()" in junkcam.txt, the
QualcommCameraHardware output is quenched in the second run right after this command,
and from the output after "openCameraHardware: call createInstance" reading
"createInstance: X return existing hardware" in the second run I gather that indeed
the camera had not been released. That by itself is no so strange because Eclipse
killed my process non-gracefully by not letting it release the camera hardware first,
but the bad consequence is now that the camera is no longer bound to the previous
instance of my (killed) app and my new instance cannot bind to it so it cannot
release it either. It looks like the camera is kind of "floating", thinking that it
is still bound to a process that is no longer there, and thus blocking access by any
other apps or app instances.
Clearly there ought to be a means for the camera to recover from such nasty deadlock
situations.
Regards
jb...@google.com <jb...@google.com> #11
Thanks for the information, we appreciate the time you're spending on this in order
to help us.
to help us.
jb...@google.com <jb...@google.com> #12
This issue was fixed in the source code and the fix will be in a future release
se...@gmail.com <se...@gmail.com> #13
Apparently the fix is either not in Cupcake or it is not 100% effective, because I
had the same problem yesterday on day 1 after flashing my ADP with the newly released
Cupcake firmware. I had to reboot the phone to get the camera back.
had the same problem yesterday on day 1 after flashing my ADP with the newly released
Cupcake firmware. I had to reboot the phone to get the camera back.
se...@gmail.com <se...@gmail.com> #14
> This issue was fixed in the source code and the fix will be in a future release
OK, I've now had this bad problem several times again on my ADP with Cupcake
(1.5_r1), so it is apparent that the problem was *not* fixed! Only power cycling
brings the camera back, or else no camera application can access the camera. This is
a guarantee for a miserable user experience. :-(
OK, I've now had this bad problem several times again on my ADP with Cupcake
(1.5_r1), so it is apparent that the problem was *not* fixed! Only power cycling
brings the camera back, or else no camera application can access the camera. This is
a guarantee for a miserable user experience. :-(
dr...@gmail.com <dr...@gmail.com> #15
I've the same problem on android 1.5 (camera open error) someone can give me the clue?
Thanks.
Thanks.
yy...@gmail.com <yy...@gmail.com> #16
it seems that 1.6(Donut) still has the same problem.
I've confirmed at ADP1 + Donut.
I don't know/see what is the trigger of this problem but after that,
all camera apps never works until reboot(power off -> power on).
I've confirmed at ADP1 + Donut.
I don't know/see what is the trigger of this problem but after that,
all camera apps never works until reboot(power off -> power on).
ka...@gmail.com <ka...@gmail.com> #17
I have seen the same behaviour on the Nexus One.
Camera.open hangs. I cannot start any other camera app, killing the process doesn't
do anything for the camera lock. I have to restart the device.
If I use my application nicely, it works, but when doing the monkey test pressing
home and my application icon around 20 times in fast pace, this is one of the issues
I'm seeing.
I have not seen this with the built in Camera app, perhaps it is doing something
different.
Camera.open hangs. I cannot start any other camera app, killing the process doesn't
do anything for the camera lock. I have to restart the device.
If I use my application nicely, it works, but when doing the monkey test pressing
home and my application icon around 20 times in fast pace, this is one of the issues
I'm seeing.
I have not seen this with the built in Camera app, perhaps it is doing something
different.
hi...@gmail.com <hi...@gmail.com> #18
This problem was occurred on HTC Magic with SDK4.
I noticed that this problem is occurred whenever using onKey to take a photo while it
never occurred using onKeyDown&onKeyUp. I'm not sure the details but looks the cause
should be in android, not real device.
I noticed that this problem is occurred whenever using onKey to take a photo while it
never occurred using onKeyDown&onKeyUp. I'm not sure the details but looks the cause
should be in android, not real device.
or...@gmail.com <or...@gmail.com> #19
Same problem with my HTC Desire, After camera hangs, opening the built in camera apps quietly exit.
Using latest 2.1 Android.
Sometime my app completely hangs. Only a restart bring the camera back to life.
Using latest 2.1 Android.
Sometime my app completely hangs. Only a restart bring the camera back to life.
ch...@gmail.com <ch...@gmail.com> #20
Thanks for the bugfixe, but is there a workaround for device older than 22 June 2013, when the patch was released (wich means after 4.2.2 released in february 2013...)
ma...@gmail.com <ma...@gmail.com> #21
For the record, I am having the same issue right now with Google Glass (which means I'm using Android 4.4.2, API 19; the Glass firmware is XE22). Still I don't understand if this is the fault of some specific devices, or of the Android platform.
co...@gmail.com <co...@gmail.com> #22
Me and my father experience this odd bug for like 2 weeks , i have an s3 Neo he has an s5 . If i try to open the camera to take a picture my phone freezes and a lock of the screen + waiting or restart of the device is required
[Deleted User] <[Deleted User]> #23
Experiencing the same issue on my DOMO Slate S5 device with Android version 4.4.2. What do you suggest the next steps should be here?
aq...@gmail.com <aq...@gmail.com> #24
I am facing this issue for several times and there is no log or any crash or error in the logcat i want to run camera as service and my service file is attached with this comment. i am testing this code on my Samsung Galaxy Grand Prime plus. my phone just freeze or hang and did not respond to any command. until unless i need to restart it by removing the battery. Otherwise if i am running my application while debugging just stopping this app will make my device in normal state. I am using Android Studio 3.2 Canary 17.
Description
In using the camera on my brand new dev phone 1, I regularly run into the
situation that Camera.open() completely "hangs".
Then (quitting and) restarting my program with camera=null and testing with
Log.i("OIC", "JUNKcam0");
if (camera == null) {
Log.i("OIC", "JUNKcam1");
try { camera = Camera.open(); }
catch (Exception e) { Log.e("OIC", e.getMessage(), e); }
Log.i("OIC", "JUNKcam2");
camera.setPreviewDisplay(holder);
Log.i("OIC", "JUNKcam3");
}
Log.i("OIC", "JUNKcam4");
gives as output only
JUNKcam0
JUNKcam1
Apparently, Camera.open() itself hangs without causing any exception, such
that there is nothing that I can trap and act upon. I can then also not use
the built-in camera app, as it gives just a black preview screen and a bit
later a message about being unresponsive when I try to interact with it.
Since in the above code snippet <camera> was already null (at program
startup), there is just nothing that I can release: no camera.release().
Killing apps also does not help, and in fact I could not find any means to
get the camera back *except* by applying the phone's power off and then on
for a reboot! That's pretty awful! Is there any workaround (let alone a
fix) for this horrible camera behavior?
Thanks