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 725175 - Decklinksrc segfaults on Linux Mint 16
Decklinksrc segfaults on Linux Mint 16
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-25 22:40 UTC by Isaac Smith
Modified: 2014-06-22 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Isaac Smith 2014-02-25 22:40:44 UTC
On Linux Mint 16 with a Blackmagic Decklink Mini Recorder, the decklinksrc plugin segfaults instantly, even with a command as simple as:

$ gst-launch-1.0 decklinksrc
Setting pipeline to PAUSED ...
Caught SIGSEGV
Spinning.  Please run 'gdb gst-launch-1.0 13694' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

A GStreamer-based program I'm developing also segfaults when using decklinksrc. Blackmagic's Media Express program works perfectly, and can capture video from the attached HDMI camera.

I installed gst-plugins-bad 1.2.3 from source and got the same error message, I've since reverted back to 1.2.0.
Comment 1 Isaac Smith 2014-02-27 20:53:17 UTC
Backtrace: https://gist.github.com/hunternet93/118789dc80f8de9c1f17
Please let me know if more information, testing, bribes, etc are needed.
Comment 2 Isaac Smith 2014-02-27 21:33:14 UTC
It appears my Blackmagic card may be faulty, so closing for now.
Comment 3 Isaac Smith 2014-03-11 18:32:38 UTC
After purchasing another DeckLink, I have the same issue. Media Express (Blackmagic's capture application) works fine, decklinksrc segfaults. I installed Gstreamer and plugins from git head, which has the same issue. 

Backtrace: https://gist.github.com/hunternet93/6ab54c2ff79e090dba33

The problematic line seems to be gstdecklinksrc.cpp:467, which sets the DeckLink connection type. The DeckLink API docs are on Blackmagic's website, here: http://www.blackmagicdesign.com/support/detail/register?sid=3945&fid=0&did=59001&alt=true&sdk=true (unfortunately, registration is required). Please let me know if any more info or testing is needed.
Comment 4 Isaac Smith 2014-03-17 16:51:45 UTC
Fixed! Not sure what exactly was wrong, for some reason Blackmagic's driver didn't like how the config interface was retrieved, I changed the code to reflect the method specified in the manual. Patch below, what's t

diff --git a/sys/decklink/gstdecklinksrc.cpp b/sys/decklink/gstdecklinksrc.cpp
index 7c2683a..2e4bdea 100644
--- a/sys/decklink/gstdecklinksrc.cpp
+++ b/sys/decklink/gstdecklinksrc.cpp
@@ -416,6 +416,8 @@ gst_decklink_src_start (GstElement * element)
   BMDVideoConnection conn;
   BMDAudioConnection aconn;
 
+  int64_t currentVideoInputConnection;
+
   GST_DEBUG_OBJECT (decklinksrc, "start");
 
   decklinksrc->decklink = gst_decklink_get_nth_device (decklinksrc->device_number);
@@ -433,7 +435,7 @@ gst_decklink_src_start (GstElement * element)
     return FALSE;
   }
 
-  decklinksrc->config = gst_decklink_get_nth_config (decklinksrc->device_number);
+  decklinksrc->decklink->QueryInterface (IID_IDeckLinkConfiguration, (void**)&decklinksrc->config);
   config = decklinksrc->config;
 
   switch (decklinksrc->connection) {
@@ -463,7 +465,8 @@ gst_decklink_src_start (GstElement * element)
       aconn = bmdAudioConnectionAnalog;
       break;
   }
-
+  config->GetInt (bmdDeckLinkConfigVideoInputConnection, &currentVideoInputConnection);
+  GST_DEBUG ("current video connection: %i", int(currentVideoInputConnection));
   ret = config->SetInt (bmdDeckLinkConfigVideoInputConnection, conn);
   if (ret != S_OK) {
     GST_ERROR ("set configuration (input source)");
Comment 5 Tim-Philipp Müller 2014-03-17 17:27:45 UTC
Thanks for tracking down the problem and posting your solution.

Let's keep the bug open until a fix has actually been committed to GStreamer though :)
Comment 6 Isaac Smith 2014-03-29 17:32:41 UTC
I tracked down the actual cause of the issue (which caused another problem as well) and created another patch, here: https://bugzilla.gnome.org/show_bug.cgi?id=727306 I'm closing this bug, this patch is now unnecessary.