After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 507131 - GStreamer does not play short ogg sounds
GStreamer does not play short ogg sounds
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.15
Other Linux
: High normal
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 516905 520597 (view as bug list)
Depends on:
Blocks: 520597
 
 
Reported: 2008-01-03 22:34 UTC by Andreas Røsdal
Modified: 2009-12-11 12:21 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
debug output of GST_DEBUG=play*:5,decodebin:5 (101.01 KB, text/plain)
2008-01-03 22:41 UTC, Andreas Røsdal
Details

Description Andreas Røsdal 2008-01-03 22:34:59 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
Comment 1 Andreas Røsdal 2008-01-03 22:41:01 UTC
Created attachment 102073 [details]
debug output of GST_DEBUG=play*:5,decodebin:5
Comment 2 Andreas Røsdal 2008-01-03 22:52:00 UTC
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.
Comment 3 Tim-Philipp Müller 2008-01-07 13:05:37 UTC
Have you tried with core/base from CVS? If not, any chance you could try those?

Comment 4 Andreas Røsdal 2008-01-10 17:10:55 UTC
Running GStreamer from CVS didn't change anything, unfortunately.
Comment 5 Andreas Røsdal 2008-01-30 22:42:06 UTC
Marking this as a blocker, because playing short .ogg sounds still doesn't work.
Comment 6 Sebastian Dröge (slomo) 2008-02-13 08:47:35 UTC
Could you attach (or give an URL) to a file that breaks?
Comment 7 Sebastian Dröge (slomo) 2008-02-13 09:03:40 UTC
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...
Comment 8 Tim-Philipp Müller 2008-02-13 10:01:16 UTC
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
Comment 9 Andreas Røsdal 2008-02-13 18:23:50 UTC
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.
Comment 10 Sebastian Dröge (slomo) 2008-02-14 13:01:13 UTC
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.
Comment 11 Tim-Philipp Müller 2008-02-17 15:59:32 UTC
*** Bug 516905 has been marked as a duplicate of this bug. ***
Comment 12 Andreas Røsdal 2008-05-12 12:22:21 UTC
*** Bug 520597 has been marked as a duplicate of this bug. ***
Comment 13 Wim Taymans 2008-11-25 16:53:10 UTC
A bug was fixed in CVS that caused baseaudiosink to report EOS a little too early, before the audio was played.
Comment 14 Wim Taymans 2009-12-11 12:21:24 UTC
closing, probably fixed. This works quite ok (20ms buffers):

gst-launch audiotestsrc num-buffers=1 ! pulsesink