After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 456040 - v4l2src init bug
v4l2src init bug
Status: RESOLVED DUPLICATE of bug 451388
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-11 21:35 UTC by Roland Krikava
Modified: 2007-07-12 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Roland Krikava 2007-07-11 21:35:21 UTC
The v4l2src queue-size property is initialized to 0 causing:

Pipeline is live and does not need PREROLL ...
ERROR: from element /pipeline0/v4l2src0: Could not get buffers from device '/dev/video0'.
Additional debug info:
v4l2src_calls.c(1025): gst_v4l2src_capture_init (): /pipeline0/v4l2src0:
error requesting 0 buffers: Cannot allocate memory
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...

The fix is:

Index: sys/v4l2/gstv4l2src.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/sys/v4l2/gstv4l2src.c,v
retrieving revision 1.83
diff -u -r1.83 gstv4l2src.c
--- sys/v4l2/gstv4l2src.c       12 Jun 2007 11:23:00 -0000      1.83
+++ sys/v4l2/gstv4l2src.c       11 Jul 2007 21:33:16 -0000
@@ -298,7 +298,7 @@
       gst_v4l2_get_input, gst_v4l2_set_input, NULL);

   /* number of buffers requested */
-  v4l2src->num_buffers = 0;
+  v4l2src->num_buffers = GST_V4L2_MIN_BUFFERS;

   v4l2src->formats = NULL;
Comment 1 Jan Schmidt 2007-07-12 09:45:04 UTC
This is addressed in the patch attached to bug #451388. That patch hasn't been applied yet afaik because noone has had time to test it.

If you could verify the patch there, that would be very useful.

*** This bug has been marked as a duplicate of 451388 ***
Comment 2 Roland Krikava 2007-07-12 15:39:31 UTC
Bug #451388 is a different bug unique to the submitter's video device. His patch covers more than one bug, including this one.  His fix #1 does exactly the same as the fix I provided above.  So as far as fix #1 goes, I can verify it works.

Without the fix the user needs to set the queue-size (since queue-size of zero leads to the above error):

gst-launch-0.10 v4l2src queue-size=2 ! xvimagesink

with the fix its no longer necessary:

gst-launch-0.10 v4l2src ! xvimagesink
Comment 3 Jan Schmidt 2007-07-12 15:47:18 UTC
True - it does more than your patch. Before I think about committing it, it'd be nice if someone else (you) told me it doesn't break *their* device :)
Comment 4 Roland Krikava 2007-07-12 16:50:08 UTC
This is device independant.. The valid range for the 'queue-size' property is 2 - 16, yet it is initialized to 0.  So *anyone* using v4l2src should experience this bug unless they set queue-size to a valid value.

$ gst-inspect v4l2src
.
.
.
queue-size          : Number of buffers to be enqueud in the driver
                        flags: readable, writable
                        Unsigned Integer. Range: 2 - 16 Default: 2 Current: 0