Open jswolf19 opened 2 years ago
Auto-focus seems to work on other Android phones, so I'm not sure if it's an Android OS version issue, a hardware issue, or a driver issue.
The patched version (that does not set CONTROL_AF_TRIGGER
) work at least as well as the unpatched version on all devices I've tested.
Phone | Android | Camera2 | Works Unpatched | Works Patched |
---|---|---|---|---|
Kyocera C6742A | 5.1.1 | yes (legacy HAL) | yes | yes |
Fujitsu Arrow M03 | 6.0.1 | yes (legacy HAL) | yes1 | yes1 |
Kyocera Torque G03 | 8.1 | yes (legacy HAL) | no | yes |
Kyocera AndroidOne S2 | 9 | yes (legacy HAL) | yes | yes |
Sharp Aquos sense3 basic | 11 | yes | yes | yes |
Google pixel4a | 12 | probably | yes | yes |
I'm using an Android8.1 Kyocera Torque G03 (Japan) phone, and the focal length does not seem to update after starting the barcode scan preview.
The
QRCameraC2
camera class is what gets used, withafMode
being set to 3 (CONTROL_AF_MODE_CONTINUOUS_VIDEO
).I believe the issue is with the
CONTROL_AF_TRIGGER
settings done instartCamera
.According to the Android docs
While the wording here leaves a bit up to interpretation, I believe the two options being suggested are:
CONTROL_AF_TRIGGER
) to START or CANCEL for only a single capture, and then return it to IDLECONTROL_AF_TRIGGER
) at allI have removed the above lines setting
CaptureRequest.CONTROL_AF_TRIGGER
onpreviewBuilder
, and the problem seems to be resolved (option 2, not settingCONTROL_AF_TRIGGER
at all). If you'd like a pull request, I'll be happy to create one.Looking at the Camera plugin, they seem to go with option 1.