paran01d
05-02-2010 21:59:31
Hey,
Im fairly new to ogre dev (stopped and started with bits over the years) and therefore have been following the Create a shoot em up tutorial to get to grips with everything,
that tutorial uses fmod for sound which I couldn't get to work on my Karmic Ubuntu (binaries yuck). So long story short I found out that this is the lib to use for sound now and set it up,
though ive had a few problems on the way using OgreOggSound with Linux so thought id share. First off the OpenAL soft package thats in the Karmic apt repositories doesnt work, it seems to hang
at the device detection stage, getting and building the latest OpenAL soft stops it hanging at this step, though theres a few bugs in ogreoggsoundmanger.cpp that stops it working further.
Heres the output of svn diff, the first bit gets the version detection to work buy creating a NULL device as opposed to using NULL (this could be just a linux openal soft thing). And the second, that took me a few
days of tearing my hair our till I saw the obviousness of it, cuts down a windows #if so that the OpenAL context is now created on othe rplatforms than just Linux.
Also to note that in your own project you need to link with the lib vorbisfile as well as the other libs, unfortunately this doesn't show up with pkg-config as a dependency so i just grafted it in manually to my CMakeLists.
thanks for the great lib..
paran01d
Im fairly new to ogre dev (stopped and started with bits over the years) and therefore have been following the Create a shoot em up tutorial to get to grips with everything,
that tutorial uses fmod for sound which I couldn't get to work on my Karmic Ubuntu (binaries yuck). So long story short I found out that this is the lib to use for sound now and set it up,
though ive had a few problems on the way using OgreOggSound with Linux so thought id share. First off the OpenAL soft package thats in the Karmic apt repositories doesnt work, it seems to hang
at the device detection stage, getting and building the latest OpenAL soft stops it hanging at this step, though theres a few bugs in ogreoggsoundmanger.cpp that stops it working further.
Heres the output of svn diff, the first bit gets the version detection to work buy creating a NULL device as opposed to using NULL (this could be just a linux openal soft thing). And the second, that took me a few
days of tearing my hair our till I saw the obviousness of it, cuts down a windows #if so that the OpenAL context is now created on othe rplatforms than just Linux.
--- ogreoggsoundmanager.cpp (revision 274)
+++ ogreoggsoundmanager.cpp (working copy)
@@ -195,16 +195,19 @@
int majorVersion;
int minorVersion;
+ ALCdevice *device = alcOpenDevice(NULL);
// Version Info
- alcGetIntegerv(NULL, ALC_MAJOR_VERSION, sizeof(majorVersion), &majorVersion);
- if (alGetError())
+ alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(majorVersion), &majorVersion);
+ ALCenum error = alcGetError(device);
+ if (error != ALC_NO_ERROR)
{
LogManager::getSingleton().logMessage("Unable to get OpenAL Major Version number", Ogre::LML_CRITICAL);
return false;
}
- alcGetIntegerv(NULL, ALC_MINOR_VERSION, sizeof(minorVersion), &minorVersion);
- if (alGetError())
+ alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(minorVersion), &minorVersion);
+ error = alcGetError(device);
+ if (error != ALC_NO_ERROR)
{
LogManager::getSingleton().logMessage("Unable to get OpenAL Minor Version number", Ogre::LML_CRITICAL);
return false;
@@ -252,6 +255,9 @@
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
ALint attribs[2] = {ALC_MAX_AUXILIARY_SENDS, 4};
+#else
+ ALint attribs[1] = {4};
+#endif
mContext = alcCreateContext(mDevice, attribs);
if (!mContext)
@@ -267,7 +273,6 @@
Ogre::LogManager::getSingletonPtr()->logMessage("OgreOggSoundManager::init() ERROR - Unable to set context", Ogre::LML_CRITICAL);
return false;
}
-#endif
_checkFeatureSupport();
Also to note that in your own project you need to link with the lib vorbisfile as well as the other libs, unfortunately this doesn't show up with pkg-config as a dependency so i just grafted it in manually to my CMakeLists.
thanks for the great lib..
paran01d