GNOME Bugzilla – Bug 346059
Ogg support for gnome-games
Last modified: 2007-05-17 15:59:52 UTC
I think gnome-games should support the .ogg sound format. By using .ogg instead of .wav, the sound files distributed with gnome-games can be reduced from about 600 KB to as little as 200 KB. As more sounds are added, the savings will be eaven greater. Gnome-games used libgnome for sound, which only supports .wav at the moment. Support for .ogg is planned, but not implemented. SDL_mixer can be used to play .ogg files, so I strongly think that we should use this library to play .ogg, until libgnome catches up. Patches to add SDL_mixer support to gnome-games is welcome. :)
I don't think SDL_mixer is the right library to use. gstreamer is the library we should be using since the rest of the GNOME desktop already uses it. Unfortunately gstreamer doesn't have beeps and whistles as its target use and is a little inefficient. There is sample code in gnomine showing roughly how to do this, but not all the caching problems where sorted out. gstreamer supports ogg (and flac and whatever else might be appropriate).
Like Callum, I disagree on using an SDL implementation, but agree on using compressed files, and more imporatntly, using gstreamer for the implementation... Gnometris does the best job of exposing weird side effects and bugs I've heardon almost every platform I've played it on.
What makes gstreamer the best library to use? Neither of you provided any arguments for using gstreamer. The gstreamer implementation in gnomine has been commented out and unusable for over a year. Why has it not been fixed before? If the library is very difficult to use, this is a large disadvantage.
gstreamer is part of the GNOME platform so we can guarantee it is available. SDL_mixer is something we'd have to test for and make a compile-time option. Given that currently SDL_mixer is typically outside the core of most distributions this could cause trouble if distros decide to ship gnome-games without sound rather than shipping with a dependency on SDL_mixer. It would also appear that gstreamer supports more formats (although that could be a limitation of the documentation I've found rather than the actual software). gstreamer is less than ideal - it is hideously over-engineered for our needs - but the critical code only needs to be written once and can be recycled throughout the games. The gnomine code isn't exactly broken, it is incomplete and never got beyond a proof-of-concept before I ran out of spare time to make it useful.
Besides the simple deployment and dependency issues, there are significant advantages to using components sticking with the GNOME stack, especially if there's no great advantage to using SDL. We are fairly certain that gstreamer will continue to have developers and volunteers there to support it, ABI stability, that the package will be rigourously bugfixed and see stable releases every 6 months, and if we really need to get some API or features added, then it'll probably happen... Gnome-games has been the origin of several additions to other core libraries through the years. Why has it not been fixed before? Time is the quick answer for me as well, but really, it's just not a priority that anyone cares terribly much about, and feature additions have really taken a back seat to bug fixing during the past year or so. I certainly care less about the code and far more about replacing the sounds we've got with ones that don't sound like trash (see gnobots) (Bug #152107), and honestly, that would be easy work.
Ok. I have a look at gstreamer, and try to make to work properly in gnomine first.
Created attachment 68662 [details] [review] Patch adding GStreamer support to gnome-games.
The above patch adds GStreamer support to gnome-games, which allows .ogg files to be played. Currently, only gnometris is modified to use the GStreamer. It would be nice if people could test and possibly improve this patch enough, so that it could be integrated into gnome-games 2.15.4. To test the patch, first apply it, then run 'oggenc *.wav' in gnometris/sounds to create ogg files from the wav files. I have tested the patch using GStreamer 0.10.4, 0.10.8 and 0.10.8.1. Version 0.10.4 sometimes creashes, while 0.10.8 and 0.10.8.1 creates a GStreamer-CRITICAL warning. These warnings and crashes need to be resolved.
Have you found the cause of the CRITICAL warnings?
The GStreamer-CRITICAL is: Trying to dispose object "audiosinkringbuffer1", but it still has a parent "alsasink1". You need to let the parent manage the object instead of unreffing the object directly. I get the same warning from some other applications using GStreamer as well, so it could be a problem with GStreamer, and not the patch itself...
Waiting for this to be fixed in Bug #94615 instead.
Now gnome-games has experimental GStreamer support in SVN.