Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus 4 camera flash doesn't fire when focus mode is set to continuous-picture

I've encountered a strange issue, specifically on a Nexus 4 (though it may exist on other devices), where the camera flash won't fire when the focus mode is set to FOCUS_MODE_CONTINUOUS_PICTURE. The same code works fine on a Galaxy Nexus running the same version of Android (4.2.1). Has anyone encountered this problem before? I can fix the issue by simply switching the focus mode to FOCUS_MODE_AUTO. I'm hoping there is an easy work around for this issue, since the continuous picture focus mode is pretty crucial.

like image 208
twaddington Avatar asked Oct 06 '22 10:10

twaddington


1 Answers

(For what it's worth just wrapping up my comment in an answer.)

The reason I suspect that continuous focus doesn't work on the Nexus 4 is that I have heard some rumblings from the Barcode Scanner user base about this (I'm the author). The Nexus 4 doesn't seem to work with, or without continuous focus enabled.

I haven't seen more detail to confirm/deny this, but, I have certainly seen this exact form of problem on other devices. In particular the Galaxy S2 seems to have some bad focus bugs.

It manifests as something slightly different: there is some third parameter you are setting which should be supported, or says it's supported, but actually causes the driver to barf. Then it doesn't honor the focus or torch setting. It may be that continuous focus, and torch, work. But a third setting is tripping it up.

Look into the logcat output. You should see debug messages from the driver. The exact nature depends a lot on the firmware. But in cases like this you will likely see errors in the driver. I usually see "unsupported parameter X" and cryptic numbers; sometimes it's much clearer about what it didn't like.

This may give you a lead, that it is in fact something like scene mode or metering area that are the problem. (And I have seen each of those cause this problem on at least one device.)

I also have a Galaxy Nexus and have never observed any problems of this form on it.

I'll also say that continuous focus can work nicely on some devices; it is worse on some devices like my old Desire HD, than the simple auto-focus mode. YMMV; I concluded it wasn't necessarily helpful so made regular auto focus the default in Barcode Scanner.

like image 132
Sean Owen Avatar answered Oct 10 '22 01:10

Sean Owen