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 758522 - Video freezes with v4l2 error with Cairo overlay and xvimagesink
Video freezes with v4l2 error with Cairo overlay and xvimagesink
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-23 06:52 UTC by mr_headwind
Modified: 2016-04-16 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Program to replicate issue (Makefile included as comments) (10.97 KB, text/x-csrc)
2015-11-23 06:52 UTC, mr_headwind
Details

Description mr_headwind 2015-11-23 06:52:11 UTC
Created attachment 316075 [details]
Program to replicate issue (Makefile included as comments)

I have c program that will draw over a camera video stream (v4l2) using a cairo overlay element when the user selects a menu option. Un-selecting the option will stop the drawing. Program (see attached) uses a blocking pad to dynamically alter the pipeline.
 
This problem causes the video to freeze (need to restart once it happens) with the error message:-

libv4l2: error turning on stream: Invalid argument

sometimes showing on the console. Things will often work for a while before freezing.
Problem can occur on either the 'switch on' action to start drawing over the video or the 'switch off' action, but 'switch off' never shows the error message, just freezes.

Problem did not occur using the laptop's built-in camera, but did occur using 2 other external USB cameras.
NB. Remember the code defaults the device to '/dev/video0' so may need to change.
Problem went away when the video sink was changed from 'xvimagesink' to 'ximagesink'.
Unsure whether this is specific to dynamically adding a Cairo overlay and just dynamically adding in general.

Have tried enabling (following a forum suggestion) some debug thus:

echo 0xff > /sys/module/videobuf2_core/parameters/debug

to check for kernel issues and set GST_DEBUG=1 but these did not look to show anything significant AFAICS.
Problem appears to occur directly after the 'return GST_PAD_PROBE_REMOVE' in 'pad_probe_cb' (see attached program).

Of course, my method for dynamically adding / removing may be flawed although I think I've kept the basics from various samples I've looked at. Please advise if I'm doing something stupid!

I have attached a program to reproduce the error. The pipeline in the sample isn't exactly the same as my original code which also has GUI interface (too large and involved to post), but is cut down and does replicate the issue.

Regards.
Tony
Comment 1 mr_headwind 2015-12-18 12:00:49 UTC
This appears to be a problem with Cairo overlay and xvimagesink. I have tried substituting other elements in place of a cairo overlay (eg text overlay) with no problem. I've also tried removing usage of probes and instead using a 'valve' element to effectively hold the pipeline up while its changed and the problem still persisted.
Comment 2 Nicolas Dufresne (ndufresne) 2015-12-18 13:45:12 UTC
Please provide a backtrace of when the hang occure (in gdb, "thread apply all bt" command, make sure you have sufficient debug symbols installed).
Comment 3 Nicolas Dufresne (ndufresne) 2016-04-16 14:54:27 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!

p.s. Note that I tried your application with several cameras and could not reproduce, hence could to produce myself the requested information.