CameraBin error: "Failed to allocate required memory." with QCamera

With libcamera-still i can see the preview and control the camera but
this happens when i run multimediawidgets/camera example application
CameraBin error: “Failed to allocate required memory.”

Hardware:
Raspberry Pi 4
8GB Compute Module 4 (2GB ram)
CamArray Hat with four 64MB hawkeye autofocus cameras connected
SKU: MBS-SES-256
GTIN: 0618455044205
purchase link ArduCam 64MP Autofocus Quad-Camera Kit | MYBOTSHOP.DE, 374,95 €

Soft:
Latest 32-bit bullseye
Qt 5.15.2

as i tracked down the problem is with gstreamer v4l2 drivers as qcamera is using it and standalone gsteramer doesent work either with my arducams
the bug appears to have recently been fixed with 1.22.1 build at https://gstreamer.freedesktop.org/

v4l2h264dec: Fix Raspberry Pi4 will not play video in application

but i have yet no idea how to install that 1.22.1 version. the one i get with apt-get is 1.18

has anybody here countered this problem and knows how to fix?
or can you give me links with instructions how to build gstreamer from source and install the libraries since the latest gstreamer version i get with apt-get is 1.18

ok, i think i found the instructions to build and install gstreamer from source will try it out later.

@henri

Have you made any progress on this issue?
Has it been resolved?

I will try out the possible fix today/tomorrow. My plan is:

$ apt-cache depends libqt5multimedia5-plugins
libqt5multimedia5-plugins
Depends: libqt5multimedia5
Depends: libasound2
Depends: libc6
Depends: libglib2.0-0
Depends: libgstreamer-plugins-base1.0-0
Depends: libgstreamer1.0-0
Depends: libpulse0
Depends: libqt5core5a
|Depends: libqt5gui5
Depends: libqt5gui5-gles
Depends: libqt5multimediagsttools5
Depends: libqt5network5
Depends: libstdc++6

This means i have to

  1. Remove libraries
    sudo apt-get remove libqt5multimedia5-plugins
    sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0 libgstreamermm-1.0
    just in case
    sudo apt-get remove libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamermm-1.0-dev
  2. Build and install gstreamer 1.22.1 from source following this guide in README:
    Files · 1.22.1 · GStreamer / gstreamer · GitLab
  3. Install the libq5multimedia5-plugins again
    sudo apt-get install libqt5multimedia5-plugins

Will let you know if it worked.

So this is where im at right now

sudo apt-get remove libqt5multimedia5-plugins
sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0 libgstreamermm-1.0

Just in case

sudo apt-get remove libgstreamer*

VERY IMPORTNANT TO INSTALL meson as root otherwise will get build issue

$sudo pip3 install meson
$sudo pip3 install markdow typogrify
$sudo apt-get update
$sudo apt-get install ninja-build
$sudo apt install -y build-essential autotools-dev automake autoconf
libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev
pkg-config bison flex python3 git gtk-doc-tools libasound2-dev
libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev
libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes
libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev
libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev
libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev
libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev
libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev
libcurl4-gnutls-dev libdca-dev libdvdnav-dev \

Make sure to get the tarball because checkout out 1.22.1 tag from git gave me problems i could not resolve.

$wget https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.21.1/gstreamer-1.21.1.tar.gz
$tar -xf gstreamer-1.21.1.tar.gz
$cd gstreamer-1.21.1.tar.gz

FFmpeg didnt compile on my RPI4 (32-it OS), so to disable it cause got some ARMv proessor arhcitecture errors.

$meson builddir -Dgst-plugins-base:gl_winsys=egl -Dlibav=disabled
$ninja -C builddir
$meson setup builddir
$meson compile -C buildir

$sudo meson install -C builddir$ gst-launch-1.0 --version
gst-launch-1.0: error while loading shared libraries: libgstreamer-1.0.so.0: cannot open shared object file: No such file or directory

$sudo gedit /etc/ld.so.conf.d/randomLibs.conf
#add this line to the file or if the ibgstreamer-1.0.so.0 was installed somewhere else add that path
/usr/local/lib/arm-linux-gnueabihf
sudo ldconfig

$gst-launch-1.0 --version
gst-launch-1.0 version 1.21.1
GStreamer 1.21.1
Unknown package origin

When i try to run my app that uses QCamera this is the error i get:

Error: cannot create camera service, the ‘camerabin’ plugin is missing for GStreamer 1.18.
Please install the ‘bad’ GStreamer plugin package.

I will now try to compile and install the bad plugin package with -Dbad=enabled. But im not sure if it will fix this because it seems to me that when i install sudo apt-get install qtmultimedia5-dev this will automatically install and try to use the 1.18 gstreamer - this is what i conclude from that error message.

$meson builddir --reconfigure -Dbad=enabled -Dgst-plugins-base:gl_winsys=egl,wayland -Dlibav=disabled -Dgst-plugins-bad:camerabin2=enabled
$meson compile -C builddir
$meson install -C builddir

And now my QCamera app cant even detect the camera… . Before this it would detect and camera would at least make a sound. but its silent now.

Can you reccommend me some other class I could use for this camera? I see some people have used the qcam code from lib-camera. Anybody have a working project setup with that code?

All i need is to have the cameras to be able to capture pictures and control zoom from my Qt application.

I think ill try next to bring the fix commited to 1.22.1 into 1.18 gstreamer and build it from source with just that fix. cause its really just changing one row in 1 file.

@henri

I don’t know enough about GStreamer

But if you want to try this, I can give you some advice.

If you want to use qcam, it only takes a few steps

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
./install_pivariety_pkgs.sh -p libcamera
./install_pivariety_pkgs.sh -p libcamera_apps
./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver

then use direct

qcam

I have also written some examples about taking pictures.

Tx, but what i will need to do is to take this QT C++ code from qcam\apps\src - libcamera/libcamera.git - libcamera official repository and put into my QT C++ app. Just a small problem is that if i build libcamera from source i do it with meson, but my application uses qmake so combining the two codebases might not be a trivial task.

So I just found out that the fix in gstreamer 1.22.1 that makes camera work with Qt is just one line in gstreamer source code. What i will try next is to check out gstreamer 1.18 source code, put that fix in it, compile and install since my qt app was able to reqonize camera when gstreamer 1.18 was installed. This is the fix if im not mistaken: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/67df248270491116af6099bf3bec5c740dfe3042

This fix didnt work out. It was either the qt plugin didnt use it, this fix wasnt enough. Theres a lot of files had changed from 1.18.6 to 1.22.1 but i think i succeeded carrying that fix over. This is what i did:

# On my Ubuntu 22.04 PC
wget https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2022-01-28/2022-01-28-raspios-bullseye-armhf.zip
git clone https://github.com/raspberrypi/usbboot.git
cd usbboot
# Flip the BOOT switch on RPI to ON
sudo ./rpiboot
wget https://github.com/balena-io/etcher/releases/download/v1.18.4/balenaEtcher-1.18.4-x64.AppImage
chmod +x balenaEtcher-1.18.4-x64.AppImage
./balenaEtcher-1.18.4-x64.AppImage
# Flashed to my RPi4 CM4


# On my RPI4 CM4
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
2. Install libcamra-dev
./install_pivariety_pkgs.sh -p libcamera_dev
3. Install libcamera-apps
./install_pivariety_pkgs.sh -p libcamera_apps
4. Install the kernel driver
./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver
5. Configuration
Open /boot/config.txt, under [all], add the following line:
dtoverlay=vc4-kms-v3d,cma-512
Example:
[all]
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=vc4-kms-v3d,cma-512
# Enabled i2c under interfaces
sudo raspi-config
reboot

# Compiling gstreamer 1.18
sudo pip3 install meson
sudo apt-get update
# have to use gst-build for v<19 https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-meson.html?gi-language=c
git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git
cd gst-build
$sudo apt install -y  build-essential autotools-dev automake autoconf \
                                    libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \
                                    pkg-config bison flex python3 git gtk-doc-tools libasound2-dev \
                                    libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \
                                    libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \
                                    libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \
									libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \
                                    libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \
                                    libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \
                                    libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \
                                    libcurl4-gnutls-dev libdca-dev libdvdnav-dev \
meson build --buildtype=release -Dgst-plugins-good:qt5=disabled -Dbad=enabled -Dgst-plugins-base:gl_winsys=egl -Dlibav=disabled -Dgst-plugins-bad:camerabin2=enabled

# At this point i installed gstreamer tools to see if standalone gstreamer tools will play my cameras
# install a missing dependency
$ sudo apt-get install libx264-dev libjpeg-dev
# install the remaining plugins
$ sudo apt-get install libgstreamer1.0-dev \
     libgstreamer-plugins-base1.0-dev \
     libgstreamer-plugins-bad1.0-dev \
     gstreamer1.0-plugins-ugly \
     gstreamer1.0-tools \
     gstreamer1.0-gl \
     gstreamer1.0-gtk3 

# Confirmed that current standalone gsteamer plays video. 
gst-launch-1.0 libcamerasrc ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! videoscale ! clockoverlay time-format="%D %H:%M:%S" ! autovideosink

# This made me curious to install qt and try to run camera example project to confirm it dosent work before i try to compile & install the 1.18.6 version
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools 
sudo apt-get install cmake
sudo apt-get install clan
sudo apt-get install qtmultimedia5-dev 
sudo apt-get install qtcreator
~/Qt/5.14.2/Examples/Qt-5.14.2$ scp -r multimediawidgets [email protected]:/home/pi/Desktop/Examples
~/Qt/5.14.2/Examples/Qt-5.14.2$ scp -r multimediawidgets [email protected]:/home/pi/Desktop/multimedia

# Built and compiled the Examples/camera in qtcreator but got error "CameraService is missing"
sudo apt-get install libqt5multimedia5-plugins

# Now i get the CameraBin error: "Failed to allocate memory". So proceed with meson compilation

# I also checked the version of different gstreamer libraries/tools i currenlty have installed
[email protected]:~/devdirs/gst-1.18.6/gst-build $ dpkg -l | grep gstream*
ii  gir1.2-gstreamer-1.0:armhf             1.18.4-2.1                       armhf        GObject introspection data for the GStreamer library
ii  gstreamer1.0-alsa:armhf                1.18.4-2                         armhf        GStreamer plugin for ALSA
ii  gstreamer1.0-gl:armhf                  1.18.4-2                         armhf        GStreamer plugins for GL
ii  gstreamer1.0-gtk3:armhf                1.18.4-2+deb11u1+rpt1            armhf        GStreamer plugin for GTK+3
ii  gstreamer1.0-libav:armhf               1.18.4-3                         armhf        ffmpeg plugin for GStreamer
ii  gstreamer1.0-omx                       1.0.0.1-0+rpi12+jessiepmg        armhf        GStreamer OpenMAX plugins
ii  gstreamer1.0-plugins-bad:armhf         1.18.4-3                         armhf        GStreamer plugins from the "bad" set
ii  gstreamer1.0-plugins-base:armhf        1.18.4-2                         armhf        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-good:armhf        1.18.4-2                         armhf        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:armhf        1.18.4-2                         armhf        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-tools                     1.18.4-2.1                       armhf        Tools for use with GStreamer
ii  gstreamer1.0-x:armhf                   1.18.4-2                         armhf        GStreamer plugins for X11 and Pango
ii  libgstreamer-gl1.0-0:armhf             1.18.4-2                         armhf        GStreamer GL libraries
ii  libgstreamer-opencv1.0-0:armhf         1.18.4-3                         armhf        GStreamer OpenCV libraries
ii  libgstreamer-plugins-bad1.0-0:armhf    1.18.4-3                         armhf        GStreamer libraries from the "bad" set
ii  libgstreamer-plugins-bad1.0-dev:armhf  1.18.4-3                         armhf        GStreamer development files for libraries from the "bad" set
ii  libgstreamer-plugins-base1.0-0:armhf   1.18.4-2                         armhf        GStreamer libraries from the "base" set
ii  libgstreamer-plugins-base1.0-dev:armhf 1.18.4-2                         armhf        GStreamer development files for libraries from the "base" set
ii  libgstreamer1.0-0:armhf                1.18.4-2.1                       armhf        Core GStreamer libraries and elements
ii  libgstreamer1.0-dev:armhf              1.18.4-2.1                       armhf        GStreamer core development files
ii  libqt5gstreamer-1.0-0:armhf            1.2.0-5.1                        armhf        C++ bindings library for GStreamer with a Qt-style API - Qt 5 build

[email protected]:~/devdirs/gst-1.18.6/gst-build $ apt list | grep libqt5multimedia5-plugins
libqt5multimedia5-plugins/stable,now 5.15.2-3 armhf [installed]

# Compile 
[email protected]:~/devdirs/gst-1.18.6/gst-build $ cp subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c_backup
[email protected]:~/devdirs/gst-1.18.6/gst-build $ nano subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c

#Search for method gst_v4l2_object_stop and replace it with 
gboolean
gst_v4l2_object_stop (GstV4l2Object * v4l2object)
{
  GstBufferPool *pool;
  GST_DEBUG_OBJECT (v4l2object->dbg_obj, "stopping");

  if (!GST_V4L2_IS_OPEN (v4l2object))
    goto done;
  if (!GST_V4L2_IS_ACTIVE (v4l2object))
    goto done;

  pool = gst_v4l2_object_get_buffer_pool (v4l2object);
  if (pool) {
    if (!gst_v4l2_buffer_pool_orphan (v4l2object)) {
      GST_DEBUG_OBJECT (v4l2object->dbg_obj, "deactivating pool");
      gst_buffer_pool_set_active (pool, FALSE);

      {
        GstBufferPool *old_pool;
        GST_OBJECT_LOCK (v4l2object->element);
        old_pool = v4l2object->pool;
        v4l2object->pool = NULL;
        GST_OBJECT_UNLOCK (v4l2object->element);
        if (old_pool)
          gst_object_unref (old_pool);
      }
    }
    gst_object_unref (pool);
  }

  GST_V4L2_SET_INACTIVE (v4l2object);

done:
  return TRUE;
}

# Add gst_v4l2_object_get_buffer_pool methdo to the end of the file

GstBufferPool *
gst_v4l2_object_get_buffer_pool (GstV4l2Object * v4l2object)
{
  GstBufferPool *ret = NULL;

  g_return_val_if_fail (v4l2object != NULL, NULL);

  GST_OBJECT_LOCK (v4l2object->element);
  if (v4l2object->pool)
    ret = gst_object_ref (v4l2object->pool);
  GST_OBJECT_UNLOCK (v4l2object->element);

  return ret;
}

# Add this line to subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.h at the end of /* probing */ block 
GstBufferPool * gst_v4l2_object_get_buffer_pool (GstV4l2Object * v4l2object);

# Now compile gstreamer 1.18.6
ninja -C build
sudo ninja -C build install

[email protected]:~/devdirs/gst-1.18.6/gst-build $  dpkg -l | grep gstream*
ii  gir1.2-gstreamer-1.0:armhf             1.18.4-2.1                       armhf        GObject introspection data for the GStreamer library
ii  gstreamer1.0-alsa:armhf                1.18.4-2                         armhf        GStreamer plugin for ALSA
ii  gstreamer1.0-gl:armhf                  1.18.4-2                         armhf        GStreamer plugins for GL
ii  gstreamer1.0-gtk3:armhf                1.18.4-2+deb11u1+rpt1            armhf        GStreamer plugin for GTK+3
ii  gstreamer1.0-libav:armhf               1.18.4-3                         armhf        ffmpeg plugin for GStreamer
ii  gstreamer1.0-omx                       1.0.0.1-0+rpi12+jessiepmg        armhf        GStreamer OpenMAX plugins
ii  gstreamer1.0-plugins-bad:armhf         1.18.4-3                         armhf        GStreamer plugins from the "bad" set
ii  gstreamer1.0-plugins-base:armhf        1.18.4-2                         armhf        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-good:armhf        1.18.4-2                         armhf        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:armhf        1.18.4-2                         armhf        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-tools                     1.18.4-2.1                       armhf        Tools for use with GStreamer
ii  gstreamer1.0-x:armhf                   1.18.4-2                         armhf        GStreamer plugins for X11 and Pango
ii  libgstreamer-gl1.0-0:armhf             1.18.4-2                         armhf        GStreamer GL libraries
ii  libgstreamer-opencv1.0-0:armhf         1.18.4-3                         armhf        GStreamer OpenCV libraries
ii  libgstreamer-plugins-bad1.0-0:armhf    1.18.4-3                         armhf        GStreamer libraries from the "bad" set
ii  libgstreamer-plugins-bad1.0-dev:armhf  1.18.4-3                         armhf        GStreamer development files for libraries from the "bad" set
ii  libgstreamer-plugins-base1.0-0:armhf   1.18.4-2                         armhf        GStreamer libraries from the "base" set
ii  libgstreamer-plugins-base1.0-dev:armhf 1.18.4-2                         armhf        GStreamer development files for libraries from the "base" set
ii  libgstreamer1.0-0:armhf                1.18.4-2.1                       armhf        Core GStreamer libraries and elements
ii  libgstreamer1.0-dev:armhf              1.18.4-2.1                       armhf        GStreamer core development files
ii  libqt5gstreamer-1.0-0:armhf            1.2.0-5.1                        armhf        C++ bindings library for GStreamer with a Qt-style API - Qt 5 build

# So the packages i compiled were not replace with packages from remote repo i installed with apt-get
sudo apt-get remove gstreamer1.0-plugins-good

# Now when i do
[email protected]:~ $ gst-launch-1.0 --version
gst-launch-1.0 version 1.18.6
GStreamer 1.18.6
Unknown package origin

# But after that removal the gst-launch-1.0 cant play back camera anymore. Maybe it was my "fix" in code that broke it. Ill roll that back and rebuild
# So what i did now is that i uninstalled everything related to gstreamer
sudo apt-get remove libgstreamer* libqt5gstreamer* gstreamer1.0*

# I just try to make as full install as possible



Anyways at this point i give up and work on some other stuff. maybe over time somebody will fix it for qt5 or ill try to use libcamera instead of QCamera or ill see if my camera works in qt6.

I tried the steps you described but got error:
-bash: /usr/local/bin/qcam: No such file or directory

Also tried to build qcam from source, installed it and ran it from command line but got some errors about
arducam_64mp properties json

ok, the qcam with your script was installed to /usr/bin/qcam and it displays video. It works but the qcam i compile from source does not work with my camera. I tried both 0.0.4 and 0.0.1 versions. Can you tell me why?

when running qcam log i compiled from source:

[email protected]:/etc/ld.so.conf.d $ qcam
[0:32:25.424613004] [3172]  INFO Camera camera_manager.cpp:293 libcamera v0.0.1
[0:32:25.438259682] [3175]  WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for 'arducam_64mp'
[0:32:25.438362681] [3175]  WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[0:32:25.490249207] [3175] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'arducam_64mp.json' not found for IPA module 'raspberrypi'
[0:32:25.490527018] [3175] ERROR IPARPI raspberrypi.cpp:213 Could not create camera helper for arducam_64mp
[0:32:25.490659683] [3175] ERROR RPI raspberrypi.cpp:1256 Failed to load a suitable IPA library
[0:32:25.491975739] [3175] ERROR RPI raspberrypi.cpp:1187 Failed to register camera arducam_64mp 10-001a: -22
libpng warning: iCCP: known incorrect sRGB profile

meson log:

[email protected]:~/Desktop/libcamera $ meson builddir --reconfigure
The Meson build system
Version: 1.0.1
Source dir: /home/pi/Desktop/libcamera
Build dir: /home/pi/Desktop/libcamera/builddir
Build type: native build
Project name: libcamera
Project version: 0.0.1
C compiler for the host machine: cc (gcc 10.2.1 "cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: arm
Host machine cpu: armv7l
Header "unistd.h" has symbol "issetugid" : NO (cached)
Header "stdlib.h" has symbol "secure_getenv" : YES (cached)
Compiler for C supports arguments -Wno-c99-designator: NO (cached)
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency lttng-ust found: NO (tried pkgconfig and cmake)
Program ./parser.py found: YES (/home/pi/Desktop/libcamera/utils/ipc/./parser.py)
Program ./generate.py found: YES (/home/pi/Desktop/libcamera/utils/ipc/./generate.py)
Program ./extract-docs.py found: YES (/home/pi/Desktop/libcamera/utils/ipc/./extract-docs.py)
Program ./gen-tp-header.py found: YES (/home/pi/Desktop/libcamera/utils/tracepoints/./gen-tp-header.py)
Configuring version.h using configuration
Program openssl found: YES (/usr/bin/openssl)
Library atomic found: YES
Dependency threads found: YES unknown (cached)
Run-time dependency libdw found: NO (tried pkgconfig and cmake)
Run-time dependency libunwind found: NO (tried pkgconfig and cmake)
Header "execinfo.h" has symbol "backtrace" : YES (cached)
Library dl found: YES
Run-time dependency libudev found: NO (tried pkgconfig and cmake)
Run-time dependency yaml-0.1 found: NO (tried pkgconfig and cmake)
Run-time dependency gnutls found: NO (tried pkgconfig and cmake)
Dependency libcrypto found: YES 1.1.1n (cached)

Executing subproject libyaml method cmake 

libyaml| Found CMake: /usr/bin/cmake (3.18.4)

| Configuring the build directory with CMake version 3.18.4
| Running CMake with: -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|   - build directory:          /home/pi/Desktop/libcamera/builddir/subprojects/libyaml/__CMake_build
|   - source directory:         /home/pi/Desktop/libcamera/subprojects/libyaml
|   - toolchain file:           /home/pi/Desktop/libcamera/builddir/subprojects/libyaml/__CMake_build/CMakeMesonToolchainFile.cmake
|   - preload file:             /usr/local/lib/python3.9/dist-packages/mesonbuild/cmake/data/preload.cmake
|   - trace args:               --trace-expand --trace-format=json-v1 --no-warn-unused-cli --trace-redirect=cmake_trace.txt
|   - disabled policy warnings: [CMP0025, CMP0047, CMP0056, CMP0060, CMP0065, CMP0066, CMP0067, CMP0082, CMP0089, CMP0102]

| Running with expanded trace output on.
| Not searching for unused variables given on the command line.
| Trace will be written to cmake_trace.txt
| -- The C compiler identification is GNU 10.2.1
| -- Detecting C compiler ABI info
| -- Detecting C compiler ABI info - done
| -- Check for working C compiler: /usr/bin/cc - skipped
| -- Detecting C compile features
| -- Detecting C compile features - done
| -- Configuring done
| -- Generating done
| -- Build files have been written to: /home/pi/Desktop/libcamera/builddir/subprojects/libyaml/__CMake_build

libyaml| CMake configuration: SUCCEEDED
libyaml| CMake project yaml has 42 build targets.

cmake-ast| Processing generated meson AST
cmake-ast| Build file: /home/pi/Desktop/libcamera/builddir/subprojects/libyaml/meson.build

libyaml| Project name: yaml
libyaml| Project version: undefined
libyaml| C compiler for the host machine: cc (gcc 10.2.1 "cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
libyaml| C linker for the host machine: cc ld.bfd 2.35.2
libyaml| Build targets in project: 80
libyaml| Subproject libyaml finished.


Dependency libexif skipped: feature android disabled
Dependency libjpeg skipped: feature android disabled
Run-time dependency libevent_pthreads found: NO (tried pkgconfig and cmake)
Run-time dependency GTest found: NO (tried pkgconfig and system)
Looking for a fallback subproject for the dependency gtest

Executing subproject gtest 

gtest| Project name: gtest
gtest| Project version: 1.11.0
gtest| C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
gtest| C++ linker for the host machine: c++ ld.bfd 2.35.2
gtest| Dependency threads found: YES unknown (cached)
gtest| Dependency threads found: YES unknown (cached)
gtest| Dependency threads found: YES unknown (cached)
gtest| Dependency threads found: YES unknown (cached)
gtest| Build targets in project: 102
gtest| Subproject gtest finished.

Dependency gtest from subproject subprojects/googletest-release-1.11.0 found: YES 1.11.0
Run-time dependency libevent_pthreads found: NO (tried pkgconfig and cmake)
Dependency qt5 (modules: Core, Gui, Widgets) found: YES 5.15.2 (cached)
Run-time dependency libtiff-4 found: NO (tried pkgconfig and cmake)
Header "QOpenGLWidget" has symbol "QOpenGLWidget" with dependencies Qt5Core, Qt5Core, Qt5Gui, Qt5Widgets: YES (cached)
Detecting Qt5 tools
Run-time dependency qt5 (modules: Core) found: YES 5.15.2 (pkg-config)
Program /usr/lib/arm-linux-gnueabihf/qt5/bin/moc found: YES 5.15.2 (/usr/lib/arm-linux-gnueabihf/qt5/bin/moc)
Program /usr/lib/arm-linux-gnueabihf/qt5/bin/uic found: YES 5.15.2 (/usr/lib/arm-linux-gnueabihf/qt5/bin/uic)
Program /usr/lib/arm-linux-gnueabihf/qt5/bin/rcc found: YES 5.15.2 (/usr/lib/arm-linux-gnueabihf/qt5/bin/rcc)
Program /usr/lib/arm-linux-gnueabihf/qt5/bin/lrelease found: NO
Program lrelease5 found: NO
Program lrelease-qt5 found: NO
Program lrelease found: NO found  but need: '== 5.15.2' (/usr/bin/lrelease)
Dependency glib-2.0 found: YES 2.66.8 (cached)
Run-time dependency gstreamer-video-1.0 found: NO (tried pkgconfig and cmake)
Run-time dependency gstreamer-allocators-1.0 found: NO (tried pkgconfig and cmake)
Dependency python3 skipped: feature pycamera disabled
Program doxygen found: NO
Program dot found: NO
Program sphinx-build-3 found: NO
Program sphinx-build found: NO
Configuring config.h using configuration
Program python3 (jinja2, ply, jinja2, yaml) found: YES (/usr/bin/python3) modules: jinja2, ply, jinja2, yaml
Build targets in project: 105

libcamera 0.0.1

  Versions
    Sources                  : 0.0.1

  Paths
    LIBCAMERA_DATA_DIR       : "/usr/local/share/libcamera"
    LIBCAMERA_SYSCONF_DIR    : "/usr/local/etc/libcamera"
    IPA_PROXY_DIR            : "/usr/local/libexec/libcamera"
    IPA_CONFIG_DIR           : "/usr/local/etc/libcamera/ipa:/usr/local/share/libcamera/ipa"
    IPA_MODULE_DIR           : "/usr/local/lib/arm-linux-gnueabihf/libcamera"

  Configuration
    Enabled pipelines        : ipu3
                               raspberrypi
                               rkisp1
                               simple
                               uvcvideo
                               vimc
    Enabled IPA modules      : ipu3
                               raspberrypi
                               rkisp1
                               vimc
    Tracing support          : NO
    Android support          : NO
    GStreamer support        : NO
    Python bindings          : NO
    V4L2 emulation support   : NO
    cam application          : NO
    qcam application         : YES
    lc-compliance application: NO
    Unit tests               : NO

  Subprojects
    gtest                    : YES
    libyaml                  : YES

Found ninja-1.10.1 at /usr/bin/ninja
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

ninja log:

[email protected]:~/Desktop/libcamera $ ninja -C builddir
ninja: Entering directory `builddir'
[16/233] Generating src/ipa-priv-key with a custom command
....................................+++++
.......+++++
[63/233] Generating src/libcamera/ipa_pub_key_cpp with a custom command
writing RSA key
[233/233] Linking target src/qcam/qcam
[email protected]:~/Desktop/libcamera $ sudo nina -C builddir install
sudo: nina: command not found
[email protected]:~/Desktop/libcamera $ sudo ninja -C builddir install
ninja: Entering directory `builddir'
[1/2] Installing files.
Installing include/libcamera/ipa/core_ipa_interface.h to /usr/local/include/libcamera/libcamera/ipa
Installing include/libcamera/ipa/ipu3_ipa_interface.h to /usr/local/include/libcamera/libcamera/ipa
Installing include/libcamera/ipa/raspberrypi_ipa_interface.h to /usr/local/include/libcamera/libcamera/ipa
Installing include/libcamera/ipa/rkisp1_ipa_interface.h to /usr/local/include/libcamera/libcamera/ipa
Installing include/libcamera/ipa/vimc_ipa_interface.h to /usr/local/include/libcamera/libcamera/ipa
Installing include/libcamera/control_ids.h to /usr/local/include/libcamera/libcamera
Installing include/libcamera/property_ids.h to /usr/local/include/libcamera/libcamera
Installing include/libcamera/formats.h to /usr/local/include/libcamera/libcamera
Installing include/libcamera/libcamera.h to /usr/local/include/libcamera/libcamera
Installing src/libcamera/base/libcamera-base.so.0.0.1 to /usr/local/lib/arm-linux-gnueabihf
Installing subprojects/libyaml/libyaml.a to /usr/local/lib
Installing src/libcamera/libcamera.so.0.0.1 to /usr/local/lib/arm-linux-gnueabihf
Installing src/libcamera/proxy/worker/ipu3_ipa_proxy to /usr/local/libexec/libcamera
Installing src/libcamera/proxy/worker/raspberrypi_ipa_proxy to /usr/local/libexec/libcamera
Installing src/libcamera/proxy/worker/rkisp1_ipa_proxy to /usr/local/libexec/libcamera
Installing src/libcamera/proxy/worker/vimc_ipa_proxy to /usr/local/libexec/libcamera
Installing src/ipa/ipu3/ipa_ipu3.so to /usr/local/lib/arm-linux-gnueabihf/libcamera
Installing src/ipa/raspberrypi/ipa_rpi.so to /usr/local/lib/arm-linux-gnueabihf/libcamera
Installing src/ipa/rkisp1/ipa_rkisp1.so to /usr/local/lib/arm-linux-gnueabihf/libcamera
Installing src/ipa/vimc/ipa_vimc.so to /usr/local/lib/arm-linux-gnueabihf/libcamera
Installing src/qcam/qcam to /usr/local/bin
Installing /home/pi/Desktop/libcamera/include/libcamera/base/backtrace.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/bound_method.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/class.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/compiler.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/event_dispatcher.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/event_dispatcher_poll.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/event_notifier.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/file.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/flags.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/log.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/message.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/mutex.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/object.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/private.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/semaphore.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/shared_fd.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/signal.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/span.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/thread.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/thread_annotations.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/timer.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/unique_fd.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/base/utils.h to /usr/local/include/libcamera/libcamera/base
Installing /home/pi/Desktop/libcamera/include/libcamera/ipa/ipa_controls.h to /usr/local/include/libcamera/libcamera/ipa
Installing /home/pi/Desktop/libcamera/include/libcamera/ipa/ipa_interface.h to /usr/local/include/libcamera/libcamera/ipa
Installing /home/pi/Desktop/libcamera/include/libcamera/ipa/ipa_module_info.h to /usr/local/include/libcamera/libcamera/ipa
Installing /home/pi/Desktop/libcamera/include/libcamera/camera.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/camera_manager.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/color_space.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/controls.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/fence.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/framebuffer.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/framebuffer_allocator.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/geometry.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/logging.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/pixel_format.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/request.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/stream.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/include/libcamera/transform.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/builddir/include/libcamera/version.h to /usr/local/include/libcamera/libcamera
Installing /home/pi/Desktop/libcamera/builddir/meson-private/libcamera-base.pc to /usr/local/lib/arm-linux-gnueabihf/pkgconfig
Installing /home/pi/Desktop/libcamera/builddir/meson-private/libcamera.pc to /usr/local/lib/arm-linux-gnueabihf/pkgconfig
Installing /home/pi/Desktop/libcamera/src/ipa/ipu3/data/uncalibrated.yaml to /usr/local/share/libcamera/ipa/ipu3
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx219.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx219_noir.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx290.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx296.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx296_mono.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx378.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx477.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx477_noir.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/imx519.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/ov5647.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/ov5647_noir.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/ov9281.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/se327m12.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/raspberrypi/data/uncalibrated.json to /usr/local/share/libcamera/ipa/raspberrypi
Installing /home/pi/Desktop/libcamera/src/ipa/rkisp1/data/imx219.yaml to /usr/local/share/libcamera/ipa/rkisp1
Installing /home/pi/Desktop/libcamera/src/ipa/rkisp1/data/ov5640.yaml to /usr/local/share/libcamera/ipa/rkisp1
Installing /home/pi/Desktop/libcamera/src/ipa/rkisp1/data/uncalibrated.yaml to /usr/local/share/libcamera/ipa/rkisp1
Installing /home/pi/Desktop/libcamera/src/ipa/vimc/data/vimc.conf to /usr/local/share/libcamera/ipa/vimc
Installing symlink pointing to libcamera-base.so.0.0.1 to /usr/local/lib/arm-linux-gnueabihf/libcamera-base.so
Installing symlink pointing to libcamera.so.0.0.1 to /usr/local/lib/arm-linux-gnueabihf/libcamera.so
Running custom install script '/home/pi/Desktop/libcamera/src/ipa/ipa-sign-install.sh /home/pi/Desktop/libcamera/builddir/src/ipa-priv-key.pem lib/arm-linux-gnueabihf/libcamera/ipa_ipu3.so lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so lib/arm-linux-gnueabihf/libcamera/ipa_rkisp1.so lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so'
[email protected]:~/Desktop/libcamera $ 

Can you please post what does your meson log look like?

Also i get the following error when i try to run your python examples:

[email protected]:~/Desktop/picamera2_examples $ python3 SavePng.py
Traceback (most recent call last):
  File "/home/pi/Desktop/picamera2_examples/SavePng.py", line 5, in <module>
    from picamera2 import Picamera2, Preview
  File "/home/pi/.local/lib/python3.9/site-packages/picamera2/__init__.py", line 5, in <module>
    from .picamera2 import Picamera2, Preview
  File "/home/pi/.local/lib/python3.9/site-packages/picamera2/picamera2.py", line 22, in <module>
    from picamera2.previews import DrmPreview, NullPreview, QtGlPreview, QtPreview
  File "/home/pi/.local/lib/python3.9/site-packages/picamera2/previews/__init__.py", line 1, in <module>
    from .drm_preview import DrmPreview
  File "/home/pi/.local/lib/python3.9/site-packages/picamera2/previews/drm_preview.py", line 6, in <module>
    import pykms
  File "/usr/lib/python3/dist-packages/pykms/__init__.py", line 1, in <module>
    from .pykms import *
ImportError: /lib/arm-linux-gnueabihf/libkms++.so.0: undefined symbol: drmModeGetFB2
[email protected]:~/Desktop/picamera2_examples $ /libkms++.so.0: undefined symbol: drmModeGetFB2

I have 32-bit bullseye, kernel 5.10.something, RPI4 CM4

@henri

Are you using our github repository

I tested the manual compilation in the afternoon and found no problems.