183e37362f57ff3ce7493abf0bc6f1b57b931f55
This release brings 142 commits with the largest developments in the core of
libcamera components. Perhaps the most obvious is that we now use C++20 for the
project. The Configuration file handling has had a substantial rework with
updates to the yaml_parser.
The RKISP1 IPA has now added a new Hue control which brought with it a rework
of how we manage fixed point arithmetic with the Quantized class. I hope this
makes it easier to convey types with hardware operations.
The SoftISP has the ability to perform CPU debaying with multiple threads which
helps throughput on platforms such as the Arduino Uno Q.
The Mali-C55 pipeline handler now has full support for the RZG2LCRU and inline
handling which enables camera support on the Renesas RZ/V2H and RZ/V2NP
platforms.
And of interest in the apps components, the gstreamer plugin now has the
ability to select and configure the sensor mode configuration properties.
Finally a new script "libcamera-bug-report" is available to be packaged which
will help users identify issues when reporting bugs.
Contributors:
64 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
28 Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
21 Kieran Bingham <kieran.bingham@ideasonboard.com>
8 Hans de Goede <johannes.goede@oss.qualcomm.com>
7 Jacopo Mondi <jacopo.mondi@ideasonboard.com>
3 David Plowman <david.plowman@raspberrypi.com>
3 Milan Zamazal <mzamazal@redhat.com>
3 Naushir Patuck <naush@raspberrypi.com>
2 Stefan Klug <stefan.klug@ideasonboard.com>
1 Daniel Scally <dan.scally@ideasonboard.com>
1 Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
1 van Veen, Stephan <stephan.vanveen@karlstorz.com>
142 commits, 319 files changed, 5346 insertions(+), 8486 deletions(-)
Integration Overview:
ABI:
The abi-compliance checker reports 100% compatibility in this release,
so the SONAME is maintained at 0.7.
Validating ABI compatibility between v0.7.0 and v0.7.1
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0
The following commits in this release relate to either a bug fix or an
improvement to an existing commit.
bugs:
- libcamera: converter: converter_dw100_vertexmap: Fix dewarp parameter p2 handling
- Fixes: 1784e08be3 ("libcamera: dw100_vertexmap: Implement parametric dewarping")
- py: Disable `-Winvalid-offsetof`
- Link: https://github.com/pybind/pybind11/pull/5824
- libcamera: software_isp: Set initial values of DebayerParams
- Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/311
- py: Fix include order
- Link: https://github.com/python/cpython/issues/61322
- ipa: simple: Fix `again10` value with sensor helper
- Fixes: 950ca85e8a ("ipa: software_isp: AGC: Do not lower gain below 1.0")
- apps: qcam: Fix clang build
- Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/315
- apps: qcam: Show `QImageWriter` errors
- Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/313
- gstreamer: Add `-Wno-volatile` for GCC
- Link: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
- treewide: Use character literal instead of string in some cases
- Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
- Documentation: Enable treeview generation for doxygen < 1.13.0
- Fixes: 42d914f20c ("Documentation: Enable doxygen-awesome-css")
- gstreamer: Add sensor-config property
- Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/300
- utils: update-kernel-headers: Fix destination path
- Fixes: ee8f88fc64 ("include: linux: Add v4l2-isp.h")
- libcamera: egl: Remove `eGLImage::image_`
- Fixes: f520b29fe9 ("libcamera: software_isp: debayer_egl: Add an eGL Debayer class")
- libcamera: pipeline: rkisp1: Fix buffer queue memleaks
- Fixes: c8f63760e5 ("pipeline: rkisp1: Support raw Bayer capture at runtime")
- ipa: rpi: awb_nn: Rename YamlObject to ValueNode
- Fixes: 554c5c7fa1 ("libcamera: Rename YamlObject to ValueNode")
And the following updates have been made in this release, grouped by category:
core:
- libcamera: base: Add missing `private.h` includes
- meson: Add `libdw` option to control libdw dependency
- libcamera: converter: converter_dw100_vertexmap: Fix dewarp parameter p2 handling
- libcamera: controls: Define a new core Hue control
- libcamera: Replace iterators with structured bindings
- libcamera: Replace iterators with range-based for loops
- libcamera: Use `it` variable name for iterators only
- libcamera: Standardize on 'const auto'
- libcamera: rpi: Make the controller min frame duration configurable
- utils: Add missing SPDX headers to scripts
- meson: Ignore `Wredundant-move` with GCC 11 and above
- libcamera: base: log: Ignore deprecations
- treewide: Use character literal instead of string in some cases
- meson: Switch to C++20
- meson: Add options to control drm, sdl2, jpeg dependencies of `cam`
- meson: Add `apps-output-dng` option to control libtiff dependency
- meson: Drop unnecessary egl, gles feature defines
- meson: Add `egl.cpp` to sources alongside `debayer_egl.cpp`
- meson: Simplify condition
- meson: Remove `gles_headless_enabled`
- meson: Use dependency object when checking for headers
- meson: Move egl related dependencies to `software_isp` subdir
- meson: Guard softisp gpu acceleration with feature option: softisp-gpu
- utils: raspberrypi: Remove Raspberry Pi CTT from the source tree
- utils: raspberrypi: Add a README.md to the old RPi CTT directory
- libcamera: Make converter/softISP configure()'s outputCfgs argument really const
- utils: Introduce libcamera-bug-report
- libcamera: properties: Add a pipeline handler name property
- libcamera: camera: Report the pipeline handler name
- subprojects: Add nlohmann_json to .gitignore
- reuse: Convert to REUSE.toml
- reuse: Update file paths in REUSE.toml
- reuse: Drop unnecessary entry from REUSE.toml
- reuse: Add missing files to REUSE.toml
- libcamera: Add missing SPDX headers
- libcamera: rpi: Add missing SPDX headers
- include: linux: Convert drm_fourcc.h to use SPDX
- meson: Print soft ISP boolean options as YES/NO
- meson: Print missing application options in summary
- utils: update-kernel-headers: Fix destination path
- meson: Use <version> header for C++ library version check
- libcamera: egl: Remove `eGLImage::image_`
- utils: checkstyle: Add license commit checker
- libcamera: Drop unneeded usage of this pointer
- libcamera: Replace plain pointers with std::unique<>
- libcamera: pipeline_handler: Add createIPA() function
- libcamera: camera_manager: Move IPAManager creation to start() time
- libcamera: utils: Add overloaded visitor helpers
- libcamera: yaml_parser: Use std::make_unique<>
- libcamera: yaml_parser: Rename Container to ValueContainer
- libcamera: yaml_parser: Rename Getter to Accessor
- libcamera: yaml_parser: Replace getList() with get() specializations
- libcamera: yaml_parser: Add function to set a YamlObject value
- libcamera: yaml_parser: Add functions to add children
- libcamera: yaml_parser: Un-friend YamlParserContext from YamlObject
- libcamera: yaml_parser: Move Size handling to geometry.cpp
- libcamera: yaml_parser: Drop unneeded \fn Doxygen commands
- libcamera: yaml_parser: Split YamlObject from YamlParser
- libcamera: yaml_object: Miscellaneous documentation improvements
- libcamera: Rename YamlObject to ValueNode
- libcamera: value_node: Add constructor with value
- libcamera: value_node: Rework templates to prepare for mutable views
- libcamera: value_node: Add mutable adapters
- libcamera: value_node: Add mutable children accessors
- libcamera: value_node: Support adding nested children in one operation
- libcamera: value_node: Support looking up descendant node by path
- libcamera: value_node: Add functions to erase child nodes
- libcamera: Pass CameraManager around instead of GlobalConfiguration
- libcamera: global_configuration: Reorder functions
- libcamera: global_configuration: Add missing include and comment
- libcamera: global_configuration: Rename yamlConfiguration_
- libcamera: global_configuration: Rename Configuration to Option
- libcamera: global_configuration: Drop Option type
- libcamera: global_configuration: Populate empty configuration
- libcamera: global_configuration: Override options with environment variables
ipa:
- libcamera: ipa: simple: Fix multiplication order in Awb
- ipa: rkisp1: Fix awb algorithm brief
- ipa: simple: Remove duplicate header inclusion
- ipa: libipa: Provide a Quantized data type support
- ipa: libipa: fixedpoint: Fix unsigned usage
- ipa: libipa: Provide fixed point quantized traits
- ipa: rkisp1: cproc: Convert to use Quantized types
- ipa: rkisp1: cproc: Report metadata
- ipa: rkisp1: cproc: Provide a Hue control
- ipa: rkisp1: ccm: Use Q<4, 7> format directly
- ipa: mali-c55: Reduce AWB calculations to float precision
- ipa: mali-c55: Convert AWB to UQ<4, 8> usage
- ipa: mali-c55: agc: Quantise the ISP Digital Gain
- ipa: libipa: fixedpoint: Move float conversion inline
- ipa: rpi: awb_nn: Remove unused constexpr variable
- ipa: simple: Fix `again10` value with sensor helper
- ipa: libipa: quantized: Enable `constexpr` operation
- ipa: rpi: Fix gamma lookup table generation for PiSP platform
- utils: ipc: extract-docs: Work around reuse tool problem
- ipa: rpi: awb_nn: Rename YamlObject to ValueNode
pipeline:
- libcamera: software_isp: debayer: Take `DebayerParams` by ref
- libcamera: software_isp: Remove redundant include of time.h
- libcamera: software_isp: Fix LIBCAMERA_SOFTISP_MODE log print
- libcamera: software_isp: debayer_egl: Remove `frameSize()`
- libcamera: software_isp: Set initial values of DebayerParams
- libcamera: software_isp: Convert TODO list to markdown
- libcamera: software_isp: Move GPU TODO items to TODO.md
- libcamera: software_isp: debayer: Add missing `override`
- libcamera: software_isp: debayer_egl: Remove unnecessary declarations
- libcamera: pipeline: rkisp1: Fix buffer queue memleaks
- libcamera: mali-c55: Add RZG2LCRU class
- libcamera: mali-c55: Split TPG and Inline camera handling
- libcamera: mali-c55: Register memory input camera
- libcamera: mali-c55: Configure camera in memory-to-memory
- libcamera: mali-c55: Do not rely on bufferCount
- libcamera: mali-c55: Implement capture for memory-to-memory
- libcamera: mali-c55: Fix sensor size computation
test:
- test: Remove uses of `O_TMPFILE`
- test: libipa: Add tests for Quantized types
- test: libipa: Provide FixedPoint Quantized tests
- test: libipa: Remove legacy fixed point conversion test
- test: ipa: ipa_interface: Use IPAManager::createIPA()
- test: ipa: ipa_interface: Replace FIFO with pipe
- test: Add ValueNode unit test
- test: yaml-parser: Simplify test
- test: yaml-parser: Standardize on explicitly qualifying std namespace
- test: yaml-parser: Fix typos in error messages
- test: yaml-parser: Replace "object" with "node"
softisp:
- software_isp: benchmark: Add missing _ postfix to measure data member
- software_isp: benchmark: Print what is being benchmarked
- software_isp: swstats_cpu: Prepare for multi-threading support
- software_isp: debayer_cpu: Add DebayerCpuThread class
- software_isp: debayer_cpu: Add multi-threading support
- software_isp: Log input config from configure()
apps:
- android: camera_stream: Include <poll.h> instead of <sys/poll.h>
- py: Disable `-Winvalid-offsetof`
- py: Fix include order
- apps: qcam: Fix clang build
- apps: qcam: Show `QImageWriter` errors
- gstreamer: Add `-Wno-volatile` for GCC
- cam: Add option to report libcamera version
- gstreamer: Add sensor-config property
documentation:
- Documentation/runtime_configuration: Add missing software_isp.mode doc
- Documentation: Enable treeview generation for doxygen < 1.13.0
- Documentation: Update to C++20
- Documentation: Rename runtime configuration title
tuning:
- tuning: Handle macbeth_ref.pgm license through REUSE.toml
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
.. SPDX-License-Identifier: CC-BY-SA-4.0
===========
libcamera
===========
**A complex camera support library for Linux, Android, and ChromeOS**
Cameras are complex devices that need heavy hardware image processing
operations. Control of the processing is based on advanced algorithms that must
run on a programmable processor. This has traditionally been implemented in a
dedicated MCU in the camera, but in embedded devices algorithms have been moved
to the main CPU to save cost. Blurring the boundary between camera devices and
Linux often left the user with no other option than a vendor-specific
closed-source solution.
To address this problem the Linux media community has very recently started
collaboration with the industry to develop a camera stack that will be
open-source-friendly while still protecting vendor core IP. libcamera was born
out of that collaboration and will offer modern camera support to Linux-based
systems, including traditional Linux distributions, ChromeOS and Android.
.. section-begin-getting-started
Getting Started
---------------
To fetch the sources, build and install:
.. code::
git clone https://git.libcamera.org/libcamera/libcamera.git
cd libcamera
meson setup build
ninja -C build install
Dependencies
~~~~~~~~~~~~
The following Debian/Ubuntu packages are required for building libcamera.
Other distributions may have differing package names:
A C++ toolchain: [required]
Either {g++, clang}
Meson Build system: [required]
meson (>= 1.0.1) ninja-build pkg-config
for the libcamera core: [required]
libyaml-dev python3-yaml python3-ply python3-jinja2
for IPA module signing: [recommended]
Either libgnutls28-dev or libssl-dev, openssl
Without IPA module signing, all IPA modules will be isolated in a
separate process. This adds an unnecessary extra overhead at runtime.
for improved debugging: [optional]
libdw-dev libunwind-dev
libdw and libunwind provide backtraces to help debugging assertion
failures. Their functions overlap, libdw provides the most detailed
information, and libunwind is not needed if both libdw and the glibc
backtrace() function are available.
for device hotplug enumeration: [optional]
libudev-dev
for documentation: [optional]
doxygen graphviz python3-sphinx python3-sphinx-book-theme
python3-sphinxcontrib.doxylink (>= 1.6.1) texlive-latex-extra
for gstreamer: [optional]
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
for Python bindings: [optional]
libpython3-dev pybind11-dev
for cam: [optional]
libevent-dev is required to support cam, however the following
optional dependencies bring more functionality to the cam test
tool:
- libdrm-dev: Enables the KMS sink
- libjpeg-dev: Enables MJPEG on the SDL sink
- libsdl2-dev: Enables the SDL sink
- libtiff-dev: Enables writing DNG
for qcam: [optional]
libtiff-dev qt6-base-dev
for tracing with lttng: [optional]
liblttng-ust-dev python3-jinja2 lttng-tools
for android: [optional]
libexif-dev libjpeg-dev
for lc-compliance: [optional]
libevent-dev libgtest-dev
for abi-compat.sh: [optional]
abi-compliance-checker
Basic testing with cam utility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``cam`` utility can be used for basic testing. You can list the cameras
detected on the system with ``cam -l``, and capture ten frames from the first
camera and save them to disk with ``cam -c 1 --capture=10 --file``. See
``cam -h`` for more information about the ``cam`` tool.
In case of problems, a detailed debug log can be obtained from libcamera by
setting the ``LIBCAMERA_LOG_LEVELS`` environment variable:
.. code::
:~$ LIBCAMERA_LOG_LEVELS=*:DEBUG cam -l
Using GStreamer plugin
~~~~~~~~~~~~~~~~~~~~~~
To use the GStreamer plugin from the source tree, use the meson ``devenv``
command. This will create a new shell instance with the ``GST_PLUGIN_PATH``
environment set accordingly.
.. code::
meson devenv -C build
The debugging tool ``gst-launch-1.0`` can be used to construct a pipeline and
test it. The following pipeline will stream from the camera named "Camera 1"
onto the OpenGL accelerated display element on your system.
.. code::
gst-launch-1.0 libcamerasrc camera-name="Camera 1" ! queue ! glimagesink
To show the first camera found you can omit the camera-name property, or you
can list the cameras and their capabilities using:
.. code::
gst-device-monitor-1.0 Video
This will also show the supported stream sizes which can be manually selected
if desired with a pipeline such as:
.. code::
gst-launch-1.0 libcamerasrc ! 'video/x-raw,width=1280,height=720' ! \
queue ! glimagesink
The libcamerasrc element has two log categories, named libcamera-provider (for
the video device provider) and libcamerasrc (for the operation of the camera).
All corresponding debug messages can be enabled by setting the ``GST_DEBUG``
environment variable to ``libcamera*:7``.
Presently, to prevent element negotiation failures it is required to specify
the colorimetry and framerate as part of your pipeline construction. For
instance, to capture and encode as a JPEG stream and receive on another device
the following example could be used as a starting point:
.. code::
gst-launch-1.0 libcamerasrc ! \
video/x-raw,colorimetry=bt709,format=NV12,width=1280,height=720,framerate=30/1 ! \
queue ! jpegenc ! multipartmux ! \
tcpserversink host=0.0.0.0 port=5000
Which can be received on another device over the network with:
.. code::
gst-launch-1.0 tcpclientsrc host=$DEVICE_IP port=5000 ! \
multipartdemux ! jpegdec ! autovideosink
The GStreamer element also supports multiple streams. This is achieved by
requesting additional source pads. Downstream caps filters can be used
to choose specific parameters like resolution and pixel format. The pad
property ``stream-role`` can be used to select a role.
The following example displays a 640x480 view finder while streaming JPEG
encoded 800x600 video. You can use the receiver pipeline above to view the
remote stream from another device.
.. code::
gst-launch-1.0 libcamerasrc name=cs src::stream-role=view-finder src_0::stream-role=video-recording \
cs.src ! queue ! video/x-raw,width=640,height=480 ! videoconvert ! autovideosink \
cs.src_0 ! queue ! video/x-raw,width=800,height=600 ! videoconvert ! \
jpegenc ! multipartmux ! tcpserversink host=0.0.0.0 port=5000
.. section-end-getting-started
Troubleshooting
~~~~~~~~~~~~~~~
Several users have reported issues with meson installation, crux of the issue
is a potential version mismatch between the version that root uses, and the
version that the normal user uses. On calling `ninja -C build`, it can't find
the build.ninja module. This is a snippet of the error message.
::
ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory
This can be solved in two ways:
1. Don't install meson again if it is already installed system-wide.
2. If a version of meson which is different from the system-wide version is
already installed, uninstall that meson using pip3, and install again without
the --user argument.
Description
Languages
C++
69.3%
C
17.8%
Python
10.4%
Meson
1.5%
Shell
0.7%
Other
0.3%