OGRE EXCEPTION(40961) in windows

diskette

14-10-2008 15:42:10

When run on Vista it runs normal, but when I run this error occurs in XP

faraklit

27-10-2008 11:00:49

try installing oalinst OpenAL Installer for Windows

Llarlen

22-11-2008 22:33:20

Got the same error on OSX and could fix it with the following code changes:

Index: C++/Add-ons/Sound/OgreAL/Source/OgreALSoundManager.cpp
===================================================================
--- C++/Add-ons/Sound/OgreAL/Source/OgreALSoundManager.cpp (Revision 337)
+++ C++/Add-ons/Sound/OgreAL/Source/OgreALSoundManager.cpp (Revision 338)
@@ -679,11 +679,26 @@

void SoundManager::initializeDevice(const Ogre::String& deviceName)
{
- alcGetIntegerv(NULL, ALC_MAJOR_VERSION, sizeof(mMajorVersion), &mMajorVersion);
- CheckError(alcGetError(NULL), "Failed to retrieve version info");
- alcGetIntegerv(NULL, ALC_MINOR_VERSION, sizeof(mMinorVersion), &mMinorVersion);
- CheckError(alcGetError(NULL), "Failed to retrieve version info");
+ // First open the default device and context to get the version information.
+ mDevice = alcOpenDevice(NULL);
+ CheckError(alcGetError(mDevice), "Failed to open Device");
+ CheckCondition(mDevice != NULL, 13, "Failed to open audio device");
+ mContext = alcCreateContext(mDevice, NULL);
+ CheckError(alcGetError(mDevice), "Failed to create Context");
+ CheckCondition(mContext != NULL, 13, "Failed to create OpenAL Context");
+ alcMakeContextCurrent(mContext);
+ CheckError(alcGetError(mDevice), "Failed to set current context");

+ alcGetIntegerv(mDevice, ALC_MAJOR_VERSION, sizeof(mMajorVersion), &mMajorVersion);
+ CheckError(alcGetError(mDevice), "Failed to retrieve version info");
+ alcGetIntegerv(mDevice, ALC_MINOR_VERSION, sizeof(mMinorVersion), &mMinorVersion);
+ CheckError(alcGetError(mDevice), "Failed to retrieve version info");
+
+ // Close the default device and context before proceeding.
+ alcMakeContextCurrent(NULL);
+ alcDestroyContext(mContext);
+ alcCloseDevice(mDevice);
+
Ogre::LogManager::getSingleton().logMessage("OpenAL Version: " +
Ogre::StringConverter::toString(mMajorVersion) + "." +
Ogre::StringConverter::toString(mMinorVersion));
@@ -800,6 +815,7 @@

// Create our pool of sources
mMaxNumSources = createSourcePool();
+ CheckCondition(mMaxNumSources != 0, 13, "Failed to create source pool");
}

void SoundManager::updateSounds()


Checking the version without a device would generate the error we got. Now simply creating a device is not enough, since without a proper context an error would then be generated which won't be caught until creation of the source pool.

edit: might be more efficient to only destroy the default device if it's not needed...