pipeline: simple: Reduce warning of unknown pixel formats
diff mbox series

Message ID 20251118130812.17594-1-kieran.bingham@ideasonboard.com
State New
Headers show
Series
  • pipeline: simple: Reduce warning of unknown pixel formats
Related show

Commit Message

Kieran Bingham Nov. 18, 2025, 1:08 p.m. UTC
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 print of unsupported formats
when enumerating devices in the simple pipeline handler camera
tryPipeline construction.

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 <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Barnabás Pőcze Nov. 18, 2025, 1:20 p.m. UTC | #1
2025. 11. 18. 14:08 keltezéssel, Kieran Bingham írta:
> 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 print of unsupported formats
> when enumerating devices in the simple pipeline handler camera
> tryPipeline construction.
> 
> 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 <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---

I think this makes sense. It might still be useful to log these at the "debug" level.

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   src/libcamera/pipeline/simple/simple.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 91715b7f8afd..5a722ce7cab9 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -710,7 +710,7 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)
>   		<< " ]";
>   
>   	for (const auto &videoFormat : videoFormats) {
> -		PixelFormat pixelFormat = videoFormat.first.toPixelFormat();
> +		PixelFormat pixelFormat = videoFormat.first.toPixelFormat(false);
>   		if (!pixelFormat)
>   			continue;
>
Kieran Bingham Nov. 18, 2025, 1:21 p.m. UTC | #2
Quoting Barnabás Pőcze (2025-11-18 13:20:01)
> 2025. 11. 18. 14:08 keltezéssel, Kieran Bingham írta:
> > 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 print of unsupported formats
> > when enumerating devices in the simple pipeline handler camera
> > tryPipeline construction.
> > 
> > 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 <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > ---
> 
> I think this makes sense. It might still be useful to log these at the "debug" level.

Lets do that explictily in the simple pipeline handler then.

v2 incoming.

> 
> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> 
> 
> >   src/libcamera/pipeline/simple/simple.cpp | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> > index 91715b7f8afd..5a722ce7cab9 100644
> > --- a/src/libcamera/pipeline/simple/simple.cpp
> > +++ b/src/libcamera/pipeline/simple/simple.cpp
> > @@ -710,7 +710,7 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)
> >               << " ]";
> >   
> >       for (const auto &videoFormat : videoFormats) {
> > -             PixelFormat pixelFormat = videoFormat.first.toPixelFormat();
> > +             PixelFormat pixelFormat = videoFormat.first.toPixelFormat(false);
> >               if (!pixelFormat)
> >                       continue;
> >   
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 91715b7f8afd..5a722ce7cab9 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -710,7 +710,7 @@  void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)
 		<< " ]";
 
 	for (const auto &videoFormat : videoFormats) {
-		PixelFormat pixelFormat = videoFormat.first.toPixelFormat();
+		PixelFormat pixelFormat = videoFormat.first.toPixelFormat(false);
 		if (!pixelFormat)
 			continue;