videotestsrc not working with gstreamer 1.0 #83

Closed
atoy40 opened this Issue Mar 19, 2015 · 21 comments

Comments

Projects
None yet
@atoy40

atoy40 commented Mar 19, 2015

Hello,

I'm unable to launch a simple gstreamer pipeline with the gstreamer test source.
Here is the result (i've just modprobe the module and then launch the following command):

gst-launch-1.0  videotestsrc ! v4l2sink device=/dev/video1 
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason error (-5)
Execution ended after 0:00:00.066918471
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

with a GST_DEBUG=3, i found this error :

0:00:00.083227552 26991      0x23e4e30 ERROR                   v4l2 gstv4l2bufferpool.c:1132:gst_v4l2_buffer_pool_dqbuf:<v4l2sink0:pool:sink> No free buffer found in the pool at index 1.
0:00:00.083285313 26991      0x23e4e30 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:00.083295272 26991      0x23e4e30 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)

Im' using the version 0.8.0 packaged in ubuntu 14.10 with a 3.16.0 kernel

thank you very much.

Anthony.

@yukkeorg

This comment has been minimized.

Show comment
Hide comment
@yukkeorg

yukkeorg Mar 20, 2015

i think this problem is related to #60.

i think this problem is related to #60.

@bsenicar

This comment has been minimized.

Show comment
Hide comment
@bsenicar

bsenicar Jun 26, 2015

Any news on that issue?

I like to use gstreamer and using 0.10 branch is not really an option since it is long time depreciated and not recommended for future use.

BR Borut

Any news on that issue?

I like to use gstreamer and using 0.10 branch is not really an option since it is long time depreciated and not recommended for future use.

BR Borut

@Adwind

This comment has been minimized.

Show comment
Hide comment
@Adwind

Adwind Jul 20, 2015

To make gstreamer 1.0 we found a way around .

  1. You start a "client" with gstreamer 1.0 that has the videotestsrc (or other and their decoder) and sends over a udpsink.
    gst-launch-1.0 -v videotestsrc ! queue ! rtpvrawpay ! udpsink port=51111
  1. You start a "server" with gstreamer 0.10 that has the v4l2loopback (it works on that version of gstreamer)
    gst-launch-0.10 udpsrc port=51111 caps = (insert a caps that work from the caps given in the "client" part. Personally I used the second last caps proposed, but the only way to know is to test everyone until one work) ! rtpvrawdepay ! v4l2sink device=/dev/video0

That is how I manage to use v4l2loopback since the version of gstremer 1.0 can't run the v4l2loopback and gstreamer 0.10 can. Just remember that whatever you give to the v4l2sink of gstreamer 0.10 must be raw video.

Adwind commented Jul 20, 2015

To make gstreamer 1.0 we found a way around .

  1. You start a "client" with gstreamer 1.0 that has the videotestsrc (or other and their decoder) and sends over a udpsink.
    gst-launch-1.0 -v videotestsrc ! queue ! rtpvrawpay ! udpsink port=51111
  1. You start a "server" with gstreamer 0.10 that has the v4l2loopback (it works on that version of gstreamer)
    gst-launch-0.10 udpsrc port=51111 caps = (insert a caps that work from the caps given in the "client" part. Personally I used the second last caps proposed, but the only way to know is to test everyone until one work) ! rtpvrawdepay ! v4l2sink device=/dev/video0

That is how I manage to use v4l2loopback since the version of gstremer 1.0 can't run the v4l2loopback and gstreamer 0.10 can. Just remember that whatever you give to the v4l2sink of gstreamer 0.10 must be raw video.

@abickerton

This comment has been minimized.

Show comment
Hide comment
@abickerton

abickerton Aug 2, 2015

This is also a problem in debian/sid version 0.9.1-2.

$gst-launch-0.10 videotestsrc ! v4l2sink device=/dev/video0

ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Failed to query attributes of input 0 in device /dev/video0

Additional debug info:
v4l2_calls.c(134): gst_v4l2_fill_lists (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Failed to get 0 in input enumeration for /dev/video0. (25 - Inappropriate ioctl for device)
Setting pipeline to NULL ...

abickerton commented Aug 2, 2015

This is also a problem in debian/sid version 0.9.1-2.

$gst-launch-0.10 videotestsrc ! v4l2sink device=/dev/video0

ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Failed to query attributes of input 0 in device /dev/video0

Additional debug info:
v4l2_calls.c(134): gst_v4l2_fill_lists (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Failed to get 0 in input enumeration for /dev/video0. (25 - Inappropriate ioctl for device)
Setting pipeline to NULL ...

@igitur igitur referenced this issue in bluezio/ipwebcam-gst Aug 25, 2015

Closed

Disconnecting immediately #17

@astronouth7303

This comment has been minimized.

Show comment
Hide comment
@astronouth7303

astronouth7303 Oct 30, 2015

I'm getting this on Debian Testing:

  • Linux 4.2.0-1-amd64
  • v4l2loopback-dkms 0.9.1-3
  • gstreamer1.0-plugins-good 1.6.0-1

My error is slightly different:

Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.034374233 16672      0x1a40d40 ERROR          v4l2allocator gstv4l2allocator.c:1299:gst_v4l2_allocator_dqbuf:<v4l2sink0:pool:sink:allocator> buffer 2 was not queued, this indicate a driver bug.
0:00:00.034428360 16672      0x1a40d40 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:00.034446519 16672      0x1a40d40 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.

I'm getting this on Debian Testing:

  • Linux 4.2.0-1-amd64
  • v4l2loopback-dkms 0.9.1-3
  • gstreamer1.0-plugins-good 1.6.0-1

My error is slightly different:

Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.034374233 16672      0x1a40d40 ERROR          v4l2allocator gstv4l2allocator.c:1299:gst_v4l2_allocator_dqbuf:<v4l2sink0:pool:sink:allocator> buffer 2 was not queued, this indicate a driver bug.
0:00:00.034428360 16672      0x1a40d40 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:00.034446519 16672      0x1a40d40 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
@atamariya

This comment has been minimized.

Show comment
Hide comment
@atamariya

atamariya Nov 10, 2015

Try with my patch #100 .

[EDIT]: For error shown in abickerton's post.

Try with my patch #100 .

[EDIT]: For error shown in abickerton's post.

@bsenicar

This comment has been minimized.

Show comment
Hide comment
@bsenicar

bsenicar Nov 10, 2015

Still getting error as shown in astronouth7303 post.

BR Borut

Still getting error as shown in astronouth7303 post.

BR Borut

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 23, 2015

Same on latest Ubuntu :(

ghost commented Nov 23, 2015

Same on latest Ubuntu :(

@dankasak

This comment has been minimized.

Show comment
Hide comment
@dankasak

dankasak Nov 25, 2015

Me too :( Gentoo.

Me too :( Gentoo.

@umlaeute

This comment has been minimized.

Show comment
Hide comment
@umlaeute

umlaeute Nov 25, 2015

Owner

patches welcome

Owner

umlaeute commented Nov 25, 2015

patches welcome

@ndufresne

This comment has been minimized.

Show comment
Hide comment
@ndufresne

ndufresne Oct 20, 2016

To all, v4l2loopback driver has important bugs in it's queue management. It's probably reporting some random buffer index. Since 1.0 we do validate this stuff since otherwise it can crash GStreamer. We also use larger queues to avoid doing buffer copied (while in 0.10 we always copy). For anything where the v4l2 queue is bigger then 2 frames, the driver output is wrong. A simple workaround is to use tee multiplexer, which forces a copy:

$ gst-launch-1.0 videotestsrc ! tee ! v4l2sink device=...

Long term, someone need to fix the driver.

ndufresne commented Oct 20, 2016

To all, v4l2loopback driver has important bugs in it's queue management. It's probably reporting some random buffer index. Since 1.0 we do validate this stuff since otherwise it can crash GStreamer. We also use larger queues to avoid doing buffer copied (while in 0.10 we always copy). For anything where the v4l2 queue is bigger then 2 frames, the driver output is wrong. A simple workaround is to use tee multiplexer, which forces a copy:

$ gst-launch-1.0 videotestsrc ! tee ! v4l2sink device=...

Long term, someone need to fix the driver.

@umlaeute

This comment has been minimized.

Show comment
Hide comment
@umlaeute

umlaeute Oct 20, 2016

Owner

given my current time allocation, i'm happily accepting patches.

Owner

umlaeute commented Oct 20, 2016

given my current time allocation, i'm happily accepting patches.

@umlaeute

This comment has been minimized.

Show comment
Hide comment
@umlaeute

umlaeute Dec 2, 2016

Owner

hopefully fixed in 0.10.0

Owner

umlaeute commented Dec 2, 2016

hopefully fixed in 0.10.0

@ndufresne

This comment has been minimized.

Show comment
Hide comment
@ndufresne

ndufresne Jan 16, 2017

I just rested, the fix is kind of partial. The suggested pipeline now works, but now we fail on the receiver side with the following sender:

$ gst-launch-1.0 videotestsrc ! tee ! v4l2sink
$ gst-launch-1.0 v4l2src ! videoconvert ! autovideosink
     gstv4l2allocator.c:1299:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> buffer 1 was not queued, this indicate a driver bug.

ndufresne commented Jan 16, 2017

I just rested, the fix is kind of partial. The suggested pipeline now works, but now we fail on the receiver side with the following sender:

$ gst-launch-1.0 videotestsrc ! tee ! v4l2sink
$ gst-launch-1.0 v4l2src ! videoconvert ! autovideosink
     gstv4l2allocator.c:1299:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> buffer 1 was not queued, this indicate a driver bug.
@baptx

This comment has been minimized.

Show comment
Hide comment
@baptx

baptx Nov 9, 2017

I have to use the "tee" workaround on Xubuntu 16.04 LTS, you should add the example gst-launch-1.0 -v videotestsrc ! tee ! v4l2sink device=/dev/video1 in the wiki if other people get the "Internal data flow error".

baptx commented Nov 9, 2017

I have to use the "tee" workaround on Xubuntu 16.04 LTS, you should add the example gst-launch-1.0 -v videotestsrc ! tee ! v4l2sink device=/dev/video1 in the wiki if other people get the "Internal data flow error".

@ndufresne

This comment has been minimized.

Show comment
Hide comment
@ndufresne

ndufresne Nov 9, 2017

This will no longer work in 1.14, in replacement, you'll be able to workaround this driver bug with "identity drop-allocation=1".

This will no longer work in 1.14, in replacement, you'll be able to workaround this driver bug with "identity drop-allocation=1".

@baptx

This comment has been minimized.

Show comment
Hide comment
@baptx

baptx Nov 14, 2017

Good to know. Is there a way to fix the driver bug directly so we don't have to use a workaround?

baptx commented Nov 14, 2017

Good to know. Is there a way to fix the driver bug directly so we don't have to use a workaround?

@ndufresne

This comment has been minimized.

Show comment
Hide comment
@ndufresne

ndufresne Nov 14, 2017

Sure, go ahead ;-P

Sure, go ahead ;-P

@darenw

This comment has been minimized.

Show comment
Hide comment
@darenw

darenw Mar 8, 2018

I'm trying to get a simple pipeline to work, sending video to v4l2sink. I can use videotestsrc just fine. It needed the 'tee' to work. But a specialized camera source isn't working at all. With or without tee. With the identity drop-allocation=1, I get:

WARNING: erroneous pipeline: no property "drop-allocation" in element "identity0"

???

darenw commented Mar 8, 2018

I'm trying to get a simple pipeline to work, sending video to v4l2sink. I can use videotestsrc just fine. It needed the 'tee' to work. But a specialized camera source isn't working at all. With or without tee. With the identity drop-allocation=1, I get:

WARNING: erroneous pipeline: no property "drop-allocation" in element "identity0"

???

@umlaeute

This comment has been minimized.

Show comment
Hide comment
@umlaeute

umlaeute Mar 9, 2018

Owner

@darenw please make sure that your pipeline is actually valid before posting problems (if GSTreamer's identity element doesn't have a drop-allocation property, then you should read the documentation on identity first)

Owner

umlaeute commented Mar 9, 2018

@darenw please make sure that your pipeline is actually valid before posting problems (if GSTreamer's identity element doesn't have a drop-allocation property, then you should read the documentation on identity first)

@thirdeye-peter

This comment has been minimized.

Show comment
Hide comment
@thirdeye-peter

thirdeye-peter Jun 6, 2018

@darenw: drop-allocation is only available in gstreamer 1.14.x (and 1.13.x), it was only added recently

GStreamer/gstreamer@2cc5c53

@darenw: drop-allocation is only available in gstreamer 1.14.x (and 1.13.x), it was only added recently

GStreamer/gstreamer@2cc5c53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment