Autofocus not working with libcamera-still

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

Arducam & Uctronics

  1. Model number of the product(s)?

Several autofocus camera models, i.e.,
IMX519 (B0386), IMX219 (B0393), OV5647 (B0176), IMX477 (B0272), IMX519 (B0371), 64MP (B0399)

  1. What hardware/platform were you working on?

raspberry pi4B
May 16 2022 15:40:46
Copyright (c) 2012 Broadcom
version ae6542a8a3aef192cb3536c39106d19f342fab29 (clean) (release) (start)

PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)”
NAME=“Raspbian GNU/Linux”
VERSION=“11 (bullseye)”

  1. Instructions you have followed. (link/manual/etc.)


  1. Problems you were having?

When testing with libcamera-still, the options --autofocus and --continue-autofocus not working, i.e.,
libcamera-still -t 5000 --viewfinder-width 2312 --viewfinder-height 1736 --width 4624
–height 3472 -o 64mp.jpg --autofocus


libcamera-still -t 5000 --viewfinder-width 2312 --viewfinder-height 1736 --width 4624
–height 3472 -o 64mp.jpg --continue-autofocus

The focus function works under manual focus using

python -d /dev/v4l-subdev1

however, digital zoom doesn’t work.

  1. The dmesg log from your hardware?

  2. Troubleshooting attempts you’ve made?

Testing with different camera models as shown in 2, the results were the same.

  1. What help do you need?

How to set up cameras to implement --autofocus and --continue-autofocus.

Hi, @babybabe

Did you upgrade the kernel first and install the driver first?

Yes … I do upgrade using

sudo apt-get update
sudo apt-get upgrade

the kernel version is 5.15.40-v7l+.

We do not currently support this kernel version. We generally compile the driver based on the image kernel version released by the Raspberry Pi.

OK … what kernel version does the camera support? The Raspberry PI Imager currently provides kernel version 5.15.

Hi, @babybabe

We support all bullseye system image kernels released by Raspberry Pi.

You just need to reinstall the Raspberry Pi system, no kernel upgrade required.