V4l2allocator buffer size issue

Hi

I have installed gstreamer using “sudo apt-get” command

gst-launch-1.0 --version
gst-launch-1.0 version 1.16.3
GStreamer 1.16.3

So, when i try to run gst pipeline it keep failing because of v4l2allocator(refer below logs). if i run the same resolution with v4l2-ctl it works fine

gst-launch-1.0 --gst-debug=4 v4l2src device=/dev/video0 num-buffers=10 io-mode=mmap ! ‘video/x-bayer,format=bggr,width=2560,height=512,framerate=(fraction)10/1’ ! filesink location=output.raw

with v4l2-ctl works fine:
v4l2-ctl --device /dev/video0 --set-fmt-video=width=2560,height=512,pixelformat=BA81 --stream-mmap --stream-to=sample.bin --stream-count=10

sample.bin file size is “1310720” which is correct

Below resolution also works fine.

gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=2 io-mode=mmap ! ‘video/x-bayer,format=bggr,width=2048,height=3328,framerate=(fraction)10/1’ ! filesink location=output.raw

Issue with the resolution 2560 x 512
Fail logs:

ERROR v4l2allocator gstv4l2allocator.c:334:gst_v4l2_memory_group_new: buffer size 1310720 is smaller then negotiated size 2097152, this is usually the result of a bug in the v4l2 driver or libv4l.
ERROR v4l2bufferpool gstv4l2bufferpool.c:909:gst_v4l2_buffer_pool_start:v4l2src0:pool:src we received 0 buffer from device ‘/dev/video0’, we want at least 2
ERROR bufferpool gstbufferpool.c:559:gst_buffer_pool_set_active:v4l2src0:pool:src start failed
WARN v4l2src gstv4l2src.c:660:gst_v4l2src_decide_allocation: error: Failed to allocate required memory.
WARN v4l2src gstv4l2src.c:660:gst_v4l2src_decide_allocation: error: Buffer pool activation failed
INFO GST_ERROR_SYSTEM gstelement.c:2153:gst_element_message_full_with_details: posting message: Failed to allocate required memory.
INFO GST_ERROR_SYSTEM gstelement.c:2180:gst_element_message_full_with_details: posted error message: Failed to allocate required memory.
WARN basesrc gstbasesrc.c:3292:gst_base_src_prepare_allocation: Subclass failed to decide allocation
WARN basesrc gstbasesrc.c:3072:gst_base_src_loop: error: Internal data stream error.
WARN basesrc gstbasesrc.c:3072:gst_base_src_loop: error: streaming stopped, reason not-negotiated (-4)

Any lead would be helpful.

Thank you