UltimateStunts packaged but problems with sound

Hans de Goede j.w.r.degoede at hhs.nl
Wed Mar 7 09:21:47 UTC 2007


Dan Horák wrote:
> Hello,
> 
> I have prepared a package with UltimateStunts - a remake of famous DOS
> game called Stunts
> (http://www.ultimatestunts.nl/index.php?page=0&lang=en). Only the spec
> file is available at http://fedora.danny.cz/ultimatestunts.spec , srpm
> will be uploaded later due some problems with my Internet connection.
> Everything looks good - it is under GPL, it compiles on FC6/x86_64 and
> in mock for Development/i386, tools can be run etc. But the game itself
> has some problem with loading sounds in wav files via the OpenAL/ALUT
> libraries. If there is anybody familiar with these sound libraries,
> please take a look. The errors are here:
> 

Hi,

I've been doing some debugging on this and the problem is that playSong (which 
gets called when sound is initialised to play the first song), calls setSample 
on an SoundObject created from a .ogg, then setSample in turn calls 
CSndSample::attachToChannel, which calls alSourcei(x, AL_BUFFER, m_Buffer);
this alSourcei call fails setting alError to "al invalid enum value".

Now later in the game when the sound data gets loaded 
alutCreateBufferFromFile() gets called and alutCreateBufferFromFile() is one of 
a few alut functions which checks to see if there have been no previous 
alError's before it was called and if there were previous error aborts with 
the: "There was already an AL error on entry to an ALUT function"

We can work around this problem in 2 ways:
1) call alGetError() after the alSourcei(...) in CSndSample::attachToChannel
2) call alGetError() before alutCreateBufferFromFile(...) in sndsample.cpp

I've choosen to go with method 2, as that will also work around alerror's being 
thrown elsewhere (although I've not encountered this situation).

The proper fix would be to fix the code so that alSourcei() does not signal an 
error condition, but my understanding of the code is not good enough for that.

It would also be a very good idea to call (and check the result of) 
alGetError() after each al call, printing a message if an al call fails, that 
would have actually fixed this problem, and at the same made the developers 
aware that there is a problem. Error checking is good!

I've attached a patch with wotkaround 2. Please send this mail upstream so that 
they can do a proper fix.

Regards,

Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ultimatestunts-0701-alerror.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/games/attachments/20070307/89330402/attachment.bin 


More information about the games mailing list