I managed to increase CMA to 3072MB. Instructions here
https://forums.raspberrypi.com/viewtopic.php?p=2173568#p2173568
running these two commands in separate terminals works fine
libcamera-still --camera 0 --width 9152 --height 6944 -o test0.jpg -n -t 1 --encoding yuv420
libcamera-still --camera 1 --width 9152 --height 6944 -o test1.jpg -n -t 1 --encoding yuv420
but the with bgr still get error in second terminal when running
libcamera-still --camera 0 --width 9152 --height 6944 -o test0.jpg -n -t 1 --encoding rgb
libcamera-still --camera 1 --width 9152 --height 6944 -o test1.jpg -n -t 1 --encoding rgb
pi@pi:~ $ libcamera-still --camera 1 --width 9152 --height 6944 -o test1.jpg -n -t 1 --encoding rgb
[0:05:20.147690394] [1079] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+ 146-cff216fa-dirty (2023-12-05T09:54:10+00:00)
[0:05:20.174573716] [1091] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a25 8644a 22-11-2023 (22:03:31)
[0:05:20.179246561] [1091] WARN CameraSensorProperties camera_sensor_properties .cpp:265 No static properties available for 'arducam_64mp'
[0:05:20.179264321] [1091] WARN CameraSensorProperties camera_sensor_properties .cpp:267 Please consider updating the camera sensor properties database
[0:05:20.208772133] [1091] INFO RPI pisp.cpp:1113 Registered camera /base/axi/p cie@120000/rp1/i2c@88000/arducam_64mp@1a to CFE device /dev/media0 and ISP devic e /dev/media2 using PiSP variant BCM2712_C0
[0:05:20.208854803] [1091] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a25 8644a 22-11-2023 (22:03:31)
[0:05:20.209826710] [1091] WARN CameraSensorProperties camera_sensor_properties .cpp:265 No static properties available for 'arducam_64mp'
[0:05:20.209843859] [1091] WARN CameraSensorProperties camera_sensor_properties .cpp:267 Please consider updating the camera sensor properties database
[0:05:20.227270061] [1091] INFO RPI pisp.cpp:1113 Registered camera /base/axi/p cie@120000/rp1/i2c@80000/arducam_64mp@1a to CFE device /dev/media1 and ISP devic e /dev/media3 using PiSP variant BCM2712_C0
[0:05:20.228874734] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:05:20.228911846] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:05:20.228921495] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:05:20.228931402] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 4576:3472:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 13268.4
SRGGB10_CSI2P,1920x1080/0 - Score: 11268.4
SRGGB10_CSI2P,2312x1736/0 - Score: 9005.18
SRGGB10_CSI2P,3840x2160/0 - Score: 5268.43
SRGGB10_CSI2P,4624x3472/0 - Score: 1017.18
SRGGB10_CSI2P,8000x6000/0 - Score: 2493.76
SRGGB10_CSI2P,9152x6944/0 - Score: 3012
Stream configuration adjusted
[0:05:20.229361826] [1079] INFO Camera camera.cpp:1183 configuring streams: (0) 4576x3472-YUV420 (1) 4624x3472-RGGB16_PISP_COMP1
[0:05:20.229479960] [1091] INFO RPI pisp.cpp:1397 Sensor: /base/axi/pcie@120000 /rp1/i2c@80000/arducam_64mp@1a - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected CFE format: 4624x3472-PC1R
[0:05:21.516236624] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:05:21.516286348] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:05:21.516295830] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:05:21.516306294] [1079] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 9152:6944:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 29364.4
SRGGB10_CSI2P,1920x1080/0 - Score: 27364.4
SRGGB10_CSI2P,2312x1736/0 - Score: 25101.2
SRGGB10_CSI2P,3840x2160/0 - Score: 21364.4
SRGGB10_CSI2P,4624x3472/0 - Score: 17005.2
SRGGB10_CSI2P,8000x6000/0 - Score: 5197.76
SRGGB10_CSI2P,9152x6944/0 - Score: 1000
Stream configuration adjusted
[0:05:21.516770662] [1079] INFO Camera camera.cpp:1183 configuring streams: (0) 9152x6944-BGR888 (1) 9152x6944-RGGB16_PISP_COMP1
[0:05:21.553124322] [1091] INFO RPI pisp.cpp:1397 Sensor: /base/axi/pcie@120000 /rp1/i2c@80000/arducam_64mp@1a - Selected sensor format: 9152x6944-SRGGB10_1X10 - Selected CFE format: 9152x6944-PC1R
Still capture image received
pi@pi:~ $ libcamera-still --camera 0 --width 9152 --height 6944 -o test0.jpg -n -t 1 --encoding rgb
[0:05:20.147690412] [1080] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+ 146-cff216fa-dirty (2023-12-05T09:54:10+00:00)
[0:05:20.174573475] [1090] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a25 8644a 22-11-2023 (22:03:31)
[0:05:20.179246932] [1090] WARN CameraSensorProperties camera_sensor_properties .cpp:265 No static properties available for 'arducam_64mp'
[0:05:20.179264210] [1090] WARN CameraSensorProperties camera_sensor_properties .cpp:267 Please consider updating the camera sensor properties database
[0:05:20.208869396] [1090] INFO RPI pisp.cpp:1113 Registered camera /base/axi/p cie@120000/rp1/i2c@88000/arducam_64mp@1a to CFE device /dev/media0 and ISP devic e /dev/media2 using PiSP variant BCM2712_C0
[0:05:20.209002438] [1090] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a25 8644a 22-11-2023 (22:03:31)
[0:05:20.209916973] [1090] WARN CameraSensorProperties camera_sensor_properties .cpp:265 No static properties available for 'arducam_64mp'
[0:05:20.209941474] [1090] WARN CameraSensorProperties camera_sensor_properties .cpp:267 Please consider updating the camera sensor properties database
[0:05:20.227270098] [1090] INFO RPI pisp.cpp:1113 Registered camera /base/axi/p cie@120000/rp1/i2c@80000/arducam_64mp@1a to CFE device /dev/media1 and ISP devic e /dev/media3 using PiSP variant BCM2712_C0
[0:05:20.228876123] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:05:20.228921069] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:05:20.228935143] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:05:20.228957366] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 4576:3472:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 13268.4
SRGGB10_CSI2P,1920x1080/0 - Score: 11268.4
SRGGB10_CSI2P,2312x1736/0 - Score: 9005.18
SRGGB10_CSI2P,3840x2160/0 - Score: 5268.43
SRGGB10_CSI2P,4624x3472/0 - Score: 1017.18
SRGGB10_CSI2P,8000x6000/0 - Score: 2493.76
SRGGB10_CSI2P,9152x6944/0 - Score: 3012
Stream configuration adjusted
[0:05:20.229547352] [1080] INFO Camera camera.cpp:1183 configuring streams: (0) 4576x3472-YUV420 (1) 4624x3472-RGGB16_PISP_COMP1
[0:05:20.229807343] [1090] INFO RPI pisp.cpp:1397 Sensor: /base/axi/pcie@120000 /rp1/i2c@88000/arducam_64mp@1a - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected CFE format: 4624x3472-PC1R
[0:05:21.501825562] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:05:21.501889379] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:05:21.501898787] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:05:21.501913158] [1080] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 9152:6944:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 29364.4
SRGGB10_CSI2P,1920x1080/0 - Score: 27364.4
SRGGB10_CSI2P,2312x1736/0 - Score: 25101.2
SRGGB10_CSI2P,3840x2160/0 - Score: 21364.4
SRGGB10_CSI2P,4624x3472/0 - Score: 17005.2
SRGGB10_CSI2P,8000x6000/0 - Score: 5197.76
SRGGB10_CSI2P,9152x6944/0 - Score: 1000
Stream configuration adjusted
[0:05:21.502521606] [1080] INFO Camera camera.cpp:1183 configuring streams: (0) 9152x6944-BGR888 (1) 9152x6944-RGGB16_PISP_COMP1
[0:05:21.517791033] [1090] INFO RPI pisp.cpp:1397 Sensor: /base/axi/pcie@120000 /rp1/i2c@88000/arducam_64mp@1a - Selected sensor format: 9152x6944-SRGGB10_1X10 - Selected CFE format: 9152x6944-PC1R
[0:05:22.949701675] [1090] ERROR V4L2 v4l2_videodevice.cpp:1697 /dev/video21[25: out]: Failed to queue buffer 0: Invalid argument
[0:05:22.949775196] [1090] ERROR RPISTREAM rpi_stream.cpp:276 Failed to queue bu ffer for ISP TDN Input
[0:05:22.949815364] [1090] ERROR V4L2 v4l2_videodevice.cpp:1697 /dev/video26[26: cap]: Failed to queue buffer 0: Invalid argument
[0:05:22.949826531] [1090] ERROR RPISTREAM rpi_stream.cpp:276 Failed to queue bu ffer for ISP TDN Output
[0:05:22.949861143] [1090] ERROR V4L2 v4l2_videodevice.cpp:1697 /dev/video22[27: out]: Failed to queue buffer 0: Invalid argument
[0:05:22.949872551] [1090] ERROR RPISTREAM rpi_stream.cpp:276 Failed to queue bu ffer for ISP Stitch Input
[0:05:22.949905089] [1090] ERROR V4L2 v4l2_videodevice.cpp:1697 /dev/video27[28: cap]: Failed to queue buffer 0: Invalid argument
[0:05:22.949914923] [1090] ERROR RPISTREAM rpi_stream.cpp:276 Failed to queue bu ffer for ISP Stitch Output
looking at log of last camera there is
[0:05:20.229547352] [1080] INFO Camera camera.cpp:1183 configuring streams: (0) 4576x3472-YUV420 (1) 4624x3472-RGGB16_PISP_COMP1
…
[0:05:21.502521606] [1080] INFO Camera camera.cpp:1183 configuring streams: (0) 9152x6944-BGR888 (1) 9152x6944-RGGB16_PISP_COMP1
Like why is it creating 4576x3472-YUV420, 4624x3472-RGGB16_PISP_COMP1, 9152x6944-RGGB16_PISP_COMP1 streams if im telling it to use res 9152x6944 and encoding rgb? Is it creating buffers for these also?
I think the CMA still isnt enough to create all these buffers since last address system reserves for cma is still withgin 1024M because the ZONE_DMA is limited to 30-bit on raspberry pi. The logs above i got when cma=960M48M
What i think might be happening lets say libcamera is creating 2 x (9152x6944 rgb888) buffer for each camera thats already 4 buffers and in my code i also make 1 buffer for each camera and that means 6 rgb buffers each requiring 192MB. 6x192MB=1152MB that is more then CMA can be give in 30-bit address space. whe i set CMA to exceed this address space cma=3072MB@48M then i get different error in second camera.
pi@pi:~ $ libcamera-still --camera 0 --width 8000 --height 6000 -o test0.jpg -n -t 1 --encoding rgb
[0:07:42.936795892] [1283] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+146-cff216fa-dirty (2023-12-05T09:54:10+00:00)
[0:07:42.961703713] [1293] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a258644a 22-11-2023 (22:03:31)
[0:07:42.962912846] [1293] WARN CameraSensorProperties camera_sensor_properties.cpp:265 No static properties available for 'arducam_64mp'
[0:07:42.962928661] [1293] WARN CameraSensorProperties camera_sensor_properties.cpp:267 Please consider updating the camera sensor properties database
[0:07:42.983811724] [1293] INFO RPI pisp.cpp:1113 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/arducam_64mp@1a to CFE device /dev/media0 and ISP device /dev/media3 using PiSP variant BCM2712_C0
[0:07:42.983888615] [1293] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a258644a 22-11-2023 (22:03:31)
[0:07:43.241684169] [1293] ERROR V4L2 v4l2_device.cpp:353 'arducam_64mp 4-001a': Unable to set controls: Device or resource busy
[0:07:43.241992804] [1293] WARN CameraSensorProperties camera_sensor_properties.cpp:265 No static properties available for 'arducam_64mp'
[0:07:43.242005378] [1293] WARN CameraSensorProperties camera_sensor_properties.cpp:267 Please consider updating the camera sensor properties database
[0:07:43.255837203] [1293] INFO RPI pisp.cpp:1113 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/arducam_64mp@1a to CFE device /dev/media1 and ISP device /dev/media4 using PiSP variant BCM2712_C0
[0:07:43.256455417] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:07:43.256500696] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:07:43.256516678] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:07:43.256532326] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 4624:3468:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 13350.7
SRGGB10_CSI2P,1920x1080/0 - Score: 11350.7
SRGGB10_CSI2P,2312x1736/0 - Score: 9092.61
SRGGB10_CSI2P,3840x2160/0 - Score: 5350.67
SRGGB10_CSI2P,4624x3472/0 - Score: 1005.61
SRGGB10_CSI2P,8000x6000/0 - Score: 2477
SRGGB10_CSI2P,9152x6944/0 - Score: 3047.08
Stream configuration adjusted
[0:07:43.257506844] [1283] INFO Camera camera.cpp:1183 configuring streams: (0) 4624x3468-YUV420 (1) 4624x3472-RGGB16_PISP_COMP1
[0:07:43.257649661] [1293] INFO RPI pisp.cpp:1397 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/arducam_64mp@1a - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected CFE format: 4624x3472-PC1R
[0:07:44.517548256] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:07:44.517597424] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:07:44.517607516] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:07:44.517618239] [1283] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 8000:6000:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 25166.7
SRGGB10_CSI2P,1920x1080/0 - Score: 23166.7
SRGGB10_CSI2P,2312x1736/0 - Score: 20908.6
SRGGB10_CSI2P,3840x2160/0 - Score: 17166.7
SRGGB10_CSI2P,4624x3472/0 - Score: 12812.6
SRGGB10_CSI2P,8000x6000/0 - Score: 1000
SRGGB10_CSI2P,9152x6944/0 - Score: 1570.08
Stream configuration adjusted
[0:07:44.518218639] [1283] INFO Camera camera.cpp:1183 configuring streams: (0) 8000x6000-BGR888 (1) 8000x6000-RGGB16_PISP_COMP1
[0:07:44.532071021] [1293] INFO RPI pisp.cpp:1397 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/arducam_64mp@1a - Selected sensor format: 8000x6000-SRGGB10_1X10 - Selected CFE format: 8000x6000-PC1R
[0:07:44.950899674] [1293] ERROR V4L2 v4l2_videodevice.cpp:1697 /dev/video25[23:cap]: Failed to queue buffer 0: Invalid argument
[0:07:44.950932138] [1293] ERROR RPISTREAM rpi_stream.cpp:276 Failed to queue buffer for ISP Output1
ERROR: Device timeout detected, attempting a restart!!!
[0:07:44.953530037] [1293] FATAL default v4l2_videodevice.cpp:1960 /dev/video25[23:cap]: assertion "cache_->isEmpty()" failed in streamOff()
Backtrace:
??? [0xfffffffff782ca44] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff782ca44])
??? [0xfffffffff7851bc0] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff7851bc0])
??? [0xfffffffff78015b4] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff78015b4])
??? [0xfffffffff734cdc0] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff734cdc0])
??? [0xfffffffff734f564] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff734f564])
??? [0xfffffffff73457f0] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff73457f0])
??? [0xfffffffff734eee4] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff734eee4])
??? [0xfffffffff77d2600] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff77d2600])
??? [0xfffffffff75be068] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff75be068])
??? [0xfffffffff73d18e0] (/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 [0xfffffffff73d18e0])
Through trial and error i figured out that maximum res i can give is 7445x6000 with BGR888 for parallel capture of two cameras
libcamera-still --camera 0 --width 7445 --height 6000 -o test0.jpg -n -t 1 --encoding rgb
libcamera-still --camera 1 --width 7445 --height 6000 -o test1.jpg -n -t 1 --encoding rgb
increasing the width to 7446 on both commands will create the same error in second camera log.
Is it possible for you to fix arducam-libcamera so that it wouldnt eat so much CMA and i could capture bgr888 at 9152x6944?