[Kde-games-devel] Making OpenAL mandatory for libkdegames

Ian Wadham iandw.au at gmail.com
Fri Oct 3 08:57:12 UTC 2014


Hi guys,

On 29/09/2014, at 1:13 AM, Albert Astals Cid wrote:
> El Diumenge, 28 de setembre de 2014, a les 20:17:22, Anuj Pahuja va escriure:
>> As per recent discussion and Ian's suggestion on using OpenAL in
>> libkdegames, I wanted to ask if OpenAL should finally be made mandatory for
>> sounds in libkdegames?
>> 
>> Opinions, people?
> 
> I have no strong opinion other than less code to maintain is always a good 
> thing.

Then you must be in favour of making OpenAL mandatory, Albert… :-)

In three years we have had no problems with sound in any games that
have adopted KgSound, with OpenAL as the recommended library. So
zero maintenance so far… :-)

OTOH we have had a lot of problems with games that were still using
Phonon a year or two ago, for example:

     https://bugs.kde.org/show_bug.cgi?id=329343
     After 5 or so "games" kshisen freezes.

We were having to tell users to turn sound off in such games, in order
to continue playing. These bugs were passed upstream to Phonon
but remain unsolved AFAIK.

In KGoldrunner, I returned from holiday just before a KDE 4 release at
the end of 2010 and found that the sounds had become complete
garbage, using Phonon. I was not going to put my reputation behind
such poor sound quality, nor that of my son, who composed the sounds.
It was only a few weeks till the release, so I just had to disable the sound
completely for that release.

Later, I tried for a month or more to get some help from the Phonon
people, but just got endless requests for debugging logs, upgrades to
new versions, etc. etc. None of these did any good, nor were any helpful
feedback or solutions to the problems forthcoming from the Phonon team.

In desperation I tried Stefan Majewski's (then experimental) sound library
for games and, with about a day and a half of effort, it was working like a
charm. All the sounds were crisp and clear and on-time. Co-incident
sounds were played clearly and there were even some sounds (the
hero's footsteps: short, very rapid sounds), that had never played before.

In KGoldrunner there is a test for whether OpenAL is present. If it is not,
sound is disabled and the user receives a message to advise him or her
to get OpenAL from their distro. In three years, I have had no feedback or
bug reports on account of that message, therefore I believe that OpenAL
must be widely available on distros --- so there is no longer any reason
to provide Phonon as a fallback.

Briefly, when it comes to playing rapid, short, precisely timed, possibly
overlapping sounds, such as are required in games, OpenAL is "fit for
purpose" and Phonon is not. I think this is because Phonon is mainly
designed for streaming sound and video from large files, whereas
OpenAL opens each short sound-file once and keeps it in a cache.

So IMHO we should definitely make OpenAL mandatory in games.
We should have done so years ago…

All the best, Ian W.




More information about the kde-games-devel mailing list