GNOME Bugzilla – Bug 507131
GStreamer does not play short ogg sounds
Last modified: 2009-12-11 12:21:24 UTC
Playing sounds with GStreamer in gnome-games sometimes doesn't work. Sound is sometimes not played at all, and other times it is played correctly. To reproduce: - Start Aisleriot version 2.20.0 or later, (type 'sol' in command line). - Enable sounds on the menu: "Control" -> "Enable sounds". - Click on the deck to turn any new card. Each time a card is clicked, there should be a short clicking sound being played by GStreamer. At random times, the sound is silent. This could be related to the changes in bug #466717, where GStreamer could not play short .ogg sounds. This didn't happen in versions of GStreamer earlier than 0.10.12. Here are the versions I have installed: OpenSuSE Linux 10.3 (64 bit x84) GStreamer 0.10.15 (compiled from source) gst-plugins-base 0.10.15 GNOME 2.20.0 gnome-games 2.21.2
Created attachment 102073 [details] debug output of GST_DEBUG=play*:5,decodebin:5
Here is the player source code: http://svn.gnome.org/viewvc/gnome-games/trunk/libgames-support/games-sound.c?view=markup I should also note that there is usually no debug output at the times when GStreamer is silent when instructed to play a .ogg sound.
Have you tried with core/base from CVS? If not, any chance you could try those?
Running GStreamer from CVS didn't change anything, unfortunately.
Marking this as a blocker, because playing short .ogg sounds still doesn't work.
Could you attach (or give an URL) to a file that breaks?
Oh, from looking at the code one guess would be, that this is a bug there. You use a single pipeline for playback and whenever a sound should be played you set the URI and change the state to PLAYING and set to NULL (READY would be good enough btw) on EOS/ERROR. Now, if the pipeline is PLAYING and a new sound should be played the URI will be set and the pipeline doesn't change the state and still plays the first sound. Might this be the cause of this bug? A way around this would probably be, to set the state of the pipeline to something smaller than PAUSED, setting the URI and then go to PLAYING and do what is done now...
The code [1] also seems to use a thread pool with 10 worker threads which then operate on the same one single playbin object - that's just not going to work in the way you expect it to. http://svn.gnome.org/viewvc/gnome-games/trunk/libgames-support/games-sound.c?view=markup
Thanks for the feedback. Do you have any suggestions about how do to fix it? Basically, I that is needed is a simple way to play .ogg files with GStreamer, sometimes, possibly several sounds at the same time.
You could use as many pipelines as you have threads (requires it to open the sound device that many times in worst case) or use a single pipeline: audiotestsrc wave=silcence ! adder ! sink and then, whenever something is to be played create a new "src ! decodebin" bin that linkes to the adder. This requires that the audio device is open all the time. Also you probably have to add audioconvert, audioresample, capsfilter somewhere.
*** Bug 516905 has been marked as a duplicate of this bug. ***
*** Bug 520597 has been marked as a duplicate of this bug. ***
A bug was fixed in CVS that caused baseaudiosink to report EOS a little too early, before the audio was played.
closing, probably fixed. This works quite ok (20ms buffers): gst-launch audiotestsrc num-buffers=1 ! pulsesink