New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gst.LinkError: <enum GST_PAD_LINK_WAS_LINKED of type GstPadLinkReturn> #144

Closed
jodal opened this Issue Feb 8, 2012 · 9 comments

Comments

2 participants
@jodal
Member

jodal commented Feb 8, 2012

I got the following crash once when I tried to play a track:

INFO     Starting Mopidy 0.6.1 on Linux-3.2.0-14-generic-x86_64-with-Ubuntu-12.04-precise CPython 2.7.2+
...
DEBUG    2012-02-08 13:31:29,021 [2270:PykkaActorThread-8] mopidy.frontends.mpris
  Received track playback started event
DEBUG    2012-02-08 13:31:29,021 [2270:PykkaActorThread-7] mopidy.frontends.lastfm
  Now playing track: Sivert Høyem - Under Administration
DEBUG    2012-02-08 13:31:29,021 [2270:PykkaActorThread-147] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:48785 from urn:uuid:dbf126ec-cccb-4e02-a6fd-9abd44f4a89e: OK
DEBUG    2012-02-08 13:31:29,021 [2270:PykkaActorThread-8] mopidy.frontends.mpris
  org.freedesktop.DBus.Properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus') called
DEBUG    2012-02-08 13:31:29,022 [2270:PykkaActorThread-147] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:48785 to urn:uuid:dbf126ec-cccb-4e02-a6fd-9abd44f4a89e: status
DEBUG    2012-02-08 13:31:29,022 [2270:PykkaActorThread-8] mopidy.frontends.mpris
  org.freedesktop.DBus.Properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata') called
DEBUG    2012-02-08 13:31:29,034 [2270:PykkaActorThread-1] mopidy.gstreamer
  Setting GStreamer state to GST_STATE_READY: OK
DEBUG    2012-02-08 13:31:29,037 [2270:PykkaActorThread-8] mopidy.frontends.mpris
  org.freedesktop.DBus.Properties.PropertiesChanged(org.mpris.MediaPlayer2.Player, {'Metadata': dbus.Dictionary({'xesam:url': 'spotify:track:0eGLCPZbIYPQ1mxA82eL1J', 'xesam:album': u'Long Slow Distance', 'mpris:length': 292000000, 'xesam:title': u'Under Administration', 'xesam:trackNumber': 1, 'xesam:artist': dbus.Array([u'Sivert H\xf8yem'], signature=dbus.Signature('s')), 'mpris:trackid': '/com/mopidy/track/58'}, signature=dbus.Signature('sv')), 'PlaybackStatus': 'Playing'}, []) signaled
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/mopidy/gstreamer.py", line 86, in _on_new_pad
    pad.link(target_pad)
gst.LinkError: <enum GST_PAD_LINK_WAS_LINKED of type GstPadLinkReturn>

I'm using Ubuntu 12.04 Alpha dist-upgraded today, which includes the following GStreamer packages:

$ dpkg -l | grep ' gstreamer' | awk -F' ' '{ print $2, $3 }' | column -t
gstreamer0.10-alsa               0.10.35.3-1
gstreamer0.10-ffmpeg             0.10.13-1
gstreamer0.10-fluendo-mp3        0.10.15.debian-1ubuntu1
gstreamer0.10-gconf              0.10.30.2-2ubuntu2
gstreamer0.10-nice               0.1.1-1ubuntu1
gstreamer0.10-plugins-bad        0.10.22-2ubuntu5
gstreamer0.10-plugins-base       0.10.35.3-1
gstreamer0.10-plugins-base-apps  0.10.35.3-1
gstreamer0.10-plugins-good       0.10.30.2-2ubuntu2
gstreamer0.10-plugins-ugly       0.10.18.3-1ubuntu1
gstreamer0.10-pulseaudio         0.10.30.2-2ubuntu2
gstreamer0.10-tools              0.10.35.3-1
gstreamer0.10-x                  0.10.35.3-1
@jodal

This comment has been minimized.

Member

jodal commented Feb 8, 2012

This issue also causes the following error:

ERROR    2012-02-08 13:45:51,919 [3545:MainThread] mopidy.gstreamer
  GStreamer encountered a general stream error. gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:pipeline0/GstURIDecodeBin:uri/GstAppSrc:source:
streaming task paused, reason not-linked (-1)
DEBUG    2012-02-08 13:45:51,922 [3545:MainThread] mopidy.gstreamer
  Setting GStreamer state to GST_STATE_NULL: OK
@adamcik

This comment has been minimized.

Member

adamcik commented Feb 9, 2012

Could you add a GST_DEBUG=3 output as well? As for a fix I'm sure adding a pad.is_linked() check would do the trick, but I would like to understand what is wrong / has changed first :-)

@jodal

This comment has been minimized.

Member

jodal commented Feb 9, 2012

See http://hastebin.com/raw/hutomaruyu for a full run with GST_DEBUG=3. Search for LinkError in the log.

@jodal

This comment has been minimized.

Member

jodal commented Feb 9, 2012

@adamcik If you fix this, do it in a branch based on master, as it's a good candidate for a v0.6.2 to make v0.6 working on Ubuntu 12.04.

@adamcik

This comment has been minimized.

Member

adamcik commented Feb 9, 2012

Turns out the problem is that the convert element hasn't been unlinked at this stage, so we really need to check if it is linked and then unlink it instead

@jodal

This comment has been minimized.

Member

jodal commented Feb 10, 2012

Given the above fix, I get the following error:

GStreamer-CRITICAL **: gst_pad_unlink: assertion `GST_PAD_IS_SRC (srcpad)' failed
Traceback (most recent call last):
  File "/home/sjodal/dev/mopidy/mopidy/gstreamer.py", line 88, in _on_new_pad
    pad.link(target_pad)
gst.LinkError: <enum GST_PAD_LINK_WAS_LINKED of type GstPadLinkReturn>

Did I misinterpret the explanation you gave on IRC?

@adamcik

This comment has been minimized.

Member

adamcik commented Feb 10, 2012

Looks correct, might just have been that I have misdiagnosed something.

@jodal

This comment has been minimized.

Member

jodal commented Feb 13, 2012

I checked the docs for unlink(), and it seems that it only accepts the sinkpad as an argument. I switched around the srcpad and the sinkpad in commit eb8ecc3, and now the patch seems to work nicely.

@jodal

This comment has been minimized.

Member

jodal commented Feb 13, 2012

Fixed in 2617daa.

@jodal jodal closed this Feb 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment