Hey everyone, I’m having trouble getting autofocus to work on my Arducam IMX519 connected to a Raspberry Pi 3B+ running DietPi.
Video capture works fine, but autofocus just doesn’t engage. When I run:
rpicam-vid -t 10000 -o test.mp4 --autofocus-mode auto
I get these warnings from libcamera (v0.5.2+99-bfd68f78):
WARN IPARPI ipa_base.cpp:797 Could not set AF_MODE - no AF algorithm
WARN IPARPI ipa_base.cpp:1399 Could not set AF_TRIGGER - no AF algorithm or not Auto
WARN IPARPI ipa_base.cpp:1328 Could not set AF_RANGE - no focus algorithm
WARN IPARPI ipa_base.cpp:1346 Could not set AF_SPEED - no focus algorithm
Also worth mentioning — preview window isn’t working either (tried both X/EGL and DRM preview).
The “no AF algorithm” warnings seem like the root of it, but I’m not sure how to fix that on DietPi. Has anyone run into this? I already went through the docs at the Arducam site for the IMX519 but no luck.
This is a known issue — the default libcamera build that ships with DietPi doesn’t include the autofocus algorithm needed for the IMX519. The IMX519 requires the Arducam-patched version of libcamera for AF to work properly.
Here’s what you need to do:
Download and run the Arducam Pivariety package installation script:
Thanks for the suggestion. I ran the script exactly as you described, but something’s off — it didn’t actually install anything. Instead, it just generated a bunch of .txt files containing download links. No libraries were patched or installed.
I had already followed the official documentation at the Arducam IMX519 page before posting here, and that didn’t work either. I’m starting to wonder if there’s some compatibility issue with DietPi specifically. Has anyone else seen this script just spit out text files instead of doing the actual install?
That script behavior — generating text files instead of installing — strongly points to DietPi not being compatible with the Arducam installation tooling. DietPi isn’t one of the officially supported OSes for the Arducam drivers or those scripts, and it seems like the environment differences are preventing the script from running correctly.
At this stage, the cleanest path forward is to switch to an officially supported OS. Here’s what I’d recommend:
Head over to the Raspberry Pi software page and download the latest Trixie OS (Raspberry Pi OS) image.
Flash it to a fresh SD card and boot your Pi 3B+ from it.
Once you’re up on Trixie, test whether autofocus works there — the Arducam-patched libcamera should install and behave properly on a supported OS.
Please report back with your results. If autofocus works on Trixie, then we’ve confirmed DietPi was the culprit.
Makes sense. I went with DietPi because it’s Debian-based and figured most things would carry over, but I can see how the stripped-down nature of it might be causing the install script to misbehave — maybe some expected system utilities or paths are different.
Anyway, I’ll fall back to the official Trixie OS release as you suggested. I’ll flash it this evening and run through the autofocus test. Will report back once I’ve had a chance to try it out. Appreciate the help so far!