# Curious GStreamer bug

**URL:** <https://www.ruby-forum.com/t/curious-gstreamer-bug/226061>\
**Category:** Ruby-Gnome 2\
**Created:** [March 2, 2010, 7:38am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061 "2010-03-02T07:38:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 2, 2010, 7:38am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/1 "2010-03-02T07:38:42Z")

</div>

Hi everyone!

I have a very strange behaviour with gstreamer. Under certain  
circonstances, the play method of a playbin object freeze my Gtk/Gst  
applycation. This is an example of a freezing code.

======================================================  
#!/usr/bin/env ruby

# encoding: UTF-8

#gst-launch playbin  
uri=“[http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3](http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3)”

require ‘gtk2’  
require ‘gst’

class Player  
def initialize  
@playbin=Gst::ElementFactory.make(‘playbin’)  
@playbin.ready  
end

def stop  
@playbin.stop  
end

def play  
@playbin.uri=‘[http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3](http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3)’  
#@playbin.uri=‘file:///home/instable/Musique/01 - Blue Bird.mp3’  
p “Going to play…”  
@playbin.play  
p “Playing.”  
end  
end

class Gui  
def initialize(player)  
@player=player  
@bstop=Gtk::Button.new(‘Stop’)  
@bstop.signal\_connect(‘clicked’){@player.stop}  
@bplay=Gtk::Button.new(‘Play’)  
@bplay.signal\_connect(‘clicked’){@player.play}  
@box=Gtk::HBox.new  
@box.pack\_start(@bstop)  
@box.pack\_start(@bplay)  
@window=Gtk::Window.new  
@window.add(@box)  
@window.show\_all  
@window.signal\_connect(“delete\_event”){Gtk\_quit; true}  
#@player.play  
end  
end

# player=Player.new gui=Gui.new(player) #player.play Gtk.main

Did it also freeze the program on clicking the play button on your  
machine ?

I will try to explain the circonstances needed for a freeze.  
The uri need to a webradio (maybe not all webradios freezes). No  
freeze with loacal files.  
The play method must be called from a block. No freeze if it is called  
from the main code or within the Gui#initialize method.

If the uri was all ready played, the play method from a block do not  
freeze the programm. (If I call player.play from main code, I can use  
the stop and then the play button without freezing the programm.

Am I doing something wrong ?

```
Vincent

```

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 2, 2010, 11:04am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/2 "2010-03-02T11:04:10Z")

</div>

2010/3/2 vincent carmona [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Did it also freeze the program on clicking the play button on your machine ?

No.  
On debian sid :  
Tested with 1.8.7, RG2 0.19.3  
and 1.9.1, RG2 svn

I tried several times to stop/play, and it works ok.

Btw, Gtk\_quit is undefined.

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 2, 2010, 5:02pm UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/3 "2010-03-02T17:02:24Z")

</div>

I am testing the script on sid. and it freezes!  
Gtk::VERSION=[2, 18, 7], Gtk::BINDING\_VERSION=[0, 19, 3]. Ruby 1.8.7

I have libgst-ruby1.8 and libgtk2-ruby1.8 packages installed but  
neither ruby-gnome2, ruby-gnome2-dev nor libgnome2-ruby1.8.  
Which packages do you have installed on your sid ?

aptitude search ruby | grep ^i  
i A libatk1-ruby1.8 - ATK bindings for the Ruby language

i A libcairo-ruby1.8 - Cairo bindings for the Ruby  
language

i A libgdk-pixbuf2-ruby1.8 - Gdk-Pixbuf 2 bindings for the Ruby  
languag  
i libgettext-ruby1.8 - Gettext for ruby1.8

i A libglib2-ruby1.8 - Glib 2 bindings for the Ruby  
language

i libgst-ruby - GStreamer bindings for the Ruby  
language  
i A libgst-ruby1.8 - GStreamer bindings for the Ruby  
language  
i libgtk2-ruby - GTK+ bindings for the Ruby  
language

i A libgtk2-ruby1.8 - GTK+ bindings for the Ruby  
language

i A liblocale-ruby1.8 - pure ruby locale library

i A libpango1-ruby1.8 - Pango bindings for the Ruby  
language

i A libreadline-ruby1.8 - Readline interface for Ruby 1.8

i A libreadline-ruby1.9 - Readline interface for Ruby 1.9

i A libruby - Libraries necessary to run Ruby  
1.8.x

i A libruby1.8 - Libraries necessary to run Ruby  
1.8

i A libruby1.9 - Libraries necessary to run Ruby  
1.9

i libtagc0-ruby - TagLib Audio Meta-Data Library for  
Ruby  
i A libtagc0-ruby1.8 - TagLib Audio Meta-Data Library for  
Ruby 1.  
i ruby - InterprÃ©teur pour le langage de  
script  
ori  
i ruby-dev - Header files for compiling  
extension  
modul  
i A ruby1.8 - Interpreter of object-oriented  
scripting l  
i A ruby1.8-dev - Header files for compiling  
extension  
modul  
i ruby1.9

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 3, 2010, 10:19am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/4 "2010-03-03T10:19:43Z")

</div>

2010/3/2 vincent carmona [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I am testing the script on sid. and it freezes!  
> Gtk::VERSION=[2, 18, 7], Gtk::BINDING\_VERSION=[0, 19, 3]. RubyÂ 1.8.7  
> I haveÂ libgst-ruby1.8 andÂ libgtk2-ruby1.8 packages installed but  
> neitherÂ ruby-gnome2,Â ruby-gnome2-dev nor libgnome2-ruby1.8.  
> Which packages do you have installed on your sid ?  
> aptitude search ruby | grep ^i

i A libart2-ruby - Libart 2 bindings for the Ruby  
language  
i A libart2-ruby1.8 - Libart 2 bindings for the Ruby  
language  
i A libatk1-ruby - ATK bindings for the Ruby language  
i A libatk1-ruby1.8 - ATK bindings for the Ruby language  
i A libcairo-ruby1.8 - Cairo bindings for the Ruby  
language  
i A libgconf2-ruby - GConf 2 bindings for the Ruby  
language  
i A libgconf2-ruby1.8 - GConf 2 bindings for the Ruby  
language  
i A libgdk-pixbuf2-ruby - Gdk-Pixbuf 2 bindings for the Ruby  
languag  
i A libgdk-pixbuf2-ruby1.8 - Gdk-Pixbuf 2 bindings for the Ruby  
languag  
i A libgettext-ruby-util - Gettext utilities for ruby (dummy  
package)  
i A libgettext-ruby1.8 - Gettext for ruby1.8  
i A libglade2-ruby - Libglade 2 bindings for the Ruby  
language  
i A libglade2-ruby1.8 - Libglade 2 bindings for the Ruby  
language  
i A libglib2-ruby1.8 - Glib 2 bindings for the Ruby  
language  
i A libgnome2-ruby - GNOME 2 bindings for the Ruby  
language  
i A libgnome2-ruby1.8 - GNOME 2 bindings for the Ruby  
language  
i A libgnomecanvas2-ruby - GNOME Canvas 2 bindings for the  
Ruby langu  
i A libgnomecanvas2-ruby1.8 - GNOME Canvas 2 bindings for the  
Ruby langu  
i A libgnomevfs2-ruby - GNOME VFS 2 bindings for the Ruby  
language  
i A libgnomevfs2-ruby1.8 - GNOME VFS 2 bindings for the Ruby  
language  
i libgst-ruby - GStreamer bindings for the Ruby  
language  
i A libgst-ruby1.8 - GStreamer bindings for the Ruby  
language  
i libgstreamer0.10-ruby - GStreamer 0.10 bindings for the  
Ruby langu  
i A libgstreamer0.10-ruby1.8 - GStreamer 0.10 bindings for the  
Ruby langu  
i A libgtk-mozembed-ruby - ruby binding of GtkMozEmbed, gecko  
rendere  
i A libgtk-mozembed-ruby1.8 - ruby binding of GtkMozEmbed, gecko  
rendere  
i A libgtk2-ruby - GTK+ bindings for the Ruby  
language  
i A libgtk2-ruby1.8 - GTK+ bindings for the Ruby  
language  
i A libgtkglext1-ruby - GTK+ GL extension bindings for the  
Ruby la  
i A libgtkglext1-ruby1.8 - GTK+ GL extension bindings for the  
Ruby la  
i A liblocale-ruby1.8 - pure ruby locale library  
i A libopengl-ruby - OpenGL binding for Ruby  
i A libpanel-applet2-ruby - GNOME 2 panel applet library  
bindings for  
i A libpanel-applet2-ruby1.8 - GNOME 2 panel applet library  
bindings for  
i A libpango1-ruby - Pango bindings for the Ruby  
language  
i A libpango1-ruby1.8 - Pango bindings for the Ruby  
language  
i A libreadline-ruby1.8 - Readline interface for Ruby 1.8  
i A librsvg2-ruby - RSVG renderer bindings for the  
Ruby langua  
i A librsvg2-ruby1.8 - RSVG renderer bindings for the  
Ruby langua  
i A libruby - Libraries necessary to run Ruby  
1.8.x  
i A libruby1.8 - Libraries necessary to run Ruby  
1.8  
i libsqlite3-ruby - SQLite3 interface for Ruby  
i A libsqlite3-ruby1.8 - SQLite3 interface for Ruby 1.8  
i libtagc0-ruby - TagLib Audio Meta-Data Library for  
Ruby  
i A libtagc0-ruby1.8 - TagLib Audio Meta-Data Library for  
Ruby 1.  
i A libvte-ruby - VTE widget bindings for the Ruby  
language  
i A libvte-ruby1.8 - VTE widget bindings for the Ruby  
language  
i A ruby - InterprÃ©teur pour le langage de  
script ori  
i ruby-gnome2 - GNOME-related bindings for the  
Ruby langua  
i A ruby1.8 - Interpreter of object-oriented  
scripting l  
i ruby1.8-dev - Header files for compiling  
extension modul  
i rubygems - package management framework for  
Ruby libr  
i A rubygems1.8 - package management framework for  
Ruby libr  
i rubyripper - a digital audio extraction  
algorithm

That’s with debian packaged 1.8.7.

I also use 1.9.1 through rvm, and ruby-gnome2-svn compiled from source.

I also have :  
$ aptitude search gst | grep ^i  
i A bluez-gstreamer - Bluetooth GStreamer support  
i A gir1.0-gstreamer-0.10 - Description: GObject introspection  
data fo  
i gstreamer-tools - Tools for use with GStreamer  
i A gstreamer0.10-alsa - GStreamer plugin for ALSA  
i A gstreamer0.10-ffmpeg - FFmpeg plugin for GStreamer  
i gstreamer0.10-gnonlin - non-linear editing module for  
GStreamer  
i A gstreamer0.10-nice - ICE library (GStreamer plugin)  
i A gstreamer0.10-plugins-bad - GStreamer plugins from the “bad”  
set  
i A gstreamer0.10-plugins-base - GStreamer plugins from the “base”  
set  
i A gstreamer0.10-plugins-good - GStreamer plugins from the “good”  
set  
i A gstreamer0.10-plugins-ugly - GStreamer plugins from the “ugly”  
set  
i A gstreamer0.10-pulseaudio - GStreamer plugin for PulseAudio  
i A gstreamer0.10-tools - Tools for use with GStreamer  
i A gstreamer0.10-x - GStreamer plugins for X11 and  
Pango  
i libgst-ruby - GStreamer bindings for the Ruby  
language  
i A libgst-ruby1.8 - GStreamer bindings for the Ruby  
language  
i A libgstfarsight0.10-0 - Audio/Video communications  
framework: core  
i A libgstreamer-plugins-base0.10-0 - GStreamer libraries from the  
“base” set  
i libgstreamer-plugins-base0.10-d - GStreamer development files for  
libraries  
i A libgstreamer0.10-0 - Core GStreamer libraries and  
elements  
i libgstreamer0.10-dev - GStreamer core development files  
i libgstreamer0.10-ruby - GStreamer 0.10 bindings for the  
Ruby langu  
i A libgstreamer0.10-ruby1.8 - GStreamer 0.10 bindings for the  
Ruby langu  
i A python-gst0.10 - generic media-playing framework  
(Python bi

I also go through a squid proxy. If I disable the proxy, it freezes,  
obviously.

If you need more info, tell me.

Simon

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 3, 2010, 8:23pm UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/5 "2010-03-03T20:23:50Z")

</div>

2010/3/3, Simon A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I also go through a squid proxy. If I disable the proxy, it freezes,  
> obviously.

If you disable the proxy, GStreamer freeze cause it cannot reach the  
stream anymore. Does it also freeze the gui ?

```
Vincent

```

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 4, 2010, 8:12am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/6 "2010-03-04T08:12:05Z")

</div>

Apparently the freeze is caused by the souphttpsrc element.  
(If I replace the playbin by a simple souphttpsrc element the freeze  
still occurs)

On ubuntu I use the 0.10.16-1ubuntu3 version of  
gstreamer0.10-plugins-good. Simon can you post yours ?

Maybe I do not have a freeze because of your proxy.  
In souphttpsrc sources, code differs whether there is a proxy or not.  
[http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/ext/soup/gstsouphttpsrc.c#n1239](http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/ext/soup/gstsouphttpsrc.c#n1239)

Maybe I should file GStremear bug.

2010/3/4, vincent carmona [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 4, 2010, 7:13am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/7 "2010-03-04T07:13:34Z")

</div>

The bug may be thread related.  
If the play method of the playbin is called inside a thread the gui  
does not freeze. 🙂  
But if I use the join method on the thread the gui freezes.  
I was think at using a thread as a workaround.  
Gtk and threads are not good friend. Can I just call the play method  
on a thread?

# I hope someone will have an idea on why that bug occurs.

require ‘gtk2’  
require ‘gst’

class Player  
def initialize  
@playbin=Gst::ElementFactory.make(‘playbin’)  
@playbin.ready  
end

def stop  
@playbin.stop  
end

def play  
#@playbin.uri=‘file:///home/instable/Musique/01 - Blue Bird.mp3’  
@playbin.uri=‘[http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3](http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3)’  
p “Going to play…”  
[Thread.new{@playbin.play](mailto:Thread.new%7B@playbin.play); p “Playing.”}#.join  
end  
end

class Gui  
def initialize(player)  
@player=player  
@bstop=Gtk::Button.new(‘Stop’)  
@bstop.signal\_connect(‘clicked’){@player.stop}  
@bplay=Gtk::Button.new(‘Play’)  
@bplay.signal\_connect(‘clicked’){@player.play}  
@box=Gtk::HBox.new  
@box.pack\_start(@bstop)  
@box.pack\_start(@bplay)  
@window=Gtk::Window.new  
@window.add(@box)  
@window.show\_all  
@window.signal\_connect(“delete\_event”){Gtk.main\_quit; true}  
end  
end

# player=Player.new gui=Gui.new(player) Gtk.main

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 4, 2010, 10:50am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/8 "2010-03-04T10:50:08Z")

</div>

I know none of these languages. Ruby is the only one I am used to.  
Python is close to ruby maybe I can translate my bug. I suppose it  
have a Gtk and a Gstreamer libraries. I have not be able to reproduce  
the bug with only ruby/gst.

Thanks for your precious help.

```
Vincent.

```

2010/3/4, Simon A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 6, 2010, 6:19am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/9 "2010-03-06T06:19:47Z")

</div>

I have test this radio with python. There is no freeze.

I am guessing that the "bug " is in ruby libraries. Maybe I should  
open a bug on ruby-gnome tracker. What do you think ?

Vincent

2010/3/4, vincent carmona [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 4, 2010, 9:36am UTC](https://www.ruby-forum.com/t/curious-gstreamer-bug/226061/10 "2010-03-04T09:36:22Z")

</div>

2010/3/4 vincent carmona [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> If you disable the proxy, GStreamer freeze cause it cannot reach the  
> stream anymore. Does it also freeze the gui ?

Yes

> On ubuntu I use the 0.10.16-1ubuntu3 version of  
> gstreamer0.10-plugins-good. Simon can you post yours ?

PaquetÂ : gstreamer0.10-plugins-good  
VersionÂ : 0.10.18-1

PaquetÂ : libsoup2.4-1  
VersionÂ : 2.29.91-1

You might want to test it in Python/Perl, or vala maybe.

good luck
