filesrc only emits resource error when fakesink dump=true

Charles hobbesc7 at gmail.com
Fri Aug 8 11:38:15 PDT 2014


I have a usb encoder that provides an h264 stream at /dev/video0.

If I disconnect the encoder power while streaming, the video freezes,
as expected, but I cannot set my pipeline to NULL.  It hangs at the
set_state call.  I might have reproduced the problem with gst-launch.

If I pipe the filesrc to fakesink, and then unplug the encoder, the
USB disconnect is recognized, but then everything hangs until I hit
ctrl-c to kill the pipeline.  Before hitting ctrl-c, if I plug the
encoder back in, the kernel doesn't recognize that anything is plugged
in -- it's as if gstreamer is holding on to the device.  Once I kill
the pipeline with ctrl-c, the device re-enumerates properly.

If I add dump=true to filesink, then firesrc emits a "Could not read
from resource" error when I disconnect the device, and the pipeline
stops on its own.

Any ideas as to why the filesrc only generates an error in the second case?

sbc:~# gst-launch filesrc location=/dev/video0 ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 3989.400052] usb 1-1.1.1: USB disconnect, device number 9

hangs until I hit ctrl c...

Caught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 13770058550 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...

hangs until I hit ctrl c again...

sbc:~# [ 4010.171322] usb 1-1.1.1: new high-speed USB device number 10
using musb-hdrc

... device re-enumerates properly

sbc:~# gst-launch filesrc location=/dev/video0 ! fakesink dump=true

[ 4117.152653] usb 1-1.1.1: USB disconnect, device number 11
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Could
not read from resource.
Additional debug info:
gstfilesrc.c(867): gst_file_src_create_read ():
/GstPipeline:pipeline0/GstFileSrc:filesrc0:
system error: No such device
Execution ended after 3774510757 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
sbc:~#


More information about the gstreamer-devel mailing list