3c17d1fbb2bd93f221afee788ebf0d7394032e4d
The abi-compliance checker reports there are both ABI and API changes in this release: Binary compatibility: 99.3% Source compatibility: 98.6% Total binary compatibility problems: 4, warnings: 1 Total source compatibility problems: 18, warnings: 5 These have been planned to batch together a lot of recent development to improve the public facing API, which has extended the previous merge window on this occasion. A full and detailed ABI report for those interested can always be generated between any two versions with the internal tooling: "./utils/abi-compat.sh v0.5.2 v0.6.0" Integration Overview: With 211 commits and a longer merge window, this is quite a substantial release. Key highlights include a new global configuration file system which will replace or extend the current use of environment variables to configure runtime behaviours. The core V4L2 classes can now support the V4L2 Request API - which in turn has brought in huge developments for the i.MX8MP Dewarper support allowing full resize, scale, rotate and crop capabilities on top of also performing lens dewarping. The SoftISP continues to develop, and specifically the IPU7 has been added as a supported configuration to the pipeline. New tuning files have been added for Raspberry Pi platforms, improving support for the Sony IMX335, IMX415, IMX462, and ST VD55G1 image sensors, and Decompand support has been added for the Raspberry Pi 5. At the core, we now require Meson 1.0.1, and various improvements have been made for thrad handling, improving synchronisation and event dispatch, as well as fixing the serialisation operations for isolated IPA modules. In the applications components, there are fixes to cam adding more output formats and qcam now behaves more consistently when no camera is selected. The python bindings have received fixes for paths from meson, and the FrameBuffer::planes wrapper. On the Documentation side, there's a new theme refresh and clearer separation between the internal and public API, and fixes to the contributing guidelines. The following commits in this release relate to either a bug fix or an improvement to an existing commit. - libcamera: base: semaphore: Do not unlock prematurely - Bug: https://bugs.libcamera.org/show_bug.cgi?id=225 - apps: cam: Do not overwrite name when adding camera model - Fixes:aab49f903e("cam: Do not assume Location is available") - Documentation: Fix documentation generation when subproject - Fixes:0382d215db("Documentation: Use Sphinx doxylink to generate links to doxygen") - apps: qcam: Do nothing if no camera is selected - Bug: https://bugs.libcamera.org/show_bug.cgi?id=177 - utils: codegen: gen-formats.py: Fix big endian formats - Fixes:7c496f1c54("utils: gen-formats: Support big-endian DRM formats") - pycamera: Fix FrameBuffer::planes wrapper - Fixes:b8d332cdcc("libcamera: framebuffer: Replace vector with span in constructor") - libipa: agc_mean_luminance: Fix constraint logging - Fixes:42e18c96bc("libipa: agc_mean_luminance: Add debug logging") - libcamera: software_isp: Pass correct y-coordinate to stats - Bug: https://bugs.libcamera.org/show_bug.cgi?id=280 - libcamera: controls: Expose string controls as `std::string_view` - Bug: https://bugs.libcamera.org/show_bug.cgi?id=256 - pipeline: simple: Consider output sizes when choosing pipe config - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/236 - ipa: rpi: vd56g3: Fix frameIntegrationDiff value - Reported-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> - libcamera: rkisp1: Mark VBLANK as priority - Fixes:f72c76eb6e("rkisp1: Honor the FrameDurationLimits control") - libcamera: base: thread: Use `pthread_self()` when setting name - Fixes:559128b1f1("Thread: Add name parameter") - pipeline: imx8-isi: Delay ISI routes config to acquire() time - Fixes:92df79112f("pipeline: imx8-isi: Add multicamera support") - pipeline: simple: Reduce warning of unknown pixel formats - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/291 - libcamera: pipeline_handler: Fix requestComplete on waiting requests on stop - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/281 - libcamera: software_isp: Assign colour spaces in configurations - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/294 - libipa: exposure_mode_helper: Set quantizationGain in absence of a sensor helper - Fixes:f077c58e08("libipa: exposure_mode_helper: Take exposure/gain quantization into account") - ipa: libipa: agc_mean_luminance: Fix yTarget handling in constraints - Fixes:24247a12c7("ipa: libipa: Add AgcMeanLuminance base class") - libcamera: control_serializer: Add array info to serialized ControlValue - Bug: https://bugs.libcamera.org/show_bug.cgi?id=285 And the following updates have been made in this release, grouped by category: core: - libcamera: converter_v4l2_m2m: Add missing `<set>` include - treewide: Remove top-level `const` from return types - libcamera: camera_sensor: getControls(): Use span - libcamera: camera_sensor: getFormat(): Use span - libcamera: ipa_proxy: Log configuration file path - libcamera: base: thread: eventDispatcher(): Not thread safe - libcamera: base: semaphore: Do not unlock prematurely - meson: Bump minimum version to v1.0.1 - meson: Use dependency('dl') - libcamera: v4l2_videodevice: Avoid repeated calls to FrameBuffer::planes() - meson: Check for Python modules manually - libcamera: sensor: imx462: Add sensor delays to CameraSensorProperties - libcamera: clock_recovery: Use nanoseconds in addSample() - utils: Add unary negation operation to Duration - utils: codegen: ipc: Put default values in declaration - utils: codegen: ipc: Generate templated constructor - utils: codegen: gen-formats.py: Use jinja - utils: codegen: gen-formats.py: Fix big endian formats - libcamera: framebuffer: Replace vector with span in constructor - libcamera: request: addBuffer(): Do not destroy fence on failure - libcamera: camera_sensor_properties: Add vd55g1 camera sensor - include: linux: Partially update linux headers from v6.16-rc1-310-gd968e50b5c26 - config: Introduce global runtime configuration - libcamera: camera_manager: Construct GlobalConfiguration instance - config: Add configuration retrieval helpers - camera_manager: Look up pipelines match list in configuration file - config: Check configuration file version - meson: Add option to disable libunwind integration - libcamera: base: thread: Make `removeMessages()` public - utils: codegen: ipc: Split proxy types - libcamera: controls: Expose string controls as `std::string_view` - subprojects: libpisp: Update to v1.3.0 - libcamera: request: Clarify ReuseBuffers flag usage with fences - libcamera: base: utils: Simplify `enumerate()` - config: Fix doxygen 1.15.0 errors - libcamera: base: {unique,shared}_fd: Warn if closing fails - libcamera: base: utils: Simplify hex adaptor - libcamera: base: thread: Use `std::unique_ptr` instead of raw pointer - Thread: Add name parameter - libcamera: base: thread: Use `pthread_self()` when setting name - utils: checkstyle.py: Accept `Closes` commit trailer - libcamera: pipeline_handler: Add accessor for useCount_ - subprojects: libyuv: Bump to version 1922 - treewide: Use `argparse.FileType` in more places - libcamera: pipeline_handler: Fix requestComplete on waiting requests on stop - libcamera: base: thread: Use `acquire` memo. when reading event dispatcher - libcamera: request: Store fence `EventNotifier` directly - libcamera: ipa_data_serializer: Add specialization for enums - libcamera: simple: Detect Bayer pattern change during configure() - libcamera: converter: Utilise shared MediaDevice pointers - libcamera: Add support for V4L2 requests - libcamera: converter: Add V4L2 request support - libcamera: converter_v4l2_m2m: Add suport for V4L2 requests - libcamera: converter_v4l2_m2m: Always set stride - include: linux: Update headers for Dw100 dewarper engine - libcamera: converter_v4l2_m2m: Add helper to apply controls - libcamera: converter_v4l2_m2m: Add debug logging for formats - libcamera: converter: Add dw100 vertex map class - libcamera: converter: Add dw100 converter module - libcamera: internal: camera_sensor: Add accessor for mountingOrientation_ - libcamera: Add transpose() function to size - libcamera: dw100_vertexmap: Implement parametric dewarping - libcamera: Add and implement LensDewarpEnable control - libcamera: control_serializer: Add array info to serialized ControlValue - Revert "controls: Add boolean constructors for ControlInfo" pipeline: - pipeline: simple: Improve debug log in validate() - libcamera: pipeline: Avoid unnecessary indirection in frame info map - pipeline: ipu3: Drop unneeded forward declarations - pipeline: rkisp1: Replace error handling gotos with utils::exit_scope - pipeline: rpi: Use structured bindings in range-based for loop - pipeline: imx8-isi: Fix crossbar's sink pad computation - pipeline: simple: Enable simple pipelinehandler with SoftISP on Intel IPU7 - pipelines: Use lambda functions to factor out buffer mapping code - pipeline: rkisp1: Add error log when parameter queuing fails - pipeline: rkisp1: Query kernel for available params blocks - rkisp1: agc: Agc add yTarget to frame context - pipeline: simple: Allow enabling software ISP via config file - libcamera: software_isp: Make input buffer copying configurable - libcamera: software_isp: Make measurement configurable - libcamera: pipeline: virtual: Move image generation to separate thread - libcamera: software_isp: Add valid flag to struct SwIspStats - libcamera: software_isp: Run sw-statistics once every 4th frame - libcamera: software_isp: Fix width adjustment in SwStatsCpu::setWindow - libcamera: software_isp: Clarify SwStatsCpu::setWindow use - libcamera: software_isp: Pass correct y-coordinate to stats - pipeline: simple: Initialize maxQueuedRequestsDevice to 4 - pipeline: simple: Increase internal buffers for software ISP to 4 - pipeline: simple: Allow buffer counts from 1 to 32 - libcamera: software_isp: Clear pending async work - pipeline: simple: Avoid overusage of auto variables - libcamera: software_isp: Apply CCM swap also on green - pipeline: simple: Consider output sizes when choosing pipe config - libcamera: rkisp1: Mark VBLANK as priority - pipeline: imx8-isi: Delay ISI routes config to acquire() time - libcamera: software_isp: Fix gamma table when CCM is used - pipeline: simple: Reduce warning of unknown pixel formats - libcamera: pipeline: uvcvideo: Reject sensor configuration - libcamera: software_isp: Assign colour spaces in configurations - pipeline: virtual: Provide and validate colorspace - libcamera: pipeline: Utilise shared MediaDevice pointers - libcamera: rkisp1: Properly cancel buffers in dewarp case - libcamera: rkisp1: Move useDewarper_ flag into RkISP1CameraData - libcamera: rkisp1: Scale down in dewarper instead of resizer - libcamera: rkisp1: Allow upscaling when the dewarper is present - pipeline: rkisp1: Fix number of buffers imported into the dewarper - libcamera: rkisp1: Use the dw100 converter module instead of the generic v4l2 converter - pipeline: rksip1: Move isRaw up in scope - pipeline: rkisp1: Drop rawFormat variable - pipeline: rkisp1: Enable the dewarper based on the tuning file - libcamera: rkisp1: Handle requested orientation using dewarper - pipeline: rkisp1: Load dewarp parameters from tuning file apps: - apps: common: options: Avoid copying in range based for loop - apps: cam: Do not overwrite name when adding camera model - apps: cam: drm: Drop unneeded local variable - py: libcamera: Improve python binding installation - py: libcamera: Get dependency from meson python module unconditionally - py: libcamera: Always use install path from meson python module - apps: qcam: Do nothing if no camera is selected - apps: cam: Support PPM output for other RGB formats - pycamera: Fix FrameBuffer::planes wrapper - apps: cam: Use signalfd - gstreamer: Update the TODO list - android: camera_hal_manager: Remove `cameraLocation()` - gstreamer: Associate libcamera::Stream with GstPad - gstreamer: Improve logging for buffer pool activation - gstreamer: Track RequestWrap's GstBuffer using GstPad - py: gen-py-formats.py: Open input file in binary mode - apps: cam: sdl_texture: Support NV21 documentation: - Documentation: Fix documentation generation when subproject - Documentation: Use python3 directly to check for doxylink version - Documentation: Use standard ordering for Doxyfile variables - Documentation: Add doxygen-awesome-css - Documentation: Enable doxygen-awesome-css - Documentation: Use the sphinx book theme - Documentation: Add api-html/ and internal-api-html/ to docs sources - Documentation: Reorganize toctree - Documentation: Improve Sphinx and Doxygen integration - Documentation: Drop unnecessary documentation-contents.rst - Documentation: mainpage: Make it easier to distinguish public and internal API - Documentation: Rename api to public-api and drop -html suffix - Documentation: Add global configuration file documentation - Documentation: Fix grammar and typo in meson.build comment - Documentation: contributing: Provide a reference to Matrix - Documentation: contributing: Update issue tracker - Documentation: contributing: Update Source references ipa: - ipa: rpi: Add Arducam B0568 IMX335 tuning files - ipa: rpi: Add Arducam B0569 IMX415 tuning files - ipa: rpi:: denoise: Implement TDN back-off for CDN deviation - ipa: rpi: pisp: data: Improve noise and detail tuning - ipa: rpi: pisp: data: Update all non-official camera tuning files - ipa: rpi: vc4: Minor tuning changes - ipa: rpi: sdn: Remove legacy denoise warning - ipa: rpi: imx462: Add official RPi tuning for IMX462 - ipa: rpi: ccm: Implement "manual" CCM mode - ipa: rpi: Add vd55g1 support for rpi - ipa: rpi: Add vd55g1 tuning files for rpi - libcamera: libipa: Add vd55g1 support for libipa - libcamera: libipa: camera_sensor: Add Himax HM1246 sensor properties - ipa: rkisp1: Add basic compression algorithm - libipa: camera_sensor_helper: Add quantizeGain() function - libipa: exposure_mode_helper: Take exposure/gain quantization into account - libipa: exposure_mode_helper: Remove double calculation of lastStageGain - libipa: exposure_mode_helper: Remove unnecessary clamp calls - libipa: agc_mean_luminance: Fix constraint logging - libipa: agc_mean_luminance: Configure the exposure mode helpers - libipa: exposure_mode_helper: Calculate quantization gain in splitExposure() - ipa: rkisp1: agc: Add correction for exposure quantization - ipa: rkisp1: Switch histogram to RGB combined mode - libipa: agc_mean_luminance: Introduce effectiveYTarget() accessor - libipa: agc_mean_luminance: Add support for additional constraints - ipa: rkisp1: Add WDR algorithm - ipa: Look up IPA configurables in configuration file - ipa: rpi: agc: Allow exposure mode to be updated in auto mode - ipa: software_isp: Fix context_.configuration.agc.againMin init - ipa: software_isp: AGC: Do not lower gain below 1.0 - ipa: software_isp: AGC: Raise exposure or gain not both at the same time - ipa: software_isp: AGC: Only use integers for exposure calculations - ipa: simple: blc: Use 16 as starting blacklevel when there is no sensor-info - ipa: simple: awb: Avoid incorrect arithmetic in AWB - ipa: simple: awb: Use correct type in std::accumulate - ipa: simple: blc: Prevent division by zero in BLC - ipa: simple: agc: Prevent division by zero in AGC - ipa: rpi: pisp: Add decompand support using PiSP hardware block - ipa: rpi: Add FE globals as a parameter to applyDecompand() - ipa: rpi: pisp: Add a DecompandAlgorithm class - ipa: rpi: pisp: Allow an initial decompand curve to be set on the FE - ipa: meson.build: Remove duplicated variable - ipa: rpi: Fix the set function for floating statistics regions - ipa: rpi: lux: Handle camera mode sensitivity correctly - ipa: rpi: pisp: Use a floating region to get whole image Y statistics - ipa: rpi: vc4: Use a floating statistics region for a full image Y sum - ipa: rpi: lux: Use floating statistics region to obtain the current Y value - libipa: camera_sensor_helper: Add imx708 - ipa: rpi: vd56g3: Fix frameIntegrationDiff value - ipa: libipa: agc_mean_luminance: Avoid unnecessary copies - ipa: rkisp1: dpf: Enable strength after enable Dpf - libipa: module: Allow algorithms to be disabled via the tuning file - libipa: exposure_mode_helper: Set quantizationGain in absence of a sensor helper - ipa: libipa: pwl: Allow to parse a plain yaml value as single point PWL - ipa: rkisp1: lux: Properly handle frame context and active state - ipa: libipa: agc_mean_luminance: Change luminance target to piecewise linear function - ipa: libipa: agc_mean_luminance: Fix yTarget handling in constraints - ipa: ipu3, mali-c55, rkisp1, rpi: Fix reporting non-scalar controls tuning: - utils: raspberrypi: ctt: Update noise/sharpness tuning - utils: raspberrypi: ctt: Update vc4 tuning defaults - tuning: rksip1: Add a static Compress entry - tuning: rksip1: Add a static WideDynamicRange entry test: - test: camera: Use Request::ReuseBuffers flag - test: utils: Add endlines - test: utils: Validate hex sign extension - lc-compliance: Ensure stream's colorspace is set after validate() 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%