Afstate always failing

  1. Where did you get the camera module(s)?

  2. Model number of the product(s)?
    Arducam 16 MP Autofocus Camera,

  3. What hardware/platform were you working on?
    Raspberry Pi 4 Model B 8GB with Linux 11 ( Bullseye), Kernel 5.10.92-v7l+

  4. Instructions you have followed. (link/manual/etc.)
    Quick Start - Arducam Wiki

  5. Problems you were having?
    libcamera-vid and libcamera-still are working with full resolution (4654x3496) in raw resolution (–mode 4656:3496). However, the autofocus is always failing. I have tried --autofocus-mode continuous (as well as auto) and given ‘f’ as keypress. When using --info-text to see %afstate, %lp and %focus, it shows that on pressing ‘f’, the camera scans starting from lens position 0 all the way to 10. However, it always fails the scan, no matter if I change the object under camera to far-distance (2 m) or very close (~11 cm). I have tried manually changing the focus length by using Pivariety and it does change the focus to a very sharp image. However, running it in autofocus mode from libcamera-still or libcamera-vid, it is never a sharp image and camera ‘failed’ to scan (as per %afstate).

  6. The dmesg log from your hardware?

  7. Troubleshooting attempts you’ve made?

  8. What help do you need?
    What is the camera failing to autofocus and what can be done to make it focus correctly?

Hi @hassaniqbal209 ,

Try this: