Arducam Hawkeye B0399 install script 'bad array subscript' error on Pi 4B Bookworm OS

Hey everyone, I’m trying to get an Arducam Hawkeye B0399 working on a Raspberry Pi 4B 4G running Debian 12 Bookworm (kernel 6.6.77-v8+). I followed the Arducam Wiki instructions for “Hawkeye Raspberry Pi Bullseye OS 6.1.21 and Later/Bookworm OS” and ran ./install_pivariety_pkgs.sh, but it’s throwing errors right away:

./install_pivariety_pkgs.sh: line 389: package_download_links: bad array subscript
download_link=
./install_pivariety_pkgs.sh: line 390: package_names: bad array subscript

I poked around the script and noticed on line 87, BOOTCONFIG is hardcoded to boot/config.txt. But on my Bookworm install the actual config.txt lives at boot/firmware/config.txt. Looks like the script doesn’t account for the newer filesystem layout. Anyone run into this before? Is there a workaround or updated script floating around?

Thanks for the detailed report. That BOOTCONFIG path mismatch is a known pain point on Bookworm — the script was written against the older boot partition structure.

Before we dive deeper, could you help me confirm a couple things? First, could you share photos of your hardware connections — specifically how the camera ribbon cable is seated? And second, I’d like to get a diagnostic dump from your system.

I’ve sent you a private message with a link to our bug report tool. Grab it, make it executable, and run it after a fresh reboot. It’ll generate an arducam-bug-report.txt file. Please send that back to me via PM along with the connection photos and I’ll take a look.

Alright, I ran the bug report tool as instructed and I’ve sent you the arducam-bug-report.txt file along with three photos of the hardware connections via private message. Let me know what you find. I’m really hoping I don’t have a dead camera on my hands!

Good news — from the photos, your ribbon cable connection looks correct. The hardware side is fine.

So this really does come down to the install script not playing nicely with Bookworm’s filesystem layout. The BOOTCONFIG path (boot/config.txt vs boot/firmware/config.txt) is the root of the problem.

My recommendation: start from a completely clean slate. Use the RPI Imager to flash a fresh Debian Bookworm image, then follow our updated documentation here:

https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/64MP-Hawkeye/#raspberry-pi-bullseye-os-6121-and-laterbookworm-os

That guide should account for the Bookworm differences. Give it a shot and let me know how it goes.

Okay, I bit the bullet and did a full re-image with RPI Imager — clean Debian Bookworm install, then followed the official docs link you shared step by step.

New environment:

  • Hostname: PiHawkeye
  • OS: Linux 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64

Install seemed to go smoothly this time around. But now I’m hitting a different problem. When I try a basic capture test:

libcamera-still -t 5000

It crashes with this:

[19:22:47.077635496] [2511]  INFO Camera camera_manager.cpp:327 libcamera v0.4.0+78-818d45eb-dirty (2025-02-14T02:13:36GMT)
[19:22:47.135232439] [2514]  WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[19:22:47.137436291] [2514]  INFO RPI vc4.cpp:455 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media4 and ISP device /dev/media0
[19:22:47.137536124] [2514]  INFO RPI pipeline_base.cpp:1160 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/arducam_64mp.yaml'
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
Made X/EGL preview window
Mode selection for 4624:3472:12:P
    SRGGB10_CSI2P,1280x720/0 - Score: 13359.2
    SRGGB10_CSI2P,1920x1080/0 - Score: 11359.2
    SRGGB10_CSI2P,2312x1736/0 - Score: 9096
    SRGGB10_CSI2P,3840x2160/0 - Score: 5359.24
    SRGGB10_CSI2P,4624x3472/0 - Score: 1000
    SRGGB10_CSI2P,8000x6000/0 - Score: 2476.58
    SRGGB10_CSI2P,9152x6944/0 - Score: 3041.47
Stream configuration adjusted
[19:22:48.539089025] [2511]  INFO Camera camera.cpp:1202 configuring streams: (0) 4624x3472-YUV420 (1) 4624x3472-SRGGB10_CSI2P
[19:22:48.539517447] [2514]  INFO RPI vc4.cpp:630 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected unicam format: 4624x3472-pRAA
terminate called after throwing an instance of 'std::runtime_error'
  what():  failed to import fd 24
Aborted

The camera is detected, it picks the right sensor and tuning file, even selects the stream configuration… then just bombs out with failed to import fd 24. I’ve sent photos of the current setup via PM as well. Any ideas what’s going on?

Thanks for the logs — that’s actually really useful. The camera itself is being detected correctly (sensor, tuning file, stream config all look right), so the hardware and driver side seems fine.

That failed to import fd 24 error coupled with the Made X/EGL preview window line is the smoking gun here. libcamera-still by default tries to open an X/EGL preview window, and if there’s no display available, it’ll throw exactly this DMA-BUF / file descriptor import error.

How are you accessing the Pi? Are you logged in locally with a monitor and keyboard, or are you SSH’ing in remotely?

Ahhh — yep, that’s it. I’ve been doing everything over SSH. No monitor connected to the Pi at all. The log line Made X/EGL preview window should’ve tipped me off sooner — libcamera is trying to open a graphical preview that simply doesn’t exist over an SSH session, and that’s what triggers the std::runtime_error: failed to import fd 24.

Same environment as before: hostname PiHawkeye, kernel 6.6.51+rpt-rpi-v8, libcamera v0.4.0+78-818d45eb-dirty.

I’ll hook up a monitor (or use --nopreview) and report back. Posting this here in case anyone else scratches their head over the same crash — check whether you’re on SSH before blaming the camera!

Exactly right. For anyone else reading, when running libcamera-still (or libcamera-jpeg, etc.) over SSH without X forwarding, you have two options:

  1. Use --nopreview to skip the preview window entirely:

    libcamera-still -t 5000 --nopreview -o test.jpg
    
  2. Connect a monitor and run the command from a local terminal session on the Pi itself.

The sensor detection, mode selection, and stream configuration in your log all look healthy, so your Hawkeye should be ready to go once you bypass the preview requirement. Let us know how the first captured frame turns out!