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 760550 - parse-launch: improve possibly misleading error message when linking two elements with filter caps
parse-launch: improve possibly misleading error message when linking two elem...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-12 19:29 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2017-01-18 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
parse: better error message when linking two elements with capsfilter fails (3.25 KB, patch)
2016-11-11 20:35 UTC, Tim-Philipp Müller
committed Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2016-01-12 19:29:17 UTC
I want to convert an audio file to raw:

gst-launch-1.0 filesrc location=foo.wav ! wavparse ! audioconvert ! "audio/x-raw,channels=1,rate=44100,format=S16" ! filesink location=foo.raw

The mistake above is that S16 is not a valid format, it should be e.g. S16LE.

What gst-launch prints is
"WARNING: erroneous pipeline: could not link audioconvert0 to filesink0"

This is very unfortunate and misleading, since filesink takes any caps. I think we are missing some error handling and this disguises the root cause.
Comment 1 Tim-Philipp Müller 2016-01-12 20:48:47 UTC
The focus on filesink is something that's your personal interpretation of the error message though, I think the message is perfectly correct, it doesn't say if the problem is with audioconvert or filesink after all. Having said that, if it could provide more details of what's wrong exactly, that'd be very useful.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2016-01-12 22:11:23 UTC
More  detail:
0:00:00.197011349 30324      0x159ba00 ERROR           GST_PIPELINE grammar.y:642:gst_parse_perform_link: could not link audioconvert0 to filesink0
WARNING: erroneous pipeline: could not link audioconvert0 to filesink0

Its probably comming from using gst_element_link_filtered(). But anyway the link from audioconvert0 to the caps filter failed. Linking to filesink0 cannot fail by design, hence the message is misleading. I filed this because I think we can do better and leave less room to interpretation.
Comment 3 Tim-Philipp Müller 2016-11-11 20:35:32 UTC
Created attachment 339668 [details] [review]
parse: better error message when linking two elements with capsfilter fails

First stab at this. Far from perfect, but does something.

$ gst-launch-1.0 audiotestsrc ! ximagesink
WARNING: could not link audiotestsrc0 to ximagesink0

$ gst-launch-1.0 audiotestsrc ! audio/x-raw ! ximagesink
WARNING: could not link audiotestsrc0 to ximagesink0, ximagesink0 can't handle caps audio/x-raw

$ gst-launch-1.0 audiotestsrc ! audio/mpeg ! ximagesink
WARNING: could not link audiotestsrc0 to ximagesink0, neither element can handle caps audio/mpeg

$ gst-launch-1.0 audiotestsrc ! video/x-raw ! ximagesink
WARNING: could not link audiotestsrc0 to ximagesink0, audiotestsrc0 can't handle caps video/x-raw

$ gst-launch-1.0 audiotestsrc ! audio/x-raw,format=S16 ! fakesink
WARNING: could not link audiotestsrc0 to fakesink0, audiotestsrc0 can't handle caps audio/x-raw, format=(string)S16


We might still/also want a more general try_and_figure_out_why_two_elements_cant_link() function, so we can have a more useful debug message in our debug logs when linking fails outside of parse launch.
Comment 4 Sebastian Dröge (slomo) 2016-11-12 08:55:54 UTC
Comment on attachment 339668 [details] [review]
parse: better error message when linking two elements with capsfilter fails

Looks like a good start to me :)
Comment 5 Tim-Philipp Müller 2016-11-12 10:57:31 UTC
commit 89b413ef153fc7aa2bbcc1a76c18bda860d5bda1
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Fri Nov 11 20:31:03 2016 +0000

    parse: better error message when linking two elements with capsfilter fails
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760550
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2016-11-12 19:32:53 UTC
Thanks! Wonder if we want this in gst_utils? I have something a bit similar in buzztrax:
https://github.com/Buzztrax/buzztrax/blob/master/src/lib/core/tools.c#L532
Comment 7 Tim-Philipp Müller 2016-11-12 20:17:36 UTC
I think we want something that takes inspiration from both and at least use it as an internal helper when printing link failure debug log messages, and then we can see if we want to expose it too.

The code just added to gstparse might be special because of the filter caps thing which most other link code doesn't have (I think), so that code probably needs to work a bit differently.
Comment 8 Sebastian Dröge (slomo) 2017-01-18 13:44:33 UTC
This caused a deadlock, see https://bugzilla.gnome.org/show_bug.cgi?id=777449