Capture in Mode 1

Is there a way programmatically, using the mipi camera driver, to capture images in Mode 1 (8112 x 3040) vs. the default of Mode 0 (4056 x 3040).

I know this is possible using the command line using ./arducamstill -t 5000 -m 1 -o image.jpg, but I would like to modify something like the provided capture.py file (in MIPI_Camera/RPI/python) to trigger this capture at the higher resolution

 

 

1.Which seller did you purchase the product(s) from?
UCTRONICS
2.The Model number of the product(s) you have purchased?
B0265R Arducam 12MP*2 Synchronized Stereo Camera Bundle Kit for Raspberry Pi, Two 12.3MP IMX477 Camera Modules with CS Lens and Camarray Stereo Camera HAT
3.Which Platform are you using the product(s) on?
Raspberry Pi 4B 4gb
4.Which instruction are you following?
online
5.Has your product ever worked properly?
yes
6.What problems are you experiencing?

outlined above

7.What attempts at troubleshooting have you already made?

8.How would you like us to help you?

Hi,

In python code, please use fmt = camera.set_resolution(8112 x 3040) to change the resolution.

 

Thank you Bin, but when I set_resolution to 8112x3040 it throws these errors below.

My Pi gpu_mem is set to 256.

Have you perhaps seen this before that you might point me to the solution? I have not yet found it through search.

usrvcsm: [vcsm_malloc_cache]: [9433] [mmal_vc_port buffer]: ioctl mem-alloc FAILED [-1] (hdl: 0) usrvcsm: [vcsm_vc_hdl_from_hdl]: [9433]: invalid device or handle! usrvcsm: [vcsm_lock]: [9433]: invalid device or invalid handle! mmal: mmal_vc_shm_alloc: could not allocate 73982464 bytes of shared memory (handle 0) - mem (nil), vc_hdl 00000000 mmal: mmal_vc_port_payload_alloc: vc.ril.image_encode:out:0(JPEG): failed to allocate 73982464 bytes of shared memory mmal: mmal_pool_initialise_buffer_headers: failed to allocate payload 0/1 mmal: Failed to create isp output pool. Segmentation fault
Thank you.

 

Please set the gpu_mem to 400

Thank you for the quick reply.

I changed gpu_mem to 400, but that (alone) did not fix the issue and I continued to get the same error.

I found I also had to increase the limit of the contiguous memory allocator. In /boot/cmdline.txt I added the option cma=400M. Then rebooted and it worked.

Thanks to this post.

I offer it here in case anyone else has this same issue.

Oh, Great to hear that. Thanks for your sharing.

Oh, Great to hear that. Thanks for your sharing.