[RFC,0/6] libcamera: simple: Enable Raw capture
mbox series

Message ID 20250716142027.236277-1-uajain@igalia.com
Headers show
Series
  • libcamera: simple: Enable Raw capture
Related show

Message

Umang Jain July 16, 2025, 2:20 p.m. UTC
RFC series to enable raw capture on simple pipeline handler with
SoftISP enabled. I had a few thoughts on design of the features
when I was reviewing Milan's series [1]. Hence, I decided to crystallise
my thoughts and posted as RFC to gather more feedback (and some real
testing on supportedDevices[]).

I have left few things to include from [1] for e.g. colorspace issues.
My goal currently is to address the core issue of raw capture with this
RFC.

Testing branch [2]
Setup: RPi 3b + IMX219
Cases tested with cam:
	- Single raw output
	- Single processed output
	- 1 Raw + 1 processed output

One can propose more use-cases as part of their testing. If they turn
out to be complex, we can probably document it as \todo, to get
addressed at a later stage.

cam Output:
===========

uajain1@uajain:~/libcamera$ ./build-soft/src/apps/cam/cam -c1 -srole=raw,width=1920,height=1080 -C5
[27:26:59.248233501] [2384]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/home/uajain1/libcamera/build-soft/src/ipa' to the IPA search path
[27:26:59.262004021] [2384]  INFO Camera camera_manager.cpp:326 libcamera v0.5.1+63-c33be195
[27:26:59.593703813] [2390]  INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data'
[27:26:59.594050532] [2390]  WARN IPAProxy ipa_proxy.cpp:177 Configuration file 'imx219.yaml' not found for IPA module 'simple', falling back to 'uncalibrated.yaml'
[27:26:59.596620063] [2390]  INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data'
Using camera /base/soc/i2c0mux/i2c@1/imx219@10 as cam0
[27:26:59.625957459] [2384]  INFO Camera camera.cpp:1205 configuring streams: (0) 1920x1080-SRGGB10/RAW
[27:26:59.627666834] [2390]  INFO SimplePipeline simple.cpp:1471 data->useConversion_ : 0
cam0: Capture 5 frames
98819.750177 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 4147200
98819.783504 (30.01 fps) cam0-stream0 seq: 000001 bytesused: 4147200
98819.816829 (30.01 fps) cam0-stream0 seq: 000002 bytesused: 4147200
98819.850156 (30.01 fps) cam0-stream0 seq: 000003 bytesused: 4147200
98819.883484 (30.00 fps) cam0-stream0 seq: 000004 bytesused: 4147200


uajain1@uajain:~/libcamera$ ./build-soft/src/apps/cam/cam -c1 -srole=viewfinder,width=1920,height=1080 -C5
[27:27:09.663699747] [2391]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/home/uajain1/libcamera/build-soft/src/ipa' to the IPA search path
[27:27:09.677708965] [2391]  INFO Camera camera_manager.cpp:326 libcamera v0.5.1+63-c33be195
[27:27:09.933555736] [2392]  INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data'
[27:27:09.933821778] [2392]  WARN IPAProxy ipa_proxy.cpp:177 Configuration file 'imx219.yaml' not found for IPA module 'simple', falling back to 'uncalibrated.yaml'
[27:27:09.936308080] [2392]  INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data'
Camera configuration adjusted
Using camera /base/soc/i2c0mux/i2c@1/imx219@10 as cam0
[27:27:09.965424746] [2391]  INFO Camera camera.cpp:1205 configuring streams: (0) 1916x1080-XRGB8888/Unset
[27:27:09.967118705] [2392]  INFO SimplePipeline simple.cpp:1471 data->useConversion_ : 1
[27:27:09.970895528] [2392]  INFO IPASoft soft_simple.cpp:264 IPASoft: Exposure 4-1759, gain 1-10.6667 (0.0966667)
cam0: Capture 5 frames
98830.200120 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 8277120
98830.233445 (30.01 fps) cam0-stream0 seq: 000001 bytesused: 8277120
98830.266770 (30.01 fps) cam0-stream0 seq: 000002 bytesused: 8277120
98831.033291 (1.30 fps) cam0-stream0 seq: 000025 bytesused: 8277120
98831.799810 (1.30 fps) cam0-stream0 seq: 000048 bytesused: 8277120


uajain1@uajain:~/libcamera$ ./build-soft/src/apps/cam/cam -c1 -srole=raw,width=1920,height=1080 -srole=viewfinder,width=1920,height=1080 -C10
[27:27:26.239476459] [2395]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/home/uajain1/libcamera/build-soft/src/ipa' to the IPA search path
[27:27:26.253694063] [2395]  INFO Camera camera_manager.cpp:326 libcamera v0.5.1+63-c33be195
[27:27:26.572276146] [2396]  INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data'
[27:27:26.572539792] [2396]  WARN IPAProxy ipa_proxy.cpp:177 Configuration file 'imx219.yaml' not found for IPA module 'simple', falling back to 'uncalibrated.yaml'
[27:27:26.574856667] [2396]  INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data'
Camera configuration adjusted
Using camera /base/soc/i2c0mux/i2c@1/imx219@10 as cam0
[27:27:26.603776146] [2395]  INFO Camera camera.cpp:1205 configuring streams: (0) 1920x1080-SRGGB10/RAW (1) 1916x1080-XRGB8888/Unset
[27:27:26.605656303] [2396]  INFO SimplePipeline simple.cpp:1471 data->useConversion_ : 1
[27:27:26.609448803] [2396]  INFO IPASoft soft_simple.cpp:264 IPASoft: Exposure 4-1759, gain 1-10.6667 (0.0966667)
cam0: Capture 10 frames
98846.739621 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 4147200 cam0-stream1 seq: 000000 bytesused: 8277120
98846.772946 (30.01 fps) cam0-stream0 seq: 000001 bytesused: 4147200 cam0-stream1 seq: 000001 bytesused: 8277120
98846.806274 (30.00 fps) cam0-stream0 seq: 000002 bytesused: 4147200 cam0-stream1 seq: 000002 bytesused: 8277120
98846.839601 (30.01 fps) cam0-stream0 seq: 000003 bytesused: 4147200 cam0-stream1 seq: 000003 bytesused: 8277120
98847.539465 (1.43 fps) cam0-stream0 seq: 000024 bytesused: 4147200 cam0-stream1 seq: 000024 bytesused: 8277120
98848.206006 (1.50 fps) cam0-stream0 seq: 000044 bytesused: 4147200 cam0-stream1 seq: 000044 bytesused: 8277120
98848.872546 (1.50 fps) cam0-stream0 seq: 000064 bytesused: 4147200 cam0-stream1 seq: 000064 bytesused: 8277120
98849.539084 (1.50 fps) cam0-stream0 seq: 000084 bytesused: 4147200 cam0-stream1 seq: 000084 bytesused: 8277120
98850.205624 (1.50 fps) cam0-stream0 seq: 000104 bytesused: 4147200 cam0-stream1 seq: 000104 bytesused: 8277120
98850.872164 (1.50 fps) cam0-stream0 seq: 000124 bytesused: 4147200 cam0-stream1 seq: 000124 bytesused: 8277120

[1]: https://patchwork.libcamera.org/project/libcamera/list/?series=5281
[2]: https://gitlab.freedesktop.org/uajain/libcamera/-/commits/uajain/simple/raw

Milan Zamazal (3):
  libcamera: simple: Set the number of software ISP streams to 2
  libcamera: simple: Exclude raw configurations from output conversions
  libcamera: simple: Require metadata only when software ISP is used

Umang Jain (3):
  libcamera: simple: Support StreamRole::Raw in generateConfiguration()
  libcamera: simple: Validate raw streams if requested
  libcamera: simple: Enable capturing of raw streams

 src/libcamera/pipeline/simple/simple.cpp | 166 ++++++++++++++++++-----
 1 file changed, 131 insertions(+), 35 deletions(-)