Hi, I’m stuck with an Arducam 16MP AF camera (imx519). libcamera finds it and I can get a preview, but the autofocus/lens position settings do nothing. The image is completely out of focus/blurry. Has anyone hit this? I’ve tried the usual focus controls and nothing changes.
Just to narrow it down first: did autofocus ever work on this module before, or has it been like this from the first time you powered it up?
Here’s the full setup:
- Raspberry Pi 3 running an OctoPrint server setup (that’s where the camera normally lives).
- Raspberry Pi Zero 2W with a fresh image used just to generate a debug log.
- Arducam 16MP AF camera (imx519).
- Official Pi Camera V3 as a working comparison, swapped onto the Pi 3 for OctoPrint.
- Official Pi 5 Camera Cable connecting the ArduCam to the Pi Zero 2W. The Arducam cable isn’t easy to use on the Zero 2W because it doesn’t have the same connector as the Pi 3.
I installed the Arducam libcamera package, and I’ve had the module for about 2 years but never used it until now. I’ve attached a couple of photos of the module.
Thanks. Can you grab a bug report so we can see the state of the driver and lens controller? Please reboot, then run:
wget -O arducam-camera-bug-report https://github.com/ketai-dhr/arducam-camera-bug-report/releases/download/tools/arducam-camera-bug-report
chmod +x ./arducam-camera-bug-report
./arducam-camera-bug-report
That writes arducam-bug-report.txt in the current directory. Attach that file here.
Been through a lot of guides trying to get this working. I was never quite sure which driver/libcamera package I actually needed and whether all the pieces are in the standard kernel/libraries. I installed the Arducam libcamera build, but the images are still out of focus.
I used a new SD card programmed with Pi Imager on a fresh Pi Zero 2W and generated the Arducam bug report. I also confirmed the same cable works with the official Pi Camera V3, but the ArduCam still won’t focus. I’ve reverted to the Pi Camera V3 for now.
I also ran:
libcamera-hello --vflip -p 0,0,640,480 --hflip --autofocus-mode continuous
and got this:
Made X/EGL preview window
[0:08:50.912147211] [2878] INFO Camera camera_manager.cpp:297 libcamera v0.0.0+4367-ad9428b4
[0:08:50.938909404] [2881] ERROR V4L2 v4l2_device.cpp:93 ‘ak7375 10-000c’: Failed to open V4L2 device ‘/dev/v4l-subdev1’: Invalid argument
[0:08:50.939280259] [2881] ERROR CameraSensor camera_sensor.cpp:527 ‘imx519 10-001a’: Lens initialisation failed, lens disabled
[0:08:51.036115619] [2881] INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media3 and ISP device /dev/media0
[0:08:51.036270732] [2881] INFO RPI pipeline_base.cpp:1101 Using configuration file ‘/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml’
[0:08:51.038244390] [2878] INFO Camera camera.cpp:1033 configuring streams: (0) 2048x1536-YUV420
Thanks, I’ve looked through the bug report. The driver/libraries side looks OK. The problem is the focus motor: the motor driver is trying to reach the imx519 focus motor and getting nothing back. That matches the two errors in your log:
ERROR V4L2 v4l2_device.cpp:93 ‘ak7375 10-000c’: Failed to open V4L2 device ‘/dev/v4l-subdev1’: Invalid argument
ERROR CameraSensor camera_sensor.cpp:527 ‘imx519 10-001a’: Lens initialisation failed, lens disabled
So libcamera is disabling the lens because it can’t initialise it.
So the module itself is dead? The strange part is the same cable works fine with the official Pi Camera V3. Would a bad cable still let the sensor work but kill the focus motor?
Right, the sensor is detected and streaming, but the focus motor is not responding. The focus motor is the ak7375 driver. We’ve seen other customers with a non-working focus motor when they used the Raspberry Pi FFC cable to connect this camera. I’d try the Arducam FFC cable on the Pi 3 (which has the matching connector) and see if autofocus comes back. That will help rule out a cable/connection mismatch.
Good point. I’ll pull the Arducam cable out and test it on the Pi 3 with the ArduCam. Will report back.
To summarise where we are: libcamera sees the imx519 and can produce a preview, but the lens is disabled because the ak7375 focus motor isn’t reachable (the ‘Lens initialisation failed’ error). Your current workaround is to test the Arducam FFC cable on the Pi 3; if autofocus still doesn’t work with the Arducam cable, then the focus motor itself is likely faulty. There’s a similar thread here if you want to compare notes: No Autofocus working IMX519 - #17 by vbuser