Re: UltimateStunts packaged but problems with sound

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--- ultimatestunts-srcdata-0701/ultimatestunts/sndsample.cpp~	2007-03-07 09:16:32.000000000 +0100
+++ ultimatestunts-srcdata-0701/ultimatestunts/sndsample.cpp	2007-03-07 09:16:32.000000000 +0100
@@ -141,6 +141,11 @@
 	}
 	else //default ALUT loader
 	{
+		/* alutCreateBufferFromFile aborts if there is an old al-error
+		   set, which sometimes happens. We really need better al-error
+		   detecting overal, but calling alGetError(); here atleast
+		   stop alutCreateBufferFromFile from aborting in this case. */
+		alGetError();
 		m_Buffer = alutCreateBufferFromFile(realfile.c_str());
 
 		if(m_Buffer == AL_NONE)
-- 
fedora-extras-list mailing list
fedora-extras-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-extras-list

[Index of Archives]     [Fedora General Discussion]     [Fedora Art]     [Fedora Docs]     [Fedora Package Review]     [Fedora Desktop]     [Big List of Linux Books]     [Yosemite Backpacking]     [KDE Users]

  Powered by Linux