Arducam 16MP autofocus on Pi Zero Bullseye: libcamera and libcamera-hello not found

Hi all, hoping someone can help. I’m trying to get an Arducam 16 MP autofocus camera working on a Raspberry Pi Zero running the latest updated Bullseye. I followed the guide here (Arducam 16MP camera on Raspberry Pi libcamera guide) and installed the driver, configured the buffer, and when I tested it earlier I actually got nice images and video. Then I followed the instructions for installing the modifications to libcamera. The scripts all ran without any errors, but now libcamera doesn’t work at all:

$ libcamera
-bash: libcamera: command not found
$ libcamera-hello
-bash: libcamera-hello: command not found

Are the links for the libcamera modifications still valid? Or am I missing a step somewhere?

Hey, sorry you’re hitting this. A couple of quick questions so we can pin down what state the system is in:

  1. Which exact OS image are you on, and did you run rpi-update at any point?
  2. Did you enable GL / Glamor as part of the setup (the guide mentions configuring GL and Glamor)?
  3. After running the libcamera modification script, did it say anything about rebuilding or reinstalling the libcamera packages?

In the meantime, can you run the bug report tool and send us the output? That will tell us which libcamera packages are actually present:

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

I ran the scripts you sent, but the last step won’t execute at all because libcamera isn’t available anymore. So the bug report comes back empty - arducam-bug-report.txt has nothing in it. Here’s what I see when the script tries to call the camera tools:

FileNotFoundError: [Errno 2] No such file or directory: ‘libcamera-still’

It looks like the libcamera modification step is removing/breaking the libcamera binaries rather than patching them. I’m at the point where I’m just going to save my files, reload the OS, and try the whole process again from scratch.

Update after reloading: I installed a fresh Raspberry Pi OS and let it update during the install, and now the camera driver install reports an unsupported kernel. So I tried again WITHOUT updating - installed the driver, made the changes to /boot/config.txt, and plain libcamera worked fine (no modifications). But as soon as I install the changes to libcamera, libcamera-hello is missing again and arducam-bug-report.txt is empty. Same failure as before.

Environment:

  • Operating System: Raspbian GNU/Linux 11 (bullseye)
  • Architecture: arm
  • With update: Linux 5.15.74-v7+ (Hardware Revision: 902120)
  • Without update: Linux 5.15.61-v7+

Interestingly, the camera and all the libcamera changes work fine on a Raspberry Pi 3 - it’s only the Pi Zero that fails. Has anyone actually gotten this camera working on a Pi Zero?

Thanks, that’s useful. The “unsupported kernel” message is a real thing - the driver package check only approves specific kernel builds, so on 5.15.74-v7+ it bails out. If you see this:

Cannot find the corresponding package, please send the following information to [email protected]
Hardware Revision: 902120
Kernel Version: 5.15.74-v7+
Package: imx519_kernel_driver_low_speed – bullseye-v5
You are using an unsupported kernel version, please install the official SD Card image (do not execute rpi-update)

…then you’re on a kernel the driver won’t build against, which explains that pass. Can you send me the following so I can compare against our test rig?

uname -a
cat /proc/cpuinfo

Also, for the non-updated install where libcamera breaks, please paste the full traceback from the bug report script.

Here’s everything from the non-updated run where libcamera breaks:

ubuntu@raspberrypi:~/libcamera $ libcamera-hello
-bash: /usr/bin/libcamera-hello: No such file or directory

./arducam-camera-bug-report →
Traceback (most recent call last):
File “/home/ter/libcamera/./arducam-camera-bug-report”, line 139, in
cmd_out = run_prog(args.c, args.t)
File “/home/ter/libcamera/./arducam-camera-bug-report”, line 52, in run_prog
p = subprocess.Popen(cmd, text=True, stdout=subprocess.PIPE,
File “/usr/lib/python3.9/subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.9/subprocess.py”, line 1823, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘libcamera-still’

And arducam-bug-report.txt is empty again.

For reference, the two system states I tested:
With update: Operating System: Raspbian GNU/Linux 11 (bullseye), Kernel: Linux 5.15.74-v7+, Architecture: arm, Static hostname: raspberrypi, Machine ID: dbbe1912a0334e7387502b08c373d79b, Boot ID: b9c0dc995c9b4d27bc5f0ba95de4a66f
Without update: Operating System: Raspbian GNU/Linux 11 (bullseye), Kernel: Linux 5.15.61-v7+, Architecture: arm, Static hostname: raspberrypi, Machine ID: d102953f7e3e4879b1bf224fef76efce, Boot ID: f418a9ab33f54a0eb71833ea96075ca3

On the without-update run: driver installed, /boot/config.txt changed, libcamera (without changes) worked fine; then I installed the libcamera changes → same failure as before.

Okay, so the pattern is: base libcamera works, but the moment the libcamera-dev mod scripts run, the libcamera packages get torn down and nothing is left to call. On a Pi 3 it survives, on the Pi Zero it doesn’t.

Two things to try next:

  1. Confirm the GL/Glamor side. Run sudo raspi-config, go to 6 Advanced Options → A8 Glamor, enable it, then reboot and retry the autofocus.
  2. Since the Pi Zero 2 W is a different beast to the original Zero, can you give me uname -a and cat /proc/cpuinfo on the machine you’re testing? We have a similar unit here we can compare against.

Tried a clean Raspberry Pi OS install again and followed the arducam.com instructions exactly - the scripts for installing libcamera-dev run without errors, but they tear down libcamera. Same result on a completely clean install, and same result on a second Pi Zero 2 W. The autofocus command also complains:

ERROR: *** unrecognised option ‘—autofocus’ ***

uname -a:
Linux raspberrypi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux

cat /proc/cpuinfo:
Hardware: BCM2835
Revision: 902120
Serial: 0000000094e0068a
Model: Raspberry Pi Zero 2 W Rev 1.0

Python is 3.9.2 (the default in Raspberry Pi OS). I’ve now tested two Pi Zero 2 W units from the same production run, both fail. My specs look identical to what I’d expect your test environment to be, so I’m wondering if it’s an OS/hardware/Python difference. I’m going to try installing the camera on a Raspberry Pi 3 B+ next.

Thanks for all the detail. For reference, here’s the environment our side tested on, along with the screenshots:

Support test env:

  • Linux Pizero 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
  • Hardware: BCM2835
  • Revision: 902120
  • Serial: 00000000bdaf7490
  • Model: Raspberry Pi Zero 2 W Rev 1.0
  • Kingston 16 GB micro SD card

We ran both of these and they worked here:
libcamera-still -t 0 --autofocus
libcamera-still -t 0 -continuous --autofocus

Screenshots of the test:
image001.png
image003.png

Since your Revision (902120) and model match ours, the difference must be somewhere in the install sequence rather than the hardware. Can you confirm whether the Glamor option made any difference for you?

Thank you.

— quoted thread —
Had: Arducam 16 MP autofocus camera on a Raspberry Pi Zero, followed the libcamera modification instructions, scripts run without error, but libcamera is torn down afterwards. On a clean Pi OS install and on a second Pi Zero 2 W, the libcamera-dev install scripts run without errors but still tear down libcamera. Autofocus reports:
ERROR: *** unrecognised option ‘—autofocus’ ***

Quoted env:
uname -a: Linux raspberrypi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
Hardware: BCM2835 / Revision: 902120 / Serial: 0000000094e0068a / Model: Raspberry Pi Zero 2 W Rev 1.0
Python 3.9.2. Second Pi Zero 2 W (same spec) reproduces the issue.

Quoted logs: libcamera-hello → -bash: /usr/bin/libcamera-hello: No such file or directory; FileNotFoundError: [Errno 2] No such file or directory: ‘libcamera-still’; Cannot find the corresponding package … Kernel Version: 5.15.74-v7+ / Package: imx519_kernel_driver_low_speed – bullseye-v5 / You are using an unsupported kernel version.

Quoted attempts: Clean install of Pi OS, installed the 16 MP driver and modified /boot/config.txt, did NOT load the libcamera changes → libcamera runs but the camera doesn’t focus. Camera and changes work fine on a Raspberry Pi 3.
— end quoted thread —

Summary of where we’ve landed:

  • On the Pi Zero / Pi Zero 2 W, the base driver + /boot/config.txt changes work (libcamera runs), but the camera won’t autofocus.
  • Running the libcamera-dev modification scripts completes without errors yet leaves libcamera missing (libcamera-hello and libcamera-still gone), so anything that calls the camera tools fails with No such file or directory / FileNotFoundError, which is also why arducam-bug-report.txt comes back empty.
  • Installing on a kernel the driver package doesn’t recognise (e.g. 5.15.74-v7+) triggers the “unsupported kernel version” message, so stick to the official SD card image and don’t run rpi-update.

Workaround to try on the Pi Zero: run sudo raspi-config → 6 Advanced Options → A8 Glamor, enable it, reboot, then retry the autofocus command. If that still doesn’t bring focusing back, using the camera on a Pi 3 is currently the reliable path. We’re logging this Pi Zero libcamera-teardown issue as a real problem on our side since our own test unit didn’t reproduce it. Please post back the Glamor result and we’ll keep digging.