Arducam 16MP IMX519 "no cameras available" on Raspberry Pi 3B with libcamera

Hi everyone, I’m stuck getting an Arducam 16MP autofocus (IMX519) camera to work on my Raspberry Pi 3B V1.2. To be honest I never got it to work at all. If I connect an original Raspberry Pi v2 camera, everything works fine, so I don’t think the Pi itself is broken. With the Arducam I just get “no cameras available”.

I followed the official IMX519 start guide PDF and 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
apt-get update
apt-get upgrade
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
./install_pivariety_pkgs.sh -p imx519_kernel_driver
git clone https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver.git

Then libcamera-hello gives me:

[0:19:03.820530624] [1554] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3139-5baab39e
ERROR: *** no cameras available ***

I also tried raspi-config → Advanced options → add OpenGL driver full KMS, then reboot, then libcamera-hello again. Same error every time. Any idea what I’m missing here?

Hi, thanks for the detailed report. Before we can say what’s going on, I need some diagnostic info from your system. The camera driver install can behave differently depending on kernel/OS state, so we need a bug report to see what’s actually loaded.

Please reboot the device first (important, so we get a clean state), then run:

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

This will produce a file called arducam-bug-report.txt in the current directory. Please attach that file to your next post and we’ll take a look.

OK, I rebooted and ran the tool. The arducam-bug-report.txt is attached to this post.

Just to recap the setup so it’s all in one place:

  • Raspberry Pi 3B V1.2
  • Arducam 16MP autofocus (IMX519)
  • Install done with the ArduCAM install script as in the start guide
  • An original Raspberry Pi v2 camera works fine in the same slot
  • libcamera-hello still returns:
[0:19:03.820530624] [1554] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3139-5baab39e
ERROR: *** no cameras available ***

Let me know what else you need from me.

Thanks, got the report. From what I can see in it, you’re running the Buster OS. Buster is not supported for this camera anymore - the driver install will not work reliably on it, which would explain why libcamera never sees the sensor even though the module is seated correctly.

Could you burn the latest Bullseye OS image and then follow this guide for the driver install?

https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/Quick-Start-Guide/#imx519hawkeye-64mp-cameras

Once you’re on Bullseye, redo the driver install and check libcamera-hello again.

OK, fresh Bullseye install done. I ran apt-get update and apt-get upgrade to bring it fully up to date.

I first did the install as root with sudo -i, and got a weird warning about the download:

libcamera-dev (0.0.10) wird eingerichtet ...
W: Repository is broken: libcamera-dev:arm64 (= 0.0.10) has no Size information
N: Der Download wird als root und nicht Sandbox-geschützt durchgeführt, da auf die Datei »/root/libcamera-dev-0.0.10-bullseye-arm64.deb« durch den Benutzer »_apt« nicht zugegriffen werden kann. - pkgAcquire::Run (13: Keine Berechtigung)

So then I switched back to my regular user and ran everything through sudo instead:

sudo ./install_pivariety_pkgs.sh -p libcamera_dev
sudo ./install_pivariety_pkgs.sh -p libcamera_apps
reboot

Good news: libcamera-still --list-cameras now actually detects the camera:

0 : imx519 [4656x3496] (/base/soc/i2c0mux/i2c@1/imx519@1a)
    Modes: 'SRGGB10_CSI2P' : 1280x720 [120.00 fps - (1048, 1042)/2560x1440 crop]
                             1920x1080 [60.05 fps - (408, 674)/3840x2160 crop]
                             2328x1748 [30.00 fps - (0, 0)/4656x3496 crop]
                             3840x2160 [18.00 fps - (408, 672)/3840x2160 crop]
                             4656x3496 [9.00 fps - (0, 0)/4656x3496 crop]

But taking a picture still fails:

libcamera-still -n -t 5000 -o test.jpg

That throws allocate buffers problems - the full output is in the attached file. System info: Hardware Revision a02082, Kernel 5.15.76-v8+, OS bullseye, ARCH aarch64. Any ideas?

Good progress - the sensor is detected now, so the driver side is fine. For reference on this camera family, have a look at this FAQ thread:

Hmm, wait. How should that match my setup? That page is about the 64MP camera, but I have the 16MP model. Am I supposed to follow 64MP instructions on a 16MP module? Sorry if that’s a dumb question, I just want to make sure I don’t apply something wrong and mess up the config.

You’re right, that link isn’t about your exact module - but the buffer troubleshooting in it applies, since that’s the same class of error you’re hitting. The output in your terminal shows the camera can’t get enough buffer, which means CMA (Contiguous Memory Allocator) needs to be allocated for the camera device.

Two things to do:

  1. Add cma-512 behind dtoverlay=vc4-kms-v3d in the config file:
sudo nano /boot/config.txt

So the line ends up like dtoverlay=vc4-kms-v3d,cma-512 - see the screenshot I’ve attached for exactly how it should look.

  1. Also make sure Glamor acceleration is enabled (the screenshot shows that too).

Reboot after the change and try the capture again.

I made the change but I’m not sure I did it right. I added ,cma512 behind the overlay line - the line I have now is:

dtoverlay=imx519,cma512

I wasn’t sure if that’s the intended syntax or if I was supposed to put it on the vc4-kms-v3d line. Anyway, the capture still fails with:

Not enough buffers provided by V4L2VideoDevice

I attached a fresh bug report file from the current state. The hardware is still the Raspberry Pi 3 B V1.2. What am I doing wrong with the config entry?

That’s not quite the line we need changed. The cma-512 doesn’t go on the imx519 overlay - it has to go on the vc4-kms-v3d overlay line, that’s what reserves the contiguous memory for the GPU/camera pipeline.

Please follow the screenshot I posted to change your config file exactly as shown there. Then you need to reboot your Pi for it to take effect - the change won’t apply until after a restart.

That did it! I changed the config file to match your screenshot and rebooted, and the camera works now. libcamera-still captures fine. Thank you so much, it is working now.