Picamera2 capture_array hangs with Arducam Hawk-eye 64MP on Raspberry Pi 4

Hi everyone, I have a Raspberry Pi 4 with an Arducam Hawk-eye 64MP camera and I’m hitting a hang when running the ArduCam/picamera2_examples/SavePng.py example. It freezes at:

RGB888 = picam2.capture_array(“main”)

The raspberrypi/picamera2/examples/capture_full_res.py script hangs the same way. A Raspberry Pi Camera Module V3 runs the exact same code and saves still images without any issue.

Here’s the code I’m testing:

import time
from picamera2 import Picamera2, Preview

picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)

preview_config = picam2.create_preview_configuration()
capture_config = picam2.create_still_configuration()
picam2.configure(preview_config)

picam2.start()
time.sleep(2)

picam2.switch_mode_and_capture_file(capture_config, “test_full.jpg”)

It seems like any capture-related call after switching the configuration just hangs. My theory is that the internal capture method is waiting for a callback from the camera that never comes, maybe a missing callback in the Hawk-eye camera body or driver after a reconfigure.

There’s a GitHub issue that looks like the same setup (Pi 4 + Arducam Hawkeye 64MP) but it was closed without a real resolution: [BUG]picam2.switch_mode_and_capture_file freezes my program and camera · Issue #470 · raspberrypi/picamera2 · GitHub

Environment: Raspberry Pi 4, Arducam Hawk-eye 64MP, picamera2.

Can you make sure the Pi is set up with the latest Bullseye OS? The getting-started guide is here: https://www.raspberrypi.com/documentation/computers/camera_software.html#getting-started

With Bullseye, you can use the libcamera command to preview the camera directly. Also worth noting: with Bullseye there’s no longer a need to encrypt the IC before using the camera, it should work out of the box.

Thanks. I went back and tested a few more times: SavePng.py with the Hawk-eye always stops at RGB888 = picam2.capture_array(“main”), and capture_full_res.py hangs the same way. Swapped in the Camera Module V3 and the still image saves successfully every time. So it definitely looks specific to the Hawk-eye camera/driver combination.

Apologies, that previous reply about Bullseye setup wasn’t aimed at your actual issue, you can disregard it. I’ve reproduced the freeze you’re describing, and there is a temporary solution available. The problem comes down to camera driver/kernel version compatibility: the camera driver has to match the kernel version you’re currently running. Could you run:

uname -a

and post the output? Once I know your kernel version, I’ll send over the matching camera driver.

Here you go:

Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

Thanks. I’ve sent you a matching camera driver package through private message, it’s the low-speed PDAF IMX519 kernel driver built for kernel 6.1.21. Please check your messages and then:

  1. Comment out dtoverlay=64-mp in config.txt first.
  2. Extract the package.
  3. cd Release/
  4. ./install_driver.sh
  5. Reboot the Raspberry Pi so the driver takes effect.
  6. Run capture_full_res.py to check whether the freeze is gone.

That did it. I extracted and installed the driver from the package you sent, rebooted, and now I can switch the configuration and save files without any issue, the freeze is gone.

One thing though: the driver still looks like a provisional version rather than an official release. Is there any approximate timeline for when the official driver update will be released?

Great to hear it’s working now. To sum up for anyone else hitting this: the capture freeze on the 64MP Hawk-eye happens when the camera driver doesn’t match the running kernel, and the workaround is to install the matching low-speed PDAF IMX519 driver (after commenting out dtoverlay=64-mp) and reboot.

Regarding an official release, there’s no confirmed timeline yet. The driver I sent is still provisional, so keep using it for now and I’ll post an update when an official release is available.