[gst-devel] Python vumeter example in 0.10 not working under Ubuntu Breezy

Stuart Langridge sil at kryogenix.org
Mon Jan 2 01:32:21 CET 2006

I've compiled and installed gstreamer 0.10.1 with corresponding
versions of gst-plugins-base, gst-plugins-good, and gst-python on
Ubuntu Breezy in $HOME/src/gstreamer/build. When I try running the
Python vumeter.py example (share/gst-python/0.10/examples/vumeter.py),
I have some problems.
I'm using the command
"PYTHONPATH=~/src/gstreamer/build/lib/python2.4/site-packages/ python
vumeter.py" to run.

When I first run it, I get the error (in a popup dialog) "Could not
set state" and the program terminates. This seems to be being tripped
by the  line

if pipeline.set_state(gst.STATE_PLAYING) == gst.STATE_CHANGE_SUCCESS:

which fails; instead, that function returns STATE_CHANGE_ASYNC rather
than STATE_CHANGE_SUCCESS. I've discovered that if I wait a little and
then call pipeline.set_state again, I do get a STATE_CHANGE_SUCCESS,
by changing vumeter.py as follows:

--- vumeter.py.orig     2005-12-30 06:22:19.000000000 +0000
+++ vumeter.py  2005-12-30 06:24:19.000000000 +0000
@@ -93,7 +93,12 @@
             i = pipeline.get_bus().connect('message::application',
-            if pipeline.set_state(gst.STATE_PLAYING) ==
+            sta = pipeline.set_state(gst.STATE_PLAYING)
+            print sta
+            import time
+            time.sleep(1)
+            sta = pipeline.set_state(gst.STATE_PLAYING)
+            if sta == gst.STATE_CHANGE_SUCCESS:
                 print "going into main"

at which point sta does equal STATE_CHANGE_SUCCESS and "going into
main" is printed; I then get a window with a vumeter in it, but
nothing ever shows up in that vumeter, no matter how loudly I shout
into my microphone.

I've tested my sound setup with the command
~/src/gstreamer/build/bin/gst-launch-0.10 alsasrc ! goom ! ximagesink
which works and shows lots of pretty patterns when I speak into the
mic, so I believe that alsasrc is working correctly and correctly
showing output.

Does the dbus stuff require a higher version of dbus than I have? (I
have 0.36.2, I think, which is whatever's standard in Ubuntu breezy.)


Stuart Langridge

More information about the gstreamer-devel mailing list