PINE64
Can't get autofocus working - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: General Discussion on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=127)
+--- Thread: Can't get autofocus working (/showthread.php?tid=15714)



Can't get autofocus working - duncan_bayne - 01-08-2022

Hi,

I'm running into difficulty getting main camera autofocus running.  I've taken the following steps:

  1. Replaced my Braveheart motherboard with a new 3GiB motherboard.
  2. Replaced my camera module with a new one.
  3. Installed the latest Mobian weekly (2022-01-02).
  4. Upgraded all the things ( sudo apt-get upgrade -y ).
  5. Started Megapixels, and tapped the screen to trigger autofocus.

At this point the focus jumps around a bit (looks like autofocus starting to work as it does on other devices), but it never manages to properly focus on anything more than a few centimeters from the lens.  During this, the following is logged in dmesg:

Code:
[ 7895.103889] ov5640 3-004c: uploaded firmware didn't start, got to 0x7f, retrying...
[ 7895.423877] ov5640 3-004c: uploaded firmware didn't start, got to 0x7f
[ 7895.430507] ov5640 3-004c: ov5640_set_ctrl_focus: no autofocus firmware loaded
[ 7899.123759] ov5640 3-004c: firmware upload success
[ 7899.129210] ov5640 3-004c: fw started after 0 ms

The camera works just fine when I "focus" it by physically moving it close to an object:


[Image: IMG20220108060633.jpg]

... but if I try to take a photo of anything more than a few centimeters away, it completely fails to focus:


[Image: IMG20220108060559.jpg]

Any help would be greatly appreciated, as this is the final hurdle for me to adopt a PinePhone as my daily driver Smile


RE: Can't get autofocus working - duncan_bayne - 01-18-2022

An update: I still can't get this to work.  I've tried every firmware at https://github.com/dragan-simic/ov5640-autofocus-firmware/, and also tried recompiling Megapixels from the latest source.

The basic behaviour is still the same: dmesg reports success; camera clicks indicating the lens is being controlled by the AF, and the focus jumps about when I touch the screen in Megapixels.  But it still seems completely unable to actually focus properly.


RE: Can't get autofocus working - kqlnut - 01-18-2022

Sounds strange, especially since you already changed the hardware. Have you made sure your lens and the cover from the case is clean? Maybe there is some dust or something that prevents the auto focus from working correctly. You could take off the back case of the phone and see if it behaves differently.


RE: Can't get autofocus working - alanwake82 - 01-20-2022

I believe the lens is not working properly, Try adding back-inn.


RE: Can't get autofocus working - duncan_bayne - 01-22-2022

So I solved it with a pair of tweezers Smile  Steps were ...

1. Remove the back cover.
2. Remove the inner back cover by taking out the screws.
3. Fine-tune the lens position by rotating it in the barrel with a pair of tweezers, while manually checking the results in Megapixels.

End result:

[Image: IMG20220123140940.jpg]