Cameras for Raspberry Pi

  1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. IMX519 Autofocus Camera and Raspberry Pi libcamera Guide
  5. 16MP Autofocus Camera – Common Issues & Fixes

16MP Autofocus Camera – Common Issues & Fixes

The Basics

Things to confirm/try when the camera is not working:

  • Make sure the cable is correctly connected.
  • Make sure you are using the correct OS with the correct kernal version.
  • Follow the libcamera installation guide we wrote.
  • Fresh install of the Raspberry Pi OS.
  • Make sure your Raspberry Pi has no problem using official Pi cameras (v1/v2/HQ).

Camera Modules in the Quad-Camera Kit

The camera modules are exclusively built for the quad-camera adapter HAT for accurate synchronization, they can only be used with the HAT connected to a Pi, connecting them directly to a Raspberry Pi will not work.

If your issues about Quad-Camera are still not resolved after referring to the below DOC, please contact [email protected] for further support.
Note: Before you contact us, please provide the following information so that we can help you solve problems efficiently.
1. System related information can be obtained by the following command:
uname -a
cat /etc/os-release
cat /proc/meminfo
cat /boot/config.txt

2. System log
dmesg
3. Camera Module Module number(e.g. SKU) or purchase link.
Photo of hardware connection (This is important.)
5. Application log
Provide error information or screenshots of application output.

Problems and fixes

1. Incorrect Kernal Version

Cannot find the corresponding package, please send the following information to [email protected]

Hardware Revision: b03111

Kernel Version: 5.4.83-v7l+

How to fix it

Try a fresh install of Raspberry Pi OS:

Do not run rpi-update!

2. “Cannot allocate memory” error

/dev/video0[12:cap]: Unable to request 1 buffers: Cannot allocate memory ERROR: *** failed to allocate capture buffers ***

How to fix it

Open /boot/config.txt, and add dtoverlay=vc4-kms-v3d,cma-<size>

dtoverlay usage

E.g.

dtoverlay example

Tips: Use cma-128 / cma-96 for memory-constrained models like Zero and Zero 2 W.

3. “failed to import” error

fail to import camera error

How to fix it

For Raspbian Bullseye users running on Pi Zero ~ Pi 3, please execute the follows:

1. Open a terminal
2. Run sudo raspi-config
3. Navigate to Advanced Options
4. Enable Glamor graphic acceleration
5. Reboot your Pi

Meanwhile, you also need to execute the following steps:
1. Open a terminal
2. Run sudo raspi-config
3. Navigate to Advanced Options
4. Navigate to GL Driver
5. Select GL (Full KMS)
6. Reboot your Pi

For more details, please refer to the official forum guide on how to configure the camera module >>

For Raspberry Pi Compute Module 3/4:

You need to install the latest Raspberry Pi system (after 2022/01/28), and do not execute rpi-update.
After installing the system and drivers (follow the above instructions), add the following information to /boot/config.txt:
[cm4]
dtoverlay=imx519
dtoverlay=imx519,cam0

Then reboot.

List all cameras:
libcamera-still –list-cameras

Specify camera:
libcamera-still -t 0 –camera 0
libcamera-still -t 0 –camera 1

4. Third-Party Operating Systems

Make sure you are using SD Card Images from official sources.

About Octoprint:

The mjpg-streamer in Octoprint has no support for libcamera yet, if you want an AF camera for it, pls try our 5MP-AF v1 camera or 8MP-AF v2 camera, as for the Arducam 16MP-AF, support for libcamera in Octoprint is still in the works.

How to fix it

For now, the camera only works with Raspberry Pi OS.

Try a fresh install of Raspberry Pi OS:

Do not run rpi-update!

5. How to Use Multiple Cameras on Compute Module 4

Try a fresh install of the latest Raspberry Pi OS (2022.01.28 and later versions), follow this guide to install the camera driver, and do not run rpi-update.

Add the following lines to /boot/config.txt:

[cm4]
dtoverlay=imx519
dtoverlay=imx519,cam0

List all cameras

libcamera-still --list-cameras

Select specific cameras

libcamera-still -t 0 --camera 0
libcamera-still -t 0 --camera 1

6.  Which driver should I install?

The 16MP Quad-Camera Kit (B0388), 15-Meter Cable Extension Kit (U6248) and Arducam Mini 16MP IMX519(B0389B0391) require the “low speed” version of the driver:

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.s
./install_pivariety_pkgs.sh -p imx519_kernel_driver_low_speed

In fact, if you are not sure which driver to install, please install imx519_kernel_driver_low_speed, the only difference between the “low speed” version of the driver and the normal version is that the maximum resolution frame rate of the “low speed” version is 1-2 frames slower than the normal version.

7. Open I2C bus error

Some systems do not have i2c enabled by default, and you will encounter the following errors when running libcamera-apps:

Solution:

sudo raspi-config
     --> Interface Options
          --> I2C

Was this article helpful to you? Yes 4 No 4