GNOME Bugzilla – Bug 628640
v4l2src crashes if device is busy
Last modified: 2010-09-12 19:01:01 UTC
Created attachment 169392 [details] Test program v4l2src crashes if capture device (i.e. /dev/video0 or so) is busy. It prints all the necessary errors ok but continue pending PLAYING state instead of going to NULL. 100% reproducible. To reproduce: 1. Start the 1st instance of attached sample program (it uses /dev/video0). See the process is ok. 2. Start the second instance of it. Mention how it fails with segmentation fault. I've switched on debug level to INFO in the sample program, it shows that the process overall goes normally but skips fatal errors and crashes. Backtrace:
+ Trace 223532
Source code of test program and output log of the 2nd instance is attached.
Created attachment 169393 [details] Log of the 2nd instance of test program
0.10.21 is quite old, have you tried with a more recent version? It seems to error out fine for me: $ gst-launch-0.10 v4l2src ! fakesink Setting pipeline to PAUSED ... ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' cannot capture at 704x576 Additional debug info: gstv4l2object.c(1951): gst_v4l2_object_set_format (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Call to S_FMT failed for YUYV @ 704x576: Device or resource busy Setting pipeline to NULL ... Freeing pipeline ... Your test program also doesn't crash for me with git / latest releases.
Not really, this is version of gst-plugins-good which is included in Ubuntu 10.04 where I found the bug. I'll try to compile recent version from sources there and write the result here.
There's a GStreamer PPA with ubuntu packages of the latest versions.
Well, it seems that also the bug depends on v4l driver itself. I found it with uvcvideo driver and web-camera but with cx23885-powered tv-tuner it isn't reproducible even with 0.10.21 version.. I'll do further testing and post the results here
I've performed some tests and here's the results: 1. Crash is always reproducible ONLY with gst-plugins-good-0.10.21 placed in ubuntu official ppa (package name is gstreamer0.10-plugins-good-0.10.21-ubuntu3 to be exact). 2. With default package built from sources (even 0.10.21 version) crash doesn't appear. 3. With ubuntu packaged good-plugins crash is reproducible with any v4l2 drivers and with source package it is not reproducible with any v4l2 drivers. So I think the problem completely in Ubuntu package. I think we can close this bug as WORKSFORME as soon as it won't be reproducible in 10.10 or in any Ubuntu updates of next gst-plugins-good versions.
Ok, thanks for checking. I assume you had libv4l-dev installed and checked if the plugin was using the libv4l wrapper(s) or not. I'll resolve it as OBSOLETE since we don't have WORKSFORME. Please re-open if you can reproduce this with the latest -good release (ie. >= 0.10.25)
Thank you. I also should add that I've also tested fresh versions from GStreamer Ubuntu ppa (i.e. 0.10.25 of plugins-good). The bug isn't reproducible. But I'll check the next official Ubuntu update of gst packages to make it clear completely.