I actually was hacking on it last night on linux and with whatever Ubuntu has,
which I think is the 0.0.8 you're talking about. Here's notes on what I did
to get things kind of working (compiling and some tests working).
Downloaded it by svn,
$ svn co https://ogreal.svn.sourceforge.net/svnroot/ogreal/trunk/OgreAL-Eihort
$ cd OgreAL-Eihort
$ ./bootstrap
You should update your `aclocal.m4' by running aclocal.
' is already registered with AC_CONFIG_FILES.
../../lib/autoconf/status.m4:300: AC_CONFIG_FILES is expanded from...
configure.ac:38: the top level
(Note: ignore that first sentence, as bootstrap does what it says for you.)
This turned out to be because configure.ac is in DOS text format.
In fact, the Makefile.am are in DOS format also, so I ended up
doing this to convert any config* and Makefile* files from DOS
to Unix format:
$ find . -not -path '*.svn*' \
-exec perl -le'if($ARGV[0]=~/(Make|conf)/&&<>=~/\r\n/s){exit}else{exit 1}' {} \; \
-exec perl -i~ -pe's/\r\n/\n/g' {} \;
Try again:
$ ./bootstrap
You should update your `aclocal.m4' by running aclocal.
configure.ac: installing `./install-sh'
Demos/Basic_Demo/Makefile.am: installing `./depcomp'
configure.ac:38: required file `Demos/PlayPen_Demo/Makefile.in' not found
Panic? Nah... The directory Demos/PlayPen/ was named wrong,
it should've been called PlayPen_Demo like the others.
We have to let configure.ac know that:
$ diff -u configure.ac.~1~ configure.ac > ../playpen-conf.diff
$ cat ../playpen-conf.diff
--- configure.ac.~1~ 2007-12-08 00:26:28.000000000 +0100
+++ configure.ac 2007-12-08 00:35:23.000000000 +0100
@@ -46,7 +46,7 @@
Demos/Doppler_Demo/Makefile \
Demos/ManySources_Demo/Makefile \
Demos/MultiChannel_Demo/Makefile \
- Demos/PlayPen_Demo/Makefile \
+ Demos/PlayPen/Makefile \
OgreAL.pc])
AC_OUTPUT
Try again:
$ ./bootstrap
Wunderbar!
I like to install in my home directory (using --prefix) instead of
system wide, since I'm just playing:
$ ./configure --prefix=$HOME/.ogreal-install
$ make
...
make[2]: Entering directory `/home/slanning/games/ogreal/src/OgreAL-Eihort/Demos/Basic_Demo'
if g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -DOGRE_GUI_GLX -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/include/OGRE -I/usr//include/OIS -I/usr//include -g -O2 -MT Listener.o -MD -MP -MF ".deps/Listener.Tpo" -c -o Listener.o Listener.cpp; \
then mv -f ".deps/Listener.Tpo" ".deps/Listener.Po"; else rm -f ".deps/Listener.Tpo"; exit 1; fi
Listener.cpp: In constructor 'DeviceListener::DeviceListener(Ogre::RenderWindow*, Ogre::Camera*, Ogre::SceneManager*)':
Listener.cpp:41: error: 'class OIS::InputManager' has no member named 'numKeyboards'
make[2]: *** [Listener.o] Error 1
...
This error is because somebody stupidly renamed some
methods between OIS versions 0.99+1.0rc1 and 1.0,
and Ubuntu is using 0.99+1.0rc1.
Either write your congressperson, or install version 1.0.
Again, I do this in my home directory instead of blasting
away the Ubuntu packages:
$ tar -zxf ois-1.0.tar.gz
$ cd ois/
$ ./bootstrap
$ ./configure --prefix=$HOME/.ois-install
$ make
$ make install
Then rebuild OgreAL, telling it where OIS is (see `./configure --help`,
and `pkg-config --cflags OIS` and `pkg-config --libs OIS` for examples).
$ make distclean
$ export OIS_CFLAGS="-I$HOME/.ois-install/include"
(Note: even though `pkg-config --cflags OIS` has "-I/usr/include/OIS"
you must not add "/OIS" to OIS_CFLAGS, because Demos*/Listener.h
do #include "OIS/OISInputManager.h" with the OIS/ already in front;
otherwise, if you have OIS installed system-wide (with the Ubuntu package),
it will still pick up that one!)
$ export OIS_LIBS="-L$HOME/.ois-install/lib -lOIS"
$ ./bootstrap
$ ./configure --prefix=$HOME/.ogreal-install
$ make
$ make install
Now we can try the demos.
$ cd Demos/bin/
$ ./Basic
After doing the normal OGRE sample dialog, I get this error:
*-*-* OgreAL Initialization
MovableObjectFactory for type 'OgreAL_Sound' registered.
MovableObjectFactory for type 'OgreAL_Listener' registered.
*-*-* Creating OpenAL
OpenAL Devices
--------------
OGRE EXCEPTION(40961:): Failed to open Device: OpenAL Error: The specified source name is not valid in initializeDevice
An exception has occured: OGRE EXCEPTION(40961:): Failed to open Device: OpenAL Error: The specified source name is not valid in initializeDevice
OGRE EXCEPTION(40961:): Failed to open Device: OpenAL Error: The specified source name is not valid in initializeDevice
Panic? Not yet, not yet... Someone had this problem recently:
http://www.ogre3d.org/phpBB2addons/view ... 4259#34259
I patched (open-device.diff) up OgreALSoundManager.cpp according to the code
he put there, and it works now! That's really cool how the sound works
in the 3D scene. (I know that's the whole point, but I think it's neat.
Apparently there was a change in OpenAL or something,
and Ubuntu uses version >= 1.
The only problem left is that this happens when you quit the application:
*-*-* OgreAL Shutdown
OGRE EXCEPTION(40961:): Failed to destroy source: OpenAL Error: The specified source name is not valid in ~SoundManager
An exception has occured: OGRE EXCEPTION(40961:): Failed to destroy source: OpenAL Error: The specified source name is not valid in ~SoundManager
OGRE EXCEPTION(40961:): Failed to destroy source: OpenAL Error: The specified source name is not valid in ~SoundManager
Seems fixable, but I didn't look at it.
When I do the MultiChannel demo, it fails with:
OGRE EXCEPTION(40963:): Could not generate buffer: OpenAL Error: The value pointer given is not valid in generateBuffers
OGRE EXCEPTION(40961:): Failed to delete Buffers, must still be in use.: OpenAL Error: The specified source name is not valid in ~Sound
An exception has occured: OGRE EXCEPTION(40963:): Could not generate buffer: OpenAL Error: The value pointer given is not valid in generateBuffers
OGRE EXCEPTION(40963:): Could not generate buffer: OpenAL Error: The value pointer given is not valid in generateBuffers
Maybe it's related to the problem above, in particular the patch,
again I didn't look at it.
But the other two demos work, Doppler and Directional.
(Though, and maybe it's just because they're demos,
the sound quality is a bit....not right...)
The PlayPen and ManySources demos didn't build.
That was because Demos/Makefile.am hadn't been
updated with them. But maybe that's intended,
because they give errors:
$ ./PlayPen
...
An exception has occured: OGRE EXCEPTION(5:ItemIdentityException): Unable to derive resource group for RhinoJump.wav automatically since the resource was not found. in ResourceGroupManager::findGroupContainingResource at OgreResourceGroupManager.cpp (line 1366)
OGRE EXCEPTION(5:ItemIdentityException): Unable to derive resource group for RhinoJump.wav automatically since the resource was not found. in ResourceGroupManager::findGroupContainingResource at OgreResourceGroupManager.cpp (line 1366)
Hmm, maybe just that RhinoJump.wav is missing from Demos/Media/Audio/ .
$ ./ManySources
...
OGRE EXCEPTION(40962:): Failed to set offset: OpenAL Error: The specified parameter is not valid in setSecondOffset
*-*-* OgreAL Shutdown
OGRE EXCEPTION(40962:): Failed to set offset: OpenAL Error: The specified parameter is not valid in setSecondOffset
terminate called after throwing an instance of 'Ogre::Exception'
what(): OGRE EXCEPTION(40962:): Failed to set offset: OpenAL Error: The specified parameter is not valid in setSecondOffset
Aborted (core dumped)
Heehee...
Patches:
open-device.diff
--- src/OgreALSoundManager.cpp-bak 2007-12-08 01:44:04.000000000 +0100
+++ src/OgreALSoundManager.cpp 2007-12-08 03:43:10.000000000 +0100
@@ -589,6 +589,18 @@
ss.clear(); ss.str("");
}
+#if defined(ALUT_API_MAJOR_VERSION) && ALUT_API_MAJOR_VERSION >= 1
+ if (!alutInit(NULL, NULL))
+ {
+ ALenum error = alutGetError();
+ CheckError(error, "Failed to initialize alut");
+ }
+ else
+ {
+ mContext = alcGetCurrentContext();
+ CheckCondition(mContext != NULL, 13, "Failed to get current OpenAL Context");
+ }
+#else
// If the suggested device is in the list we use it, otherwise select the default device
mDevice = alcOpenDevice(deviceInList ? deviceName.c_str() : NULL);
CheckError(alcGetError(mDevice), "Failed to open Device");
@@ -603,6 +615,7 @@
alcMakeContextCurrent(mContext);
CheckError(alcGetError(mDevice), "Failed to set current context");
+#endif
}
void SoundManager::checkFeatureSupport()
--- include/OgreALPrereqs.h.~1~ 2007-12-08 01:12:35.000000000 +0100
+++ include/OgreALPrereqs.h 2007-12-08 03:35:15.000000000 +0100
@@ -51,6 +51,7 @@
#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
# include "AL/al.h"
# include "AL/alc.h"
+ # include "AL/alut.h"
# if defined(OGRE_AL_EXPORT) && OGRE_COMP_VER >= 400
# define OgreAL_Export __attribute__ ((visibility("default")))
# else
add-new-demos.diff
--- Demos/Makefile.am.~1~ 2007-12-08 01:12:35.000000000 +0100
+++ Demos/Makefile.am 2007-12-08 04:16:39.000000000 +0100
@@ -1,3 +1,3 @@
# EXTRA_DIST=Media
-SUBDIRS=bin Basic_Demo Directional_Demo Doppler_Demo MultiChannel_Demo
+SUBDIRS=bin Basic_Demo Directional_Demo Doppler_Demo MultiChannel_Demo ManySources_Demo PlayPen