Libcamera & IMX519 FAQ

This post is used to explain some common problems with IMX519 and libcamera.

Question 1:
I get an error similar to the following when installing the kernel driver:

Cannot find the corresponding package, please send the following information to [email protected]
Hardware Revision: b03111
Kernel Version: 5.4.83-v7l+

Need to install the latest Raspberry Pi system, and do not execute rpi-update

Question 2:
I get the following error when running libcamera:

[0:01:46.295273858] [631] INFO Camera camera.cpp:1028 configuring streams: (0) 4656x3496-YUV420 (1) 4656x3496-SRGGB10_CSI2P 
[0:01:46.296042453] [632] INFO RPI raspberrypi.cpp:751 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 4656x3496-SRGGB10_1X10 - Selected unicam format: 4656x3496-pRAA
 [0:01:46.351230171] [632] ERROR V4L2 v4l2_videodevice.cpp:1179 /dev/video0[12:cap]: Unable to request 1 buffers: Cannot allocate memory 
ERROR: *** failed to allocate capture buffers ***

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


Note: It is recommended to set to cma-128 or cma-96 on devices with smaller memory such as Pi Zero / Zero 2 W

Question 3:
I got an error similar to the following when I ran libcamera:

terminate called after throwing an instance of \'std::runtime_error\'
what(): failed to import fd 21

For Raspbian Buster users, please also:

  1. Open /boot/config.txt
  2. Add the following line under [all]:
  3. Save and reboot

For Raspbian Bullseye users running on Pi Zero ~ Pi 3:,

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

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

Question 4:
I cannot install the corresponding package using a third-party system.

Need to install the latest Raspberry Pi system, and do not execute rpi-update

About Octoprint:
Currently Octoprint’s mjpg-streamer plugin does not support libcamera, if you want to use a camera with a focus motor, you can try 5mp v1 camera, 8mp v2 camera, we are also trying to solve this problem (need to develop mjpg-streamer libcamera plugin), but Currently not supported.

A mjpg-streamer that works with libcamera:

We have successfully run libcamera & imx519 on OctoPi Nightly build, please refer to:

Question 5:
How to use two camera ports on the CM4

You need to install the latest Raspberry Pi system (after 2022/01/28), and do not execute rpi-update

Refer to this documentation to install drivers and applications:

After installing the system and drivers, add the following information to /boot/config.txt:


Note 1: For pivariety series, please modify imx519 to arducam.
Note 2: Need to reboot after modifying /boot/config.txt


List all cameras:

libcamera-still --list-cameras

Specify camera:

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

A post was split to a new topic: Quad-HAT outputs the wrong image

Question 6: Which driver should I install?

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

wget -O
chmod +x install_pivariety_pkgs.s
./ -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.

1 Like

Question 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:


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

Question 8: An interesting project: Plug-and-play Raspberry Pi USB webcam

Project Introduction:

More suggested reference: