From 517b863bae2db2dd0c56366119318d6b2fb9ad52 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Tue, 18 Nov 2025 13:27:19 +0000 Subject: [PATCH] pipeline: simple: Reduce warning of unknown pixel formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Simple Pipeline is designed to support a wide variety of pipeline configurations and attached devices and will enumerate the pixel formats of the connected sensors to map these to libcamera formats where available. In fixed pipelines, where the pixel format is not mapped correctly it is a desired behaviour to express this warning so that the pixelformat can be added, while in the simple-pipeline case we do not expect warnings for every discovered pixel format which is not supported by libcamera. This currently manifests itself as very highly verbose warnings about unsupported pixel formats are not desired when there are working formats that have already been enumerated. Fortunately in commit 434edb7b4480 ("libcamera: formats: Fix warning for unknown V4L2 pixfmt") we have a mechanism to disable the warning for occasions where we wish to ignore unsupported formats. Use this feature to disable the warning in the core V4L2PixelFormat and instead report only a debug level print from the simple pipeline handler. On devices such as the Pinephone, this removes overly verbose warnings for tiled YUV formats: [0:06:39.291083146] [1922] ERROR SimplePipeline simple.cpp:1600 No valid pipeline for sensor 'gc2145 0-003c', skipping [0:06:39.302229740] [1922] WARN V4L2 v4l2_pixelformat.cpp:346 Unsupported V4L2 pixel format HM12 [0:06:39.302779117] [1922] WARN V4L2 v4l2_pixelformat.cpp:346 Unsupported V4L2 pixel format HM12 [0:06:39.303417578] [1922] WARN V4L2 v4l2_pixelformat.cpp:346 Unsupported V4L2 pixel format HM12 [0:06:39.303928998] [1922] WARN V4L2 v4l2_pixelformat.cpp:346 Unsupported V4L2 pixel format HM12 [0:06:39.304615751] [1922] WARN V4L2 v4l2_pixelformat.cpp:346 Unsupported V4L2 pixel format HM12 Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/291 Suggested-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 91715b7f..118b4186 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -710,9 +710,14 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size) << " ]"; for (const auto &videoFormat : videoFormats) { - PixelFormat pixelFormat = videoFormat.first.toPixelFormat(); - if (!pixelFormat) + PixelFormat pixelFormat = videoFormat.first.toPixelFormat(false); + if (!pixelFormat) { + LOG(SimplePipeline, Debug) + << "Unsupported V4L2 pixel format " + << videoFormat.first.toString(); + continue; + } Configuration config; config.code = code;