aa0a91c48ddb38c302390d5c4899cb9e093ddd24
The abi-compliance checker reports 100% compatibility in this release.
As such the SONAME is maintained at 0.5.
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0
This release brings 129 commits with some substantial development on gstreamer
for this release which is nice to see.
In core we can see development that cleans up ProcessManager in a drive to
reduce singleton patterns throughout libcamera. There's a new ClockRecovery
class from Raspberry Pi which supports the new Wallclock timestamps
metadata and provides the capablity for synchronising cameras across
devices which will very exciting to see in the future.
Pipelines are now able to limit the number of requests queued into the pipeline
handler which helps prevent issues when applications desire to use a larger
request queue. This is particularly beneficial to pipewire based applications
it seems with longer processing queues.
It's now possible to check if controls exist with new macros defined for
every control to help codebases compile against multiple versions:
- LIBCAMERA_HAS_$VENDOR_VENDOR_$MODE_$NAME
And for developers we now have a b4-config file to support easily using the
tool to send patche to the mailinglist!
On the apps side, there's lots of development on Gstreamer, including fixing
bayer formats for 10/12/14/16 bit depths. Both cam and gstreamer now report the
camera properties in full with text representations of all the enum/properties.
With the IPA components, Raspberry Pi includes development and updates to
Autofocus and makes the maximum digital gain limits configurable. RKISP1 now
has ExposureValue control implemented using exposure compensation in the
agc_mean_luminance implementation. The ST vd56g3 camera sensor support is added
for both RPi and libipa platforms.
For Pipeline Handlers notable updates include the imx8-isi being fixed for
newer generation chips from NXP adding multi-camera support, and Wallclock
timestamp support added to Rapsberry Pi.
Finally, on the documentation side - a notable change is the update to use
spinhx-doxylink. This should prevent stale links being used in the
documentation pages but adds an extra tool to the dependencies for building the
documentation.
Contributors:
27 Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
23 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
17 Stefan Klug <stefan.klug@ideasonboard.com>
12 David Plowman <david.plowman@raspberrypi.com>
10 Naushir Patuck <naush@raspberrypi.com>
9 Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
7 Umang Jain <uajain@igalia.com>
5 Antoine Bouyer <antoine.bouyer@nxp.com>
5 Benjamin Mugnier <benjamin.mugnier@foss.st.com>
3 Jaslo Ziska <jaslo@ziska.de>
2 Daniel Scally <dan.scally@ideasonboard.com>
2 Kieran Bingham <kieran.bingham@ideasonboard.com>
1 Christian Rauch <Rauch.Christian@gmx.de>
1 Han-Lin Chen <hanlinchen@chromium.org>
1 Harvey Yang <chenghaoyang@chromium.org>
1 Hou Qi <qi.hou@nxp.com>
1 Milan Zamazal <mzamazal@redhat.com>
1 Nícolas F. R. A. Prado <nfraprado@collabora.com>
1 Paul Elder <paul.elder@ideasonboard.com>
143 files changed, 6004 insertions(+), 1620 deletions(-)
Integration overview:
The following commits in this release relate to either a bug fix or an
improvement to an existing commit.
- pipeline: imx8-isi: Cosmetic changes
- Fixes: 680cde6005 ("libcamera: imx8-isi: Split Bayer/YUV config generation")
- pipeline: imx8-isi: Fix match returned value in error case
- Fixes: 0ec982d210 ("libcamera: pipeline: Add IMX8 ISI pipeline")
- gstreamer: Replace NULL with nullptr
- Reported-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
- libcamera: base: Fix log level parsing when multiple categories are listed
- Fixes: 24c2caa1c1 ("libcamera: base: log: Use `std::string_view` to avoid some copies")
- libcamera: pipeline: uvcvideo: Silently ignore `AeEnable`
- Fixes: ffcecda4d5 ("libcamera: pipeline: uvcvideo: Report new AeEnable control as available")
- ipa: rpi: Defer initialising AF LensPosition ControlInfo and value
- Bug: https://bugs.libcamera.org/show_bug.cgi?id=258
- subprojects: libpisp: Update to 1.2.1
- Bug: https://github.com/raspberrypi/libpisp/pull/43
- ipa: rpi: Fix bug in AfState reporting
- Fixes: ea5f451c56 ("ipa: rpi: controller: AutoFocus bidirectional scanning")
- libcamera: base: bound_method: Move return value
- Bug: https://bugs.libcamera.org/show_bug.cgi?id=273#c1
- libcamera: camera: Fix up the AeEnable control during Camera::start()
- Fixes: 7abd413905 ("libcamera: camera: Pre-process AeEnable control")
- libcamera: Put buffer back to V4L2BufferCache when VIDIOC_QBUF fails
- Fixes: cadae67e45 ("libcamera: v4l2_videodevice: Add FrameBuffer interface")
- utils: codegen: ipc: Check `ipc_` instead of `isolate_`
- Bug: https://bugs.libcamera.org/show_bug.cgi?id=276
- libcamera: camera: Do not call `generateConfiguration()` synchronously
- Bug: https://bugs.libcamera.org/show_bug.cgi?id=273
- meson: Update subprojects .gitignore
- Fixes: a29c53f6a6 ("meson: Use libyaml wrap file from wrapdb")
And the following updates have been made in this release, grouped by category:
core:
- libcamera: base: log: Take `LogCategory` by reference
- libcamera: base: Fix log level parsing when multiple categories are listed
- libcamera: process: Use `pid_` member to decide if running
- libcamera: process: start(): Use span instead of vector
- libcamera: process: closeAllFdsExcept(): Take vector by value
- libcamera: process: Move `closeAllFdsExcept()`
- libcamera: process: Use `close_range()` when available
- libcamera: process: Remove `ProcessManager` singleton
- libcamera: process: Disable copy/move
- libcamera: process: Misc. cleanup around `execv()`
- libcamera: process: Return error if already running
- libcamera: process: Ensure that file descriptors are nonnegative
- libcamera: framebuffer: Add FrameMetadata::Status::FrameStartup
- libcamera: Add ClockRecovery class to generate wallclock timestamps
- libcamera: controls: Revert incorrect SPDX removal
- libcamera: controls: Remove hyphenation in control description text
- libcamera: controls: Use nanoseconds units for FrameWallClock
- libcamera: delayed_controls: Inherit from Object class
- libcamera: pipeline_handler: Move waitingRequests_ into camera class
- libcamera: pipeline_handler: Allow to limit the number of queued requests
- libcamera: base: bound_method: Move return value
- libcamera: controls: Generate macro for each control
- libcamera: camera: Fix up the AeEnable control during Camera::start()
- libcamera: Put buffer back to V4L2BufferCache when VIDIOC_QBUF fails
- libcamera: camera_manager: Log info message to report camera creation
- libcamera: v4l2_videodevice: Add color space to format string representation
- libcamera: Drop remaining file names from header comment blocks
- libcamera: control_serializer: Accept empty `ControlList`
- libcamera: camera: Do not call `generateConfiguration()` synchronously
- libcamera: utils: Add scope_exit class
- libcamera: v4l2_videodevice: Use scope_exit
- libcamera: camera_sensor_properties: Add vd56g3 camera sensor
- libcamera: base: bound_method: Forward arguments when possible
- meson: Use libyaml wrap file from wrapdb
- meson: Update subprojects .gitignore
- pipeline: v4l2_subdevice: Add color space to format string representation
- utils: gen-debug-controls: Remove line number from control description
- utils: gen-debug-controls: Fix handling of controls that appear multiple times
- utils: gen-debug-controls: Improve log output
- utils: codegen: ipc: Check `ipc_` instead of `isolate_`
- controls: Add FrameWallClock control
- controls: Add camera synchronisation controls for Raspberry Pi
- camera_sensor: Expand on computeTransform() documentation
- subprojects: libpisp: Update to 1.2.1
- V4L2VideoDevice: Call FrameBuffer::Private::cancel() in streamOff()
- camera: Fix spell error
- b4: Add .b4-config
- package: Drop Gentoo ebuild
apps:
- android: camera_device: Do not pass `nullptr` to `Request::addBuffer()`
- apps: common: image: Fix assertion
- apps: cam: Print enum string for camera properties
- apps: lc-compliance: Replace manual include guard with pragma once
- qcam: Silence false positive warnings with Qt 6.9.0 and newer
- gstreamer: Document improvements when updating minimum GStreamer version
- gstreamer: Factor out video pool creation
- gstreamer: Reduce indentation in gst_libcamera_create_video_pool()
- gstreamer: Rename variable in gst_libcamera_create_video_pool()
- gstreamer: Fix leak of GstQuery and GstBufferPool in error path
- gstreamer: Drop incorrect unref on caps
- gstreamer: Replace NULL with nullptr
- gstreamer: Fix libcamerasrc responding latency before setting caps
- gstreamer: Use std::exchange() instead of g_steal_pointer()
- gstreamer: Make format_map[] const
- gstreamer: Fix reconfiguration condition check
- gstreamer: Log and check adjusted camera configuration
- gstreamer: Enable bayer formats with 10/12/14/16 bits
- gstreamer: Split value_set_rectangle() GValue helper
- gstreamer: Move existing GValue helpers to gstreamer-utils
- gstreamer: Report camera properties as device properties
ipa:
- ipa: rpi: Replace dropFrameCount in the IPA -> PH interface
- ipa: rpi: Rename dropFrameCount_ to invalidCount_
- ipa: rpi: Initialize enum controls with a list of values
- ipa: rpi: Defer initialising AF LensPosition ControlInfo and value
- ipa: rpi: controller: Improve findPeak() function in AF algorithm
- ipa: rpi: controller: AutoFocus weighting tweak
- ipa: rpi: controller: Autofocus CAF/PDAF stability tweak
- ipa: rpi: controller: AutoFocus tweak earlyTerminationByPhase()
- ipa: rpi: controller: Autofocus to use AWB statistics; re-trigger
- ipa: rpi: controller: AutoFocus bidirectional scanning
- ipa: rpi: Update IMX708 camera tuning files for AutoFocus changes
- ipa: rpi: Fix bug in AfState reporting
- ipa: rpi: agc: Change handling of colour gains less than 1
- ipa: rpi: agc: Make the maximum digital gain configurable
- ipa: rpi: agc: Rename "analogue gain" to "gain" where appropriate
- ipa: rpi: Advance the delay context counter even when IPAs don't run
- ipa: rpi: agc: Calculate digital gain in process()
- ipa: rpi: Update digital gain handling in IPA base and derived classes
- ipa: rpi: agc: Remove digital gain from AgcPrepareStatus
- ipa: rpi: Fix static initialisation order bug in the Controller
- ipa: rpi: Add vd56g3 support for rpi
- ipa: rpi: Add vd56g3 tuning files for rpi
- ipa: rkisp1: Move Sharpness control creation to Filter algorithm
- ipa: rkisp1: agc: Implement ExposureValue control
- libipa: pwl: Improve documentation
- libipa: pwl: Fix single point Pwl
- libipa: agc_mean_luminance: Add debug logging
- libipa: agc_mean_luminance: Add exposure compensation support
- libcamera: libipa: Add vd56g3 support for libipa
pipeline:
- pipeline: ipa: rpi: Split RPiCameraData::dropFrameCount_
- pipeline: rpi: Remove disable_startup_frame_drops config option
- pipeline: rpi: Remove ispOutputCount_ and ispOutputTotal_
- pipeline: rpi: Add wallclock timestamp support
- pipeline: rpi: Fix for enumerating the media graphs
- libcamera: pipeline: rpi: Do not set timestamps to 0 if unavailable
- libcamera: pipeline: rpi: Do not clear request metadata anymore
- pipeline: imx8-isi: Cosmetic changes
- pipeline: imx8-isi: Fix match returned value in error case
- pipeline: imx8-isi: Dynamically compute crossbar subdevice's first source.
- pipeline: imx8-isi: Add constexpr for maximum pipeline and resize if needed
- pipeline: imx8-isi: Add multicamera support
- libcamera: pipeline: uvcvideo: Silently ignore `AeEnable`
- libcamera: pipeline: uvcvideo: Handle controls during startup
- pipeline: rkisp1: Limit the maximum number of buffers queued in
- pipeline: rkisp1: Properly handle the bufferCount set in the stream configuration
- libcamera: pipeline: rkisp1: Don't rely on bufferCount
- libcamera: software_isp: Remove type casts in statistics computation
- pipeline: simple: Fix matching with empty media graphs
- libcamera: mali-c55: Set bytesused appropriately
- libcamera: mali-c55: Correct expected entity function
test:
- libcamera: test: Add a failing test for the log level parser
- test: libtest: CameraTest: Set env var before CameraManager
- test: ipa: Add basic Pwl test
- test: ipa: Add failing test for single point Pwl
documentation:
- Documentation: Make `doxygen-internal` depend on public inputs
- Documentation: application: Update mediactl URL
- Documentation: Remove unneeded options from Sphinx configuration
- Documentation: Drop documentation author names
- Documentation: Use Sphinx doxylink to generate links to doxygen
- Documentation: Replace links to Doxygen documentation with doxylink
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 (>= 0.63) 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-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%