[libcamera-devel] raspberrypi pipeline handler configuration validation issue

Paul Elder paul.elder at ideasonboard.com
Sat Jul 4 15:45:30 CEST 2020


Hello Naush,

While running v4l2-compliance on the v4l2 compatibility layer on the
raspberry pi, I've noticed an issue with the configuration validation
and camera configuration in the raspberry pi pipeline handler.

When an invalid format and maximum size frame is passed to
RPiCameraConfiguration::validate() or PipelineHandlerRPi::configure(),
the format is adjusted properly, but the frame size is not, and is left
as-is. According to the debug messages, in findBestMode, the score for
*anything* with a maximum frame size ((2^32)-1) will have a score higher
than the initial bestScore, and therefore nothing will be adjusted.

Here's an excerpt from running v4l2-compliance on the raspi:

[1:56:49.963172514] [3018] DEBUG V4L2Compat v4l2_camera_proxy.cpp:287 Servicing vidioc_g_fmt fd = 3
[1:56:49.963212052] [3018] DEBUG V4L2Compat v4l2_camera_proxy.cpp:324 Servicing vidioc_s_fmt fd = 3
[1:56:49.963514518] [3018]  WARN V4L2 v4l2_pixelformat.cpp:170 Unsupported V4L2 pixel format YV12
[1:56:49.963578797] [3018]  WARN V4L2 v4l2_pixelformat.cpp:170 Unsupported V4L2 pixel format RGBP
[1:56:49.963934004] [3018] DEBUG Camera camera.cpp:715 streams configuration: (0) 800x600-ARGB8888
[1:56:49.963977153] [3018]  WARN Formats formats.cpp:687 Unsupported pixel format 0x0x00000000
[1:56:49.964013598] [3018]  WARN Formats formats.cpp:687 Unsupported pixel format 0x0x00000000
[1:56:49.964250008] [3018]  WARN Formats formats.cpp:687 Unsupported pixel format 0x0x00000000
[1:56:49.964525696] [3018] DEBUG V4L2Compat v4l2_camera.cpp:129 Validated configuration is: 4294967295x4294967295-NV12
[1:56:49.964818033] [3018]  INFO Camera camera.cpp:770 configuring streams: (0) 4294967295x4294967295-NV12
[1:56:49.965266353] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 3280x2464 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965359372] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1920x1080 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965405576] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1640x1232 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965450744] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 640x480 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965502207] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 3280x2464 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965547189] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1920x1080 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965589764] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1640x1232 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965631449] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 640x480 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.965676542] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 3280x2464 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.965718950] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1920x1080 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.965760821] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1640x1232 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.965802118] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 640x480 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.965875841] [3019]  INFO RPI raspberrypi.cpp:643 Sensor: imx219 - Selected mode: 640x480-pBAA
[1:56:49.966307846] [3019] ERROR RPI raspberrypi.cpp:678 Failed to set format on ISP capture0 device: 16384x16384-NV12
[1:56:49.966435755] [3018] DEBUG V4L2Compat v4l2_camera_proxy.cpp:287 Servicing vidioc_g_fmt fd = 3
		warn: v4l2-test-formats.cpp(1099): S_FMT cannot handle an invalid pixelformat.
		warn: v4l2-test-formats.cpp(1100): This may or may not be a problem. For more information see:
		warn: v4l2-test-formats.cpp(1101): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
[1:56:49.966527441] [3018] DEBUG V4L2Compat v4l2_camera_proxy.cpp:324 Servicing vidioc_s_fmt fd = 3
[1:56:49.966863389] [3018]  WARN V4L2 v4l2_pixelformat.cpp:170 Unsupported V4L2 pixel format YV12
[1:56:49.966931353] [3018]  WARN V4L2 v4l2_pixelformat.cpp:170 Unsupported V4L2 pixel format RGBP
[1:56:49.967295931] [3018] DEBUG Camera camera.cpp:715 streams configuration: (0) 800x600-ARGB8888
[1:56:49.967782770] [3018] DEBUG V4L2Compat v4l2_camera.cpp:129 Validated configuration is: 4294967295x4294967295-ARGB8888
[1:56:49.968057884] [3018]  INFO Camera camera.cpp:770 configuring streams: (0) 4294967295x4294967295-ARGB8888
[1:56:49.968299535] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 3280x2464 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968364739] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1920x1080 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968408629] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1640x1232 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968451222] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 640x480 fmt BG10 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968497759] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 3280x2464 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968539908] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1920x1080 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968581168] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1640x1232 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968622557] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 640x480 fmt BA81 Score: 1.71799e+10 (best 9e+09)
[1:56:49.968667706] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 3280x2464 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.968709428] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1920x1080 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.968750318] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 1640x1232 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.968791688] [3019]  INFO RPI raspberrypi.cpp:114 Mode: 640x480 fmt pBAA Score: 1.71799e+10 (best 9e+09)
[1:56:49.968849948] [3019]  INFO RPI raspberrypi.cpp:643 Sensor: imx219 - Selected mode: 640x480-pBAA
[1:56:49.969221193] [3019] ERROR RPI raspberrypi.cpp:678 Failed to set format on ISP capture0 device: 16384x16384-AR24


Could you please investigate this?


Thanks,

Paul


More information about the libcamera-devel mailing list