Libcamera install package error on Raspberry Pi 4 Arducam Camarray HAT

Hi all. I’m trying to get libcamera working on my Raspberry Pi 4 with an Arducam camera and a Camarray HAT, but the install script keeps failing with a package error.

My setup:

  • Raspberry Pi 4
  • Arducam camera + Camarray HAT
  • Hardware Revision: c03115
  • Kernel: 6.1.0-rpi4-rpi-v8
  • OS: bookworm

I ran:

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev

And got:

Cannot find the corresponding package, please send the following information to [email protected]
Hardware Revision: c03115
Kernel Version: 6.1.0-rpi4-rpi-v8
Package: libcamera -- bookworm

The wget part seems fine and chmod gives no output, but I get the same kind of error trying to install the libcamera apps and drivers too. Any ideas?

That “Cannot find the corresponding package” error means the Arducam camera driver hasn’t been released for bookworm yet. The script looks for a matching libcamera package for your kernel/OS combination and can’t find one.

Your best bet right now is to reflash to bullseye with kernel 6.1.21. The camera driver is available there, but not on bookworm.

Once you’ve reflashed to bullseye (kernel 6.1.21), run the same install script again and it should be able to find the packages.

Thanks for that. I reflashed to bullseye and now the install scripts complete without errors. But when I try to actually capture, I get “no cameras available”:

libcamera-still -t 5000
libEGL warning: DRI2: failed to authenticate
Made X/EGL preview window
[0:17:19.404292390] [2404] INFO Camera camera_manager.cpp:297 libcamera v0.0.0+4367-ad9428b4
ERROR: *** no cameras available ***

Here’s my /boot/config.txt:

dtparam=audio=on
start_x=1
display_auto_detect=1
dtoverlay=imx477
max_framebuffers=2
disable_overscan=1
[cm4]
otg_mode=1
[all]
[pi4]
dtoverlay=imx219
arm_boost=1
[all]
dtoverlay=arducam-pivariety
gpu_mem=128
dtoverlay=arducam-pivariety

The install commands I ran after switching to bullseye:

./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
./install_pivariety_pkgs.sh -p kernel_driver

Any idea why it still can’t see the camera?

Your config.txt has several camera overlays enabled at the same time, and they conflict with each other. You’ve got imx477, imx219, and arducam-pivariety (twice) in there. Only one should be active, and it has to match the camera module you actually have connected.

  • If you’re using an imx219: delete the imx477 and arducam-pivariety lines
  • If you’re using an imx477: delete the imx219 and arducam-pivariety lines
  • If you’re using a pivariety camera: delete the imx219 and imx477 lines

Also remove the duplicate arducam-pivariety entry. Then reboot the Pi and try libcamera-still again.

Right, I cleaned up the overlay mess. I’m now on a fresh bullseye legacy image with a 64MP autofocus camera. The preview window appears, but it’s just black, and libcamera-still keeps looping with timeout errors.

Setup:

  • Raspberry Pi 4
  • OS: bullseye legacy (reset)
  • Camera: 64MP autofocus
  • VNC installed

/boot/config.txt:

dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2
disable_overscan=1
[cm4]
otg_mode=1
[pi4]
arm_boost=1
[all]
dtoverlay=arducam-64mp

I installed:

sudo ./install_pivariety_pkgs.sh -p libcamera_dev
sudo ./install_pivariety_pkgs.sh -p libcamera_apps
sudo ./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver
sudo apt install -y python3-kms++
sudo apt install -y python3-pyqt5 python3-prctl libatlas-base-dev ffmpeg python3-pip
sudo pip3 install numpy --upgrade
sudo pip3 install picamera2 --upgrade

Then libcamera-still -t 5000 gives:

Made X/EGL preview window
[0:19:23.664140557] [1714] INFO Camera camera_manager.cpp:297 libcamera v0.0.0+4367-ad9428b4
[0:19:23.697389131] [1716] WARN CameraSensorProperties camera_sensor_properties.cpp:261 No static properties available for 'arducam_64mp'
[0:19:23.697475482] [1716] WARN CameraSensorProperties camera_sensor_properties.cpp:263 Please consider updating the camera sensor properties database
[0:19:23.786695751] [1716] INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media1 and ISP device /dev/media2
[0:19:23.786892970] [1716] INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[0:19:23.788222005] [1714] INFO Camera camera.cpp:1033 configuring streams: (0) 4096x3074-YUV420
[0:19:23.789035123] [1716] INFO RPI vc4.cpp:572 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected unicam format: 4624x3472-pRAA
[0:19:25.286157601] [1716] WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[18:cap]: Dequeue timer of 1000000.00us has expired!
[0:19:25.286270192] [1716] ERROR RPI pipeline_base.cpp:1356 Camera frontend has timed out!
[0:19:25.286296155] [1716] ERROR RPI pipeline_base.cpp:1357 Please check that your camera sensor connector is attached securely.
[0:19:25.286320654] [1716] ERROR RPI pipeline_base.cpp:1358 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!

And it loops on that timeout/restart. What should I check next?

That “Dequeue timer expired” + “Camera frontend has timed out” loop can be caused by a few things - power, the sensor, or something else holding the camera. To narrow it down, can you generate a bug report for me?

Reboot the Pi first, then:

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 creates an arducam-bug-report.txt in the current directory. Send me the file via private message and I’ll take a look.

I ran the tool after a reboot and it generated arducam-bug-report.txt. I’ve sent the file over through private message. Let me know what you find.

Got the report, thanks. Looking through the logs, it seems the camera driver is being occupied by another process - that would explain the timeouts even though the sensor is detected.

Is there any Python code, script, or another program that might be driving the camera in the background? Sometimes a leftover process from an earlier test keeps a hold on /dev/video0.

No, I don’t have anything like that running. I’ve only been installing packages via the terminal commands from earlier in the thread. I haven’t run any Python or other program to drive the cameras. Should I be driving them with Python instead?

It’s not that you need Python - it’s more that something else appears to have grabbed the camera resource. Let’s find out what. Can you run this and paste the output here?

ps -ef | grep arducam

That should show us which process (if any) is holding the camera. Once we know what’s occupying it, we can sort out the timeout loop.