[gst-devel] Gnonlin as a constant source of audio

Mike MacHenry dskippy at ccs.neu.edu
Tue Jun 10 04:46:12 CEST 2008


I am writing a program using Gnonlin, which I feel might be a using
the plugin in a way that it was not quite designed for. I am getting
non-deterministic errors which are very difficult to pin down and I
would like to just explain my design to the mailing list now. I am
hoping to get some feedback on whether this design is too far from
what gnonlin is supposed to do and if it's a wonder that it works. Or
if maybe it's perfectly normal and the errors are well known.

The design:
Gnonlin seems to be designed to have several gnlfilesrc objects added
to a gnlcomposition along with gnloperations and such and then played.
There is a distinct separation between composition and playing. What I
am doing is creating a composition with one file source in it and
listening to the bus for a message telling me that that file has
started playing. When it has, I add another file source to the
composition after it. Once I get the signal that that next file is
playing I queue up a third file and remove the first file source from
the composition and stop it so that it can be cleaned up in memory.
This goes on infinitely (in theory).

The Problem:
Occasionally, and eventually, it seems, for all streams I create, the
composition gets confused. As soon as I queue up a file source for
file number N with in the call back for file number N-1, I immediately
receive a message that file N is playing, which causes my code to
queue up a file source for N+1 and then N+1's message is also
immediately sent and so forth until a ton of filesources are added. I
immediately get an overload of file sources in the program and it
crashes. It also seems to increase with load on the system. When 10
clients play at once, they each run away at a faster rate.

I can't figure out how the composition could get so out of sink. I
suspect it has to do with its internal notion of the time line.
Possibly I am confusing it with the way I add things. I welcome any
ideas at all. Including questioning whether or not using gnonlin is
right for this. Is there some other way of playing scheduled audio
infinitely and dynamically? I have given the plugins a really good
look over and I'm pretty sure there is no clear alternative but
perhaps there is a clever use of other plugins I've not thought of.

Thanks for you help. I apologize for not having a reduced code example
in this email but I tried very for a while to get a reduction that
exhibits the issue but it's just so hard to reproduce consistantly. If
you would like to read through the code that does this it is on source
forge. Here is a link to the specific file of interest.

http://roundware.svn.sourceforge.net/viewvc/roundware/server/roundwared/stream.py?revision=42&view=markup

There is actually a function in there called has_runaway which is a
hack to make the effects of this bug in my program more tolerable. You
can find the rest of the code from their if you're interested. In case
you are wondering what the big picture is, this code is a museum audio
installation open now. Here is a link:

http://aldrichart.org/exhibitions/burgund.php

The link has an audio demo that may be illuminating as to what I'm
doing with this code.

-mike




More information about the gstreamer-devel mailing list