Gstreamer v4l2src: Failed to allocate required memory

Nicolas Dufresne nicolas at ndufresne.ca
Mon Mar 25 16:08:57 UTC 2019


Le lundi 25 mars 2019 à 02:22 -0500, Andrea a écrit :
> Hi,
> I'm writing a v4l2 driver but I've some problems when is used by gstreamer
> pipeline. I've implemented theese ioctl operations:

Have you considered running v4l2-compliance test suite from v4l-utils ?
It is generally a much easier place to start when validating a V4L2
driver then GStreamer. It's much more low level and the error message
are written for Kernel devs.

https://git.linuxtv.org/v4l-utils.git/

> 
> vidioc_querycap
> vidioc_s_fmt_vid_cap
> vidioc_try_fmt_vid_cap
No g_fmt ?

> vidioc_enum_frameintervals
> vidioc_enum_framesizes
> vidioc_enum_input
> vidioc_enum_fmt_vid_cap
> When I run the gstreamer pipeline (gst-launch-1.0 v4l2src !
> video/x-raw,format=RGB,width=4096,height=2160,framerate=60/1 ! fakesink) I
> receive this error:

Un-related, but use fakevideosink for testing v4l2src. This is the only
way to avoid copy path.

> 
> /*ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to
> allocate required memory.
> Additional debug info:
> ../../../git/sys/v4l2/gstv4l2src.c(555): gst_v4l2src_decide_allocation ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> Buffer pool activation failed*/
> 
> This is some of the debug output from gstreamer:
> /*
> DEBUG                   v4l2
> gstv4l2object.c:2858:gst_v4l2_object_setup_pool:<v4l2src0> initializing the
> capture system
> INFO                    v4l2
> gstv4l2object.c:2882:gst_v4l2_object_setup_pool:<v4l2src0> accessing buffers
> via mode 1
> LOG                     v4l2
> gstv4l2object.c:2891:gst_v4l2_object_setup_pool:<v4l2src0> initiating buffer
> pool
> DEBUG                   v4l2
> gstv4l2object.c:4035:gst_v4l2_object_decide_allocation:<v4l2src0> decide
> allocation
> DEBUG                   v4l2
> gstv4l2object.c:4061:gst_v4l2_object_decide_allocation:<v4l2src0>
> allocation: size:0 min:0 max:0 pool:(NULL)
> DEBUG                   v4l2
> gstv4l2object.c:4088:gst_v4l2_object_decide_allocation:<v4l2src0> read/write
> mode: no downstream pool, using our own
> DEBUG                   v4l2
> gstv4l2object.c:4195:gst_v4l2_object_decide_allocation:<v4l2src0> setting
> own pool config to GstBufferPoolConfig, caps=(GstCaps)"video/x-raw\,\
> format\=\(string\)RGB\,\ width\=\(int\)4096\,\ height\=\(int\)2160\,\
> framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\
> interlace-mode\=\(string\)progressive", size=(uint)26542080,
> min-buffers=(uint)4, max-buffers=(uint)0, allocator=(GstAllocator)"NULL",
> params=(GstAllocationParams)NULL;
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to
> allocate required memory.

This is just a high level error saying that the buffer pool failed to
start. The buffer pool is doing a bit too much in my opinion, basically
it could fail at many stages, including for non-kernel related issues.
Try enabling more traces, like GST_DEBUG="v4l2*:7".

Also, try most recent version of GStreamer (head of 1.14 branch, or
master branch), sometimes we already have patches queued for the
following release.

> Additional debug info:
> ../../../git/sys/v4l2/gstv4l2src.c(555): gst_v4l2src_decide_allocation ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> Buffer pool activation failed
> Execution ended after 0:00:00.410428919
> Setting pipeline to PAUSED ...
> LOG                     v4l2
> gstv4l2object.c:3913:gst_v4l2_object_unlock:<v4l2src0> start flushing
> Setting pipeline to READY ...
> LOG                     v4l2
> gstv4l2object.c:3913:gst_v4l2_object_unlock:<v4l2src0> start flushing
> LOG                     v4l2
> gstv4l2object.c:3926:gst_v4l2_object_unlock_stop:<v4l2src0> stop flushing
> DEBUG                   v4l2
> gstv4l2object.c:3937:gst_v4l2_object_stop:<v4l2src0> stopping
> DEBUG                   v4l2
> gstv4l2object.c:3945:gst_v4l2_object_stop:<v4l2src0> deactivating pool
> Setting pipeline to NULL ...
> DEBUG                   v4l2 v4l2_calls.c:719:gst_v4l2_close:<v4l2src0>
> Trying to close /dev/video0
> DEBUG                   v4l2
> v4l2_calls.c:464:gst_v4l2_empty_lists:<v4l2src0> deleting enumerations
> Freeing pipeline ...*/
> 
> I can't find the cause of the error, maybe I forgot an ioctl operation?
> 
> Thank you
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list