OgreAL Update [02-12-2008]

CaseyB

03-11-2007 05:07:44

In this update:
  1. *Applied patch to add OgreALException to the Linux Build files
    *Added OgreAL Exception to the VS2003 Project
    *Beefed up error checking
    *Removed the AudioFormat argument from createSound() and createSoundStream. The Sounds are smart enough now not to need the hint.
    *Fixed a bug where Sound::getDerivedDirection() was returning the derived position.
    *Started migrating all error checking and handling to OgreALException.[/list:u]
    I am still working on some beefing up and shoring up under the covers and then I'll move on to new features. Form here on out though each bit of improvement under the covers comes with a bit of a feature. For example, the next step is to bring in the Ogre::ResourceManager to manage sounds, this will mean that it should work with background loading!! Then I am going to work on managing sources and buffers and this will remove the limitation on the number of Sounds that can be created.

Martins1

03-11-2007 11:54:02

Your plan sounds really great! I am looking forward for OgreAl to become even better!

CaseyB

04-11-2007 15:53:39

*Updated meshes
*Fixed crashes on shutdown
*Starting bringing in the Ogre::ResourceGroupManager
*Cleaned out some residual code that didn't need to be there anymore.

CaseyB

05-11-2007 07:27:24

Added Wav streaming. I consolidated Wav streaming and non-streaming into the WavSound class. The WavSound class is now all set for the next step. It takes advantage of the OgreResourceGroupManager and it takes care of all Wav functionality. At the moment you still call createSound() or createSoundStream(), but when I retrofit the OggSound and oggSoundStream classes then, createSoundStream() will go away in favor of a bool argument to createSound(). I think this will make more sense and it keeps the loading and cleanup for a particular audio format in a single place so if you change something it only needs to be done once.

I am having a bit of trouble with bringing the Ogg classes up to date however since the ogg libraries want a FILE* and not any kind of a stream. Does anyone have any suggestions?

kungfoomasta

05-11-2007 17:13:22

Can't really help with that question, sorry. :(

So are ogg and wavs Ogre resources, or just wavs at the moment? Having them as resources is awesome. Happy to read these updates. :D

CaseyB

05-11-2007 17:34:10

At the moment wavs are Ogre resources that happen to be in wav format, I am working on getting ogg to that point now too. I got past the last issue by finding out that the Ogg Vorbis libraries allow you to define custom accessors so you can read ogg data from any source you like! So I just needed to implement four funtions that would read, seek, close and tell on an Ogre::DataStreamPtr and we're all good!!

CaseyB

08-11-2007 07:22:37

Ok, this is a pretty big update.

*Completed Ogre::ResourceGroupManager integration so now all sounds come from Ogre::DataStreamPtr's
*Merged Sounds and SoundStreams so there is only one file per Sound type and the loading code won't need to be duplicated.
*Removed SoundStream.h / .cpp and OggSoundStream.h / .cpp
*Removed SoundManager::createSoundStream(), now you pass an argument into SoundManager::createSound() if you want the sound to be streamed.
*Added an optional argument to the SoundManager constructor that allows the user to suggest which sound device to use.
*Added a static method to the SoundManager that will return an Ogre::StringVector that lists all available devices.
*Updated Linux, VS7.1 and VS8 project files
*Updated the documentation to reflect the changes.

As always, I am looking forward to seeing what you guys think and see if this solves any of the problems you had or creates new one! :wink:

gugus

08-11-2007 12:46:07

what about puting a number to each version of OgreAL?Because sometimes,i do not know if i have the last version!

CaseyB

08-11-2007 21:46:44

OgreAL is in between major relases at the moment, I can start putting the SVN revision numbers on my update posts though. Currently the source is at revision 84.

gugus

09-11-2007 09:54:37

thanks!

Martins1

09-11-2007 20:39:24

I will be trying this out soon. Having OgreAL work through ResourceGroupManager is a dream!!!

CaseyB

26-11-2007 05:35:42

Added the ability to:
* Query the total length of the sound file in seconds (Thanks scriptkid!)
* Query the current offset into the audio in seconds
* Skip in the audio to a particular point in seconds
* Also cleaned up the way buffers and streaming are handled (Again, thanks scriptkid!)
* Fixed bug when Sound is created, deleted and created again

The current revision is 88 in SVN.

frier

26-11-2007 07:52:22

sweet it fixed up some problems i was having before..

now im getting this error when i delete one of my sounds(others work fine)

There is no Current Context in OgreAL::Sound::EmptyQueues

what does this mean?

*edit* werid doesnt always happen though... might be this computer again

CaseyB

26-11-2007 08:07:58

Is there more to the error message than that? Does it say something else like: "Failed to get Source" or "Failed to unqueue Buffers"? Is the Sound based on a wav or an ogg? Is it the first sound you've made based on that particular file? Also, you could set a break point in OgreALSound.cpp at line 556 and see what the value of mSource is at that point. It should be non-zero.

CaseyB

26-11-2007 22:55:28

I made a few more changes. I fixed the getSecondOffset() in WavSound, it was off a bit. I also fixed the 6Channel.ogg file so now the sounds should come fromt eh appropriate speakers. I added two new projects, one in a new demo that I am going to use as my test case for being able to create arbitrarily many sounds, the other is a playpen so I can do testing and tweaking without having to mess with the demos. Currently the playpen has the stuff that I used to test the get/setSecondOffset().

Current revision is 90 in SVN.

frier

27-11-2007 06:33:33

Hey Casey im back,

yeah that emptyQueue error went away but now its back, its pretty random.. this is what the message says:


dies on this line

mSoundFactory->destroyInstance(soundItr->second);


17:34:49: *-*-* Creating OpenAL
17:34:49: OpenAL Devices
17:34:49: --------------
17:34:49: * SB X-Fi Audio [8C00]
17:34:49: * Generic Hardware
17:34:49: * Generic Software
17:34:50: Choosing: SB X-Fi Audio [8C00]
17:34:50: Supported Formats
17:34:50: -----------------
17:34:50: EAX 5.0 Detected

CaseyB

27-11-2007 08:20:56

Your log is showing that there is something wrong. It's showing that it doesn't recognize any audio formats. Here's what that section looks like from my Ogre.log.*-*-* Creating OpenAL
05:10:28: OpenAL Devices
05:10:28: --------------
05:10:29: * Generic Hardware
05:10:29: * Generic Software
05:10:29: Choosing: Generic Hardware
05:10:29: Supported Formats
05:10:29: -----------------
05:10:29: * AL_FORMAT_MONO16, Monophonic Sound
05:10:29: * AL_FORMAT_STEREO16, Stereo Sound
05:10:29: * AL_FORMAT_QUAD16, 4 Channel Sound
05:10:29: * AL_FORMAT_51CHN16, 5.1 Surround Sound
05:10:29: * AL_FORMAT_61CHN16, 6.1 Surround Sound
05:10:29: * AL_FORMAT_71CHN16, 7.1 Surround Sound
05:10:29: EAX 2.0 Detected
Can you try something for me? Can you try passing in "Generic Hardware" when you create the SoundManager? That will have it select the Generic Hardware device instead of the X-Fi device, this will help us eliminate any driver issues.

frier

27-11-2007 09:09:14

mSoundManager = new OgreAL::SoundManager("Generic Hardware");

I did the following but it still says

20:07:41: *-*-* Creating OpenAL
20:07:41: OpenAL Devices
20:07:41: --------------
20:07:42: * SB X-Fi Audio [8C00]
20:07:42: * Generic Hardware
20:07:42: * Generic Software
20:07:42: Choosing: SB X-Fi Audio [8C00]
20:07:42: Supported Formats
20:07:42: -----------------
20:07:42: EAX 5.0 Detected



i stepped through the process and it does find Generic Hardware "in the list" and attempts to use it and it doesnt error or anything..... and im not getting those errors.. we'll see how we go. Thanks Casey!

frier

27-11-2007 09:38:28

ah nup she errored again..

CaseyB

27-11-2007 19:11:52

Ok, tell me as much as you can about the Sound that's giving you trouble.

1. Is it created from an Ogg or a Wav?
2. Is it streamed?
3. Is it the only Sound based on that file?
4. Has it been destroyed and recreated?

Hopefully I can recreate the error.

frier

28-11-2007 00:06:41

Ok it seems it only crashes when i load the RhinoBeetle character. On the jump sound

http://www.infernal-chaos.com/FrieR/Crawlerz/RhinoJump.wav

1. WAV
2. Not-Streamed
3. Not sure what you mean sorry :oops:
4. um no i dont think its recreated.

CaseyB

28-11-2007 05:22:54

Ok, I've tried it three different ways and I've tried it a few times each way and I can't replicate the error. Here are my test cases, can you tell me if they are representative?
Case 1OgreAL::Sound *jumpSound = soundManager->createSound("RhinoJump", "RhinoJump.wav", false);
jumpSound->setGain(0.5);
node->attachObject(jumpSound);

Case 2OgreAL::Sound *jumpSound = soundManager->createSound("RhinoJump", "RhinoJump.wav", false);
soundManager->destroySound("RhinoJump");
jumpSound = soundManager->createSound("RhinoJump", "RhinoJump.wav", false);
jumpSound->setGain(0.5);
node->attachObject(jumpSound);

Case 3OgreAL::Sound *jumpSound = soundManager->createSound("RhinoJump1", "RhinoJump.wav", false);
jumpSound = soundManager->createSound("RhinoJump", "RhinoJump.wav", false);
jumpSound->setGain(0.5);
node->attachObject(jumpSound);

In cases 2 and 3 I was trying to see what I could do to throw off the loading, but it ran fine. In each case I played the sound through a key press.bool DeviceListener::keyPressed(const OIS::KeyEvent &arg)
{
static int count = 0;
switch(arg.key)
{
case OIS::KC_ESCAPE:
mContinue = false;
break;

case IS::KC_SYSRQ:
mWindow->writeContentsToFile("ScreenShot"+StringConverter::toString(count++)+".png");
break;

case OIS::KC_F1:
OgreAL::SoundManager::getSingleton().getSound("RhinoJump")->play();
break;

case OIS::KC_UP:
case OIS::KC_W:
mDirection.z -= MOVEMENT_SPEED;
break;

case OIS::KC_DOWN:
case OIS::KC_S:
mDirection.z += MOVEMENT_SPEED;
break;

case OIS::KC_LEFT:
case OIS::KC_A:
mDirection.x -= MOVEMENT_SPEED;
break;

case OIS::KC_RIGHT:
case OIS::KC_D:
mDirection.x += MOVEMENT_SPEED;
break;

case OIS::KC_PGUP:
case OIS::KC_E:
mDirection.y += MOVEMENT_SPEED;
break;

case OIS::KC_PGDOWN:
case OIS::KC_Q:
mDirection.y -= MOVEMENT_SPEED;
break;
}

return true;
}

frier

28-11-2007 07:13:34

Yeah its werid, i tried to duplicate the error on 4 other computers and its not doing it, so it MUST be my soundcad drivers or something. maybe the x-fi is giving me grief

this is how i create my sounds

// Makes Bugs sounds
void BugActor::createBugSound(){

std::map<Ogre::String,Ogre::String>::iterator itrBugSoundStart = mBugBasePtr->mBugBaseSounds.begin();
std::map<Ogre::String,Ogre::String>::iterator itrBugSoundEnd = mBugBasePtr->mBugBaseSounds.end();

for(;itrBugSoundStart != itrBugSoundEnd; ++itrBugSoundStart){

if(itrBugSoundStart->first == "JUMP"){
mBugSounds[itrBugSoundStart->first] = OgreAL::SoundManager::getSingletonPtr()->createSound(itrBugSoundStart->first + mUniqueID, itrBugSoundStart->second, false);
mBugSounds[itrBugSoundStart->first]->setGain(0.5f);
mBugSounds[itrBugSoundStart->first]->setRelativeToListener(true);
}
else{
mBugSounds[itrBugSoundStart->first] = OgreAL::SoundManager::getSingletonPtr()->createSound(itrBugSoundStart->first + mUniqueID, itrBugSoundStart->second, true);
mBugSounds[itrBugSoundStart->first]->setGain(0.7f);
mBugSounds[itrBugSoundStart->first]->setRelativeToListener(true);
}
}
}

CaseyB

28-11-2007 11:36:03

Do you have the latest drivers installed?

CaseyB

05-12-2007 04:40:53

OgreAL will now allow you to make arbitrarily many Sounds regardless of the number of sources allowed by your audio hardware.

Also in this commit:
* Cleaned up shutdown and Sound cleanup.
* Fixed the OggSound stream looping problem
* Took a stab at fixing the "specified source name is not valid in initializeDevice" bug on Linux
* integrated the auto tools patches

Current revision in SVN is 92.

scriptkid

05-12-2007 11:58:27

Hey Casey,

i browsed a little through the code and the new update seems to be pretty cool :) I'll have a play with it later this week. The prioritisation and sorting seems nicely implemented as well by using an 'active' and a 'requested' queue.

[EDIT] Forget the line below. You are right because this is needed in order to start queued sounds when others have stopped. [/EDIT]

However i do wonder one thing: the sorting and updating now happens each frame, which shounds a bit often. Can't this sorting be postponed until the call to '_requestSource'?

Bye! :)

n1000

05-12-2007 14:56:37

09:09:21: *-*-* Creating OpenAL
09:09:21: OpenAL Devices
09:09:21: --------------
09:09:21: * Generic Software
09:09:21: * Generic Software
09:09:21: Choosing: Generic Software
09:09:21: Supported Formats
09:09:21: -----------------
09:09:21: * AL_FORMAT_MONO16, Monophonic Sound
09:09:21: * AL_FORMAT_STEREO16, Stereo Sound
09:09:21: * AL_FORMAT_QUAD16, 4 Channel Sound
09:09:21: * AL_FORMAT_51CHN16, 5.1 Surround Sound
09:09:21: * AL_FORMAT_61CHN16, 6.1 Surround Sound
09:09:21: * AL_FORMAT_71CHN16, 7.1 Surround Sound
09:09:21: EAX 2.0 Detected

08:47:38: OGRE EXCEPTION(13:): Wrong wav file format. This file is not a .wav file (no data subchunk): 01.wav in
08:47:38: OGRE EXCEPTION(40963:): Could not load buffer data: OpenAL Error: The value pointer given is not valid in OgreAL::WavSound::loadBuffers

Wav files that previously worked before no longer work. I was using a version of OgreAl from 6 months ago. After updating, most of the wav files cause a crash. I tried comparing wav files that worked against ones that didn't, but they seem identical.

I also noticed that, if I use streaming wav sounds, and the application stalls for a second (load a large resource), the audio cuts out.

CaseyB

05-12-2007 16:14:01

The version from six months ago was using alut to load wav's, since alut is deprecated I am removing that as a dependency. Can you send me one of the wav's that don't work so I can try to fix the wav loading?

cruzdanilo

09-12-2007 13:36:52

Man, dont you think updateSound(), loadBuffers() and unloadBuffers() should be public instead of protected?

I was using OpenAL directly without OgreAL. Now i am porting my code for using OgreAL, and i have a Resource and a ResourceManager for sounds (BTW, its a nice idea to implement those classes on OgreAL), but i cant load the sound buffers without play the sound, and i just want to load them (and unload). i think its a quick update that would be made.

Thnx

scriptkid

09-12-2007 20:26:48

Hi,

the most recent update allows you to load sounds without actually playing them! This is a major change from earlier versions where just loading a sound would already 'eat' a soundcard slot.

Now a sample does not use a slot until it actually plays. Besides that, an algoritm is in place which handles priorities when more samples then the available soundcard slots need to be played at once.

About the updateSound: OgreAL hooks itself into Ogre as a framelistener and will already handle the update for you.

HTH.

CaseyB

09-12-2007 20:37:27

Yup, Like scriptkid says, OgreAL is meant to make things a lot easier for you, otherwise you could just use pure OpenAL! ;) The reason that un/loadBuffers, un/queueBuffers and updateSound are all protected is because if you are a normal user you never need to worry about it. The only time you should need to have access to those is if you are adding a new audio format (mp3 for example) and have subclassed OgreAL::Sound.

cruzdanilo

10-12-2007 01:10:50

i think i am talking about another thing. I have a background song in my game that is a OGG and have 4mb for his compressed size. Uncompression of this song takes a lot of time (10~20 seconds), and takes a lot of memory too (about 50mb for buffering).

I was uncompressing the song and loading the buffer at the loading screen when i was using OpenAL directly, so the game dont freeze during the gameplay just for loading the song (ManySources_Demo, for example, freezes during a long time befora starting because it is loading the song without showing nothing like a loding screen). Now with OgreAL i cant do it because loadBuffers method is protected.

For loadBuffers as a public method, it would be a choice for the user to pre load the buffers or not, so it will stay easy to use for beginners, but more flexible for advanced users.

What do you say about it?

CaseyB

10-12-2007 02:54:25

This is how it is now in the ManySources_Demo:sound = soundManager->createSound(ss.str(), "Zero Factor - Decay.ogg", true);If you want to load it as a stream, which is what you're describing, all you need to do is:sound = soundManager->createSound(ss.str(), "Zero Factor - Decay.ogg", true, true); (note the extra bool argument at the end) and that will load the sound in chunks that are 1/4 of a second and keep swapping between buffers as needed. If you want to try it out you can modify that one line in the ManySources_Demo.

cruzdanilo

10-12-2007 05:08:46

no man, that is not what i want, i want to load all the uncompressed song to the buffer on the loading state of my game, before the call of the play() method

scriptkid

10-12-2007 08:14:48

Okay i understand what you mean. However that brings you back at the earlier issue that loading a sound already uses a soundslot on your device. I think that revision 88 does what you want.

An option might be to add a parameter to the CreateSound method whether it should already preload. But that would add more complexity to the algoritm which decided what to play and stop.

I do wonder though what's so bad about streaming your music.

What about this workaround?:

sound->setGain(0); // 'hide'
sound->play(); // Buffer
sound->stop();
sound->setGain(1);

CaseyB

11-12-2007 00:45:33

Here's what I've added.SoundManager::_addBufferRef(const Ogre::String& bufferName, BufferRef buffer) This will let you load your own buffer and then give it to OgreAL. This way when you create a new sound it will see that a buffer already exists for that name and it will use the one that's loaded. This won't use up a source (which are the slots that are more scarce) but it also won't allow you to stream it. You would need to have the whole thing loaded at once.

P.S.
BufferRef is just a typedef for ALuint, so you can just pass is what you get back from OpenAL.

cruzdanilo

11-12-2007 01:39:00

man, is it so hard to make loadBuffers public?

CaseyB

11-12-2007 03:40:01

It really isn't that simple. Each Sound subclass (i.e. OggSound, WavSound) keeps track of whether the buffers are loaded or not and whether they need to be refreshed and when, so if you were to simply make loadBuffers public you would find that you would call that and the Sound would lose track of the state of the buffers and the very best thing you could hope for is that it would simply load them again when you played the Sound. If you want to manage the buffers yourself you have two choices, use the _addBufferRef() / _removeBufferRef() methods in the SoundManager, or you can create a new Sound subclass that lets you do what you want. Just a question, why won't streaming work for you? It won't cause any pauses during game play. Do you need the whole song loaded at the same time for a particular reason?

cruzdanilo

11-12-2007 04:03:42

2 reasons:

1 - Ramdomly, i got an assertion error when playing 2 sounds at the same time. its on the method that sorts the priority queue

2 - When i am playing by streaming, even a small freeze on the game (for some dynamic loading, for example) makes the music stop forever. i think its because the lib cant suply the buffers for OpenAL to play

maybe you can fix those problems, 'cause its impossible to use streaming with them.

thnx for the attention

CaseyB

11-12-2007 05:29:49

Yes, I will look into those. Thanks for your patience!

CaseyB

12-12-2007 01:02:06

Another small update:

* Added SoundManager::_addBufferRef() to allow users to preload buffers on their own.
* Fixed crash when shutting down under Linux!

The current Revision in SVN is 98.

cruzdanilo

12-12-2007 01:22:23

have you got the 2 error i've told about streaming?

CaseyB

12-12-2007 01:43:34

Not yet, I was in the middle of the Linux stuff, I am going to look into that now. That was under Windows, right?

cruzdanilo

12-12-2007 02:05:40

yep. actually, its under windows vista ultimate, but i dont think that it is something about the windows version, so i think that just "windows" is a good answer :D

CaseyB

12-12-2007 02:09:24

Ok, I am trying to recreate the error so I can debug it. I started out my making two ogg files stream and set RelativeToListener to true and that seemed ok, so then I attached them to a SceneNode and set RelativeToListener to false and that also seemed to work. The I created an additonal two ogg streams and set their RelativeToListener to true so I have two 3D sounds in the scene and two sets of background music and it still doesn't crash. Is there something else you are doing that I should try?

cruzdanilo

12-12-2007 02:51:37

i am just creating an playing, both as backgroudn sound, not attached to any node, not RelativeToListener, but the listener is attached to the cam node. one of the sounds is created without looping, but is setted to loop before play. this one is very long. the other is short, created and played without looping. just it

both errors happens under those conditions

CaseyB

12-12-2007 03:14:21

I don't think it could be causing the problem, but if you want the Sound to play as a background sound you should set RelativeToListener to true. This will make the sound follow the listener. Without setting that it will stay at whatever position in space that you place it at, most likely (0, 0, 0). I am going to make another commit. If you would check out the PlayPen and see if you get the error there that would be great. If it crashes on you could you post your Ogre.log?

cruzdanilo

12-12-2007 09:08:50

yeah man, both errors are happening on the PlayPen example

the assertion one is the most weird. sometimes, i got it 5 times in a row, and them, it stops for 20 times in a row. then it cames back. its really wierd.

the "stopping sound" one happens ramdomly in PlayPen too. in my game i know exactly when it happens, when i shot my weapon.

i dont know if i am helping, but i am trying to :wink:

thnx

cruzdanilo

12-12-2007 09:27:54

this is the call stack of the assertion bug (as i've said, somthing about sorting):

msvcp80d.dll!6a057661()
[Frames below may be incorrect and/or missing, no symbols loaded for msvcp80d.dll]
> OgreAL_d.dll!std::_Debug_lt_pred<OgreAL::SoundManager::SortLowToHigh,OgreAL::Sound *,OgreAL::Sound *>(OgreAL::SoundManager::SortLowToHigh _Pred={...}, OgreAL::Sound * & _Left=0x014f16b8, OgreAL::Sound * & _Right=0x014d68f0, const wchar_t * _Where=0x001e8110, unsigned int _Line=2764) Line 326 + 0x15 bytes C++
OgreAL_d.dll!std::_Insertion_sort<std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> >,OgreAL::SoundManager::SortLowToHigh>(std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> > _First=0x014d68f0 {mOggStream={...} mVorbisInfo=0x014d6e80 }, std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> > _Last=0xfdfdfdfd {mDerivedPosition={...} mDerivedDirection={...} mLastParentOrientation={...} ...}, OgreAL::SoundManager::SortLowToHigh _Pred={...}) Line 2764 + 0x25 bytes C++
OgreAL_d.dll!std::_Sort<std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> >,int,OgreAL::SoundManager::SortLowToHigh>(std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> > _First=0x014d68f0 {mOggStream={...} mVorbisInfo=0x014d6e80 }, std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> > _Last=0xfdfdfdfd {mDerivedPosition={...} mDerivedDirection={...} mLastParentOrientation={...} ...}, int _Ideal=2, OgreAL::SoundManager::SortLowToHigh _Pred={...}) Line 2894 + 0x51 bytes C++
OgreAL_d.dll!std::sort<std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> >,OgreAL::SoundManager::SortLowToHigh>(std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> > _First=0x014d68f0 {mOggStream={...} mVorbisInfo=0x014d6e80 }, std::_Vector_iterator<OgreAL::Sound *,std::allocator<OgreAL::Sound *> > _Last=0xfdfdfdfd {mDerivedPosition={...} mDerivedDirection={...} mLastParentOrientation={...} ...}, OgreAL::SoundManager::SortLowToHigh _Pred={...}) Line 2903 + 0x66 bytes C++
OgreAL_d.dll!OgreAL::SoundManager::frameStarted(const Ogre::FrameEvent & evt={...}) Line 340 + 0x6e bytes C++
OgreMain_d.dll!10cb1a46()
OgreMain_d.dll!10cb20d2()
OgreMain_d.dll!10cb26cb()
OgreMain_d.dll!10cb2641()
PlayPen.exe!OgreApp::start() Line 68 + 0xe bytes C++
PlayPen.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00232d5e, HINSTANCE__ * __formal=0x00000000) Line 14 C++
PlayPen.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
PlayPen.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!75d23833()
ntdll.dll!772ca9bd()


the debug output:

'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\PlayPen.exe', Symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\ntdll.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\kernel32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\OgreMain_d.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\user32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\gdi32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\advapi32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.762_none_24c8a196583ff03b\msvcp80d.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.762_none_24c8a196583ff03b\msvcr80d.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\msvcrt.dll', No symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\OgreAL_d.dll', Symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\OpenAL32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\winmm.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\ole32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\oleaut32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\oleacc.dll', No symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\VorbisFile_d.dll', Symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\Ogg_d.dll', Symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\Vorbis_d.dll', Symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\OIS_d.dll', Binary was not built with debug information.
'PlayPen.exe': Loaded 'C:\Windows\System32\dinput8.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\imm32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\msctf.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\lpk.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\usp10.dll', No symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\RenderSystem_Direct3D9_d.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\d3d9.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\version.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\d3d8thk.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\dwmapi.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\uxtheme.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\nvd3dum.dll', No symbols loaded.
'PlayPen.exe': Loaded 'X:\D_CrOsS\Documents\Visual Studio 2005\Projects\OgreAL\Demos\bin\Debug\RenderSystem_GL_d.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\opengl32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\glu32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\ddraw.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\dciman32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\setupapi.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\nvoglv32.dll', No symbols loaded.
The thread 'Win32 Thread' (0x1398) has exited with code 0 (0x0).
'PlayPen.exe': Loaded 'C:\Windows\System32\wdmaud.drv', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\ksuser.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\avrt.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\MMDevAPI.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\shlwapi.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6000.16386_none_5d07289e07e1d100\comctl32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\clbcatq.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\wintrust.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\crypt32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\msasn1.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\userenv.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\secur32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\imagehlp.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\AudioSes.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\AudioEng.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\psapi.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\msacm32.drv', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\msacm32.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\midimap.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\wrap_oal.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\dsound.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\powrprof.dll', No symbols loaded.
The thread 'Win32 Thread' (0x1330) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xff4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1708) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1184) has exited with code 0 (0x0).
'PlayPen.exe': Unloaded 'C:\Windows\System32\wrap_oal.dll'
'PlayPen.exe': Loaded 'C:\Windows\System32\wrap_oal.dll', No symbols loaded.
The thread 'Win32 Thread' (0x1454) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1610) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x49c) has exited with code 0 (0x0).
'PlayPen.exe': Unloaded 'C:\Windows\System32\wrap_oal.dll'
'PlayPen.exe': Loaded 'C:\Windows\System32\wrap_oal.dll', No symbols loaded.
'PlayPen.exe': Loaded 'C:\Windows\System32\hid.dll', No symbols loaded.
The thread 'Win32 Thread' (0x1710) has exited with code 0 (0x0).
PlayPen.exe has triggered a breakpoint



and the ogre log:

07:21:09: Creating resource group General
07:21:09: Creating resource group Internal
07:21:09: Creating resource group Autodetect
07:21:09: SceneManagerFactory for type 'DefaultSceneManager' registered.
07:21:09: Registering ResourceManager for type Material
07:21:09: Registering ResourceManager for type Mesh
07:21:09: Registering ResourceManager for type Skeleton
07:21:09: MovableObjectFactory for type 'ParticleSystem' registered.
07:21:09: OverlayElementFactory for type Panel registered.
07:21:09: OverlayElementFactory for type BorderPanel registered.
07:21:09: OverlayElementFactory for type TextArea registered.
07:21:09: Registering ResourceManager for type Font
07:21:09: ArchiveFactory for archive type FileSystem registered.
07:21:09: ArchiveFactory for archive type Zip registered.
07:21:09: FreeImage version: 3.9.2
07:21:09: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
07:21:09: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
07:21:09: DDS codec registering
07:21:09: Registering ResourceManager for type HighLevelGpuProgram
07:21:09: Registering ResourceManager for type Compositor
07:21:09: MovableObjectFactory for type 'Entity' registered.
07:21:09: MovableObjectFactory for type 'Light' registered.
07:21:09: MovableObjectFactory for type 'BillboardSet' registered.
07:21:09: MovableObjectFactory for type 'ManualObject' registered.
07:21:09: MovableObjectFactory for type 'BillboardChain' registered.
07:21:09: MovableObjectFactory for type 'RibbonTrail' registered.
07:21:09: Loading library .\RenderSystem_Direct3D9_d
07:21:09: Installing plugin: D3D9 RenderSystem
07:21:09: D3D9 : Direct3D9 Rendering Subsystem created.
07:21:09: D3D9: Driver Detection Starts
07:21:09: D3D9: Driver Detection Ends
07:21:09: Plugin successfully installed
07:21:09: Loading library .\RenderSystem_GL_d
07:21:09: Installing plugin: GL RenderSystem
07:21:09: OpenGL Rendering Subsystem created.
07:21:10: Plugin successfully installed
07:21:10: *-*-* OGRE Initialising
07:21:10: *-*-* Version 1.4.5 (Eihort)
07:21:10: Added resource location '../../Media' of type 'FileSystem' to resource group 'General'
07:21:10: Added resource location '../../Media/Audio' of type 'FileSystem' to resource group 'General'
07:21:10: Added resource location '../../Media/Gui' of type 'FileSystem' to resource group 'General'
07:21:10: Added resource location '../../Media/Materials/Scripts' of type 'FileSystem' to resource group 'General'
07:21:10: Added resource location '../../Media/Materials/Textures' of type 'FileSystem' to resource group 'General'
07:21:10: Added resource location '../../Media/Models' of type 'FileSystem' to resource group 'General'
07:21:10: Added resource location '../../Media/Materials/Textures/cubemapsJS.zip' of type 'Zip' to resource group 'General'
07:21:10: Added resource location '../../Media/Materials/bguires.zip' of type 'Zip' to resource group 'General'
07:21:10: Parsing scripts for resource group Autodetect
07:21:10: Finished parsing scripts for resource group Autodetect
07:21:10: Parsing scripts for resource group General
07:21:10: Parsing script Civic.material
07:21:10: Parsing script Ogre.material
07:21:10: Parsing script Scene.material
07:21:10: Parsing script Tower.material
07:21:10: Parsing script bgui.material
07:21:10: Parsing script Arial.fontdef
07:21:10: Finished parsing scripts for resource group General
07:21:10: Parsing scripts for resource group Internal
07:21:10: Finished parsing scripts for resource group Internal
07:21:10: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
07:21:10: D3D9 : RenderSystem Option: Anti aliasing = None
07:21:10: D3D9 : RenderSystem Option: Floating-point mode = Fastest
07:21:10: D3D9 : RenderSystem Option: Full Screen = No
07:21:10: D3D9 : RenderSystem Option: Rendering Device = NVIDIA GeForce 6600
07:21:10: D3D9 : RenderSystem Option: VSync = No
07:21:10: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
07:21:10: CPU Identifier & Features
07:21:10: -------------------------
07:21:10: * CPU ID: AuthenticAMD: AMD Athlon(tm) 64 Processor 3000+
07:21:10: * SSE: yes
07:21:10: * SSE2: yes
07:21:10: * SSE3: yes
07:21:10: * MMX: yes
07:21:10: * MMXEXT: yes
07:21:10: * 3DNOW: yes
07:21:10: * 3DNOWEXT: yes
07:21:10: * CMOV: yes
07:21:10: * TSC: yes
07:21:10: * FPU: yes
07:21:10: * PRO: yes
07:21:10: * HT: no
07:21:10: -------------------------
07:21:10: D3D9 : Subsystem Initialising
07:21:10: D3D9RenderSystem::createRenderWindow "Ogre Framework", 800x600 windowed miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 useNVPerfHUD=false vsync=false
07:21:10: D3D9 : Created D3D9 Rendering Window 'Ogre Framework' : 800x600, 32bpp
07:21:10: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
07:21:11: Registering ResourceManager for type Texture
07:21:11: Registering ResourceManager for type GpuProgram
07:21:11: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
07:21:11: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
07:21:11: D3D9: Vertex texture format supported - PF_FLOAT32_R
07:21:11: RenderSystem capabilities
07:21:11: -------------------------
07:21:11: * Hardware generation of mipmaps: yes
07:21:11: * Texture blending: yes
07:21:11: * Anisotropic texture filtering: yes
07:21:11: * Dot product texture operation: yes
07:21:11: * Cube mapping: yes
07:21:11: * Hardware stencil buffer: yes
07:21:11: - Stencil depth: 8
07:21:11: - Two sided stencil support: yes
07:21:11: - Wrap stencil values: yes
07:21:11: * Hardware vertex / index buffers: yes
07:21:11: * Vertex programs: yes
07:21:11: - Max vertex program version: vs_3_0
07:21:11: * Fragment programs: yes
07:21:11: - Max fragment program version: ps_3_0
07:21:11: * Texture Compression: yes
07:21:11: - DXT: yes
07:21:11: - VTC: no
07:21:11: * Scissor Rectangle: yes
07:21:11: * Hardware Occlusion Query: yes
07:21:11: * User clip planes: yes
07:21:11: * VET_UBYTE4 vertex element type: yes
07:21:11: * Infinite far plane projection: yes
07:21:11: * Hardware render-to-texture: yes
07:21:11: * Floating point textures: yes
07:21:11: * Non-power-of-two textures: yes
07:21:11: * Volume textures: yes
07:21:11: * Multiple Render Targets: 4
07:21:11: * Point Sprites: yes
07:21:11: * Extended point parameters: yes
07:21:11: * Max Point Size: 8192
07:21:11: * Vertex texture fetch: yes
07:21:11: - Max vertex textures: 4
07:21:11: - Vertex textures shared: no
07:21:11: ***************************************
07:21:11: *** D3D9 : Subsystem Initialised OK ***
07:21:11: ***************************************
07:21:11: ResourceBackgroundQueue - threading disabled
07:21:11: Particle Renderer Type 'billboard' registered
07:21:11: Creating viewport on target 'Ogre Framework', rendering from camera 'SimpleCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
07:21:11: *-*-* OgreAL Initialization
07:21:11: MovableObjectFactory for type 'OgreAL_Sound' registered.
07:21:11: MovableObjectFactory for type 'OgreAL_Listener' registered.
07:21:11: *-*-* Creating OpenAL
07:21:11: OpenAL Devices
07:21:11: --------------
07:21:12: * Generic Software
07:21:12: Choosing: Generic Software
07:21:12: Supported Formats
07:21:12: -----------------
07:21:12: * AL_FORMAT_MONO16, Monophonic Sound
07:21:12: * AL_FORMAT_STEREO16, Stereo Sound
07:21:12: * AL_FORMAT_QUAD16, 4 Channel Sound
07:21:12: * AL_FORMAT_51CHN16, 5.1 Surround Sound
07:21:12: * AL_FORMAT_61CHN16, 6.1 Surround Sound
07:21:12: * AL_FORMAT_71CHN16, 7.1 Surround Sound
07:21:12: EAX 2.0 Detected
07:21:12: Texture: cloudy_noon_fr.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:21:12: Texture: cloudy_noon_bk.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:21:12: Texture: cloudy_noon_lf.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:21:12: Texture: cloudy_noon_rt.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:21:12: Texture: cloudy_noon_up.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:21:12: Texture: cloudy_noon_dn.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:21:13: Texture: dirt-grass.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
07:21:13: Font Arialusing texture size 512x256
07:21:13: Info: Freetype returned null for character 160 in font Arial
07:21:13: Texture: ArialTexture: Loading 1 faces(PF_BYTE_LA,512x256x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x256x1.
07:21:13: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.


sorry for the flood, but i think that the best choice is to show all the information here

thnx

CaseyB

13-12-2007 08:45:17

!!UPDATE!!
Current Revision is 103 in SVN.

This update is going to need to be put through the ringer, so to speak, so I would LOVE it if you guys are willing to help me test it. The issue that people have been running into where sound stops if your app slows down or takes some time to load something? That was caused because I use an Ogre::FrameListener to let me know when to update streams and each stream only stores a half od a second of audio data at a time, so if your app took longer than half a second between frames OpenAL woudl hit the end of the buffer and this it was done, so it would stop. In order to combat this I have implemented a single thread using boost. This is completely optional and if you update from SVN and build you won't notice any difference! If, however, you want to use the threading you can enable it by following these steps.

Windows
If you don't already have boost set up, the easiest way to get going is to download the [u]Boost Installer[/u] and let it take care of everything for you. It will ask you which IDE you want to use and which boost libraries you want to install. As long as you get boost::threads for your IDE, you'll be good.

After installing boost::threads, you'll need to open the OgreAL solution and add the path to your boost install to the project properties. It will be under C++->General->Additional Include Directories. When you add this make sure you have selected to change it for All Configurations.



Next you'll need to go to OgreALPrereqs.h and find the bit of code that looks like this: #ifndef OGREAL_THREADED
#define OGREAL_THREADED 0
#endif
And change the 0 to a 1 to enable threading. Now just do a clean build of OgreAL and you should have threading enabled!

Linux
The steps are pretty much the same except for setting up boost. For that there is already a really good [u]starters guide[/u] on the boost website.

cruzdanilo

13-12-2007 11:39:30

man, this update solves the freezing problem, great and quick solution.

just a question. is it too hard to create a method for getting the size of a sound file before the createSound, so i can choose to use streaming based on its size (or even calculate the uncompressed size)???

does the debug information about the another error helped you?

CaseyB

13-12-2007 11:53:36

You can use Ogre to get the file size, but there really is no way to get the uncompressed size without actually loading the file. To get the size with Ogre you can do this:Ogre::ResourceGroupManager *groupManager = Ogre::ResourceGroupManager::getSingletonPtr();
Ogre::String group = groupManager->findGroupContainingResource(fileName);
Ogre::DataStreamPtr soundData = groupManager->openResource(fileName, group);
int fileSize = soundData->size();


As for the other error, the trace tells me that it seems to die in the sort function, but I am not certain why. When the assert comes up can you take a screenshot of it and post it up here?

cruzdanilo

13-12-2007 14:18:36

Here are the screenshots. if you need something else, just ask me.



thnx, good luck!

CaseyB

13-12-2007 19:34:54

The first picture seems to be broken.

I have made a slight change to the way the threading works. Now instead of defining it in the Preprocessor Definitions, you need to change the value from 0 to 1 in OgreALPrereqs.h, this is to allow it to work under Linux as well. I will change this in the walk-through I posted earlier.

libolt

14-12-2007 01:54:19

For building OgreAL with boost thread support on Linux, the configure script should be modified to take a parameter such as --enable-thread, which will then define OGREAL_THREADED 1 and link against libboost_thread.

my autotools-fu isn't the greatest so if anyone else wants to implement this go ahead or I'll look into it at some point and submit patches.

Mike

cruzdanilo

14-12-2007 02:13:30

the pictures again



thnx

PS: i dont think that this last change is a good idea. users changing lib code never is a good idea, even for small changes like this, it makes updates more complicated. the preprocessor solution is better, in my oppinion.

CaseyB

14-12-2007 06:04:30

I ran into that error when I first wrote the sort algorithm because for Sounds that were the same distance from the listener at the same priority it returned the first one. This caused an assert failure because sort algorithms have to be consistent and that was random. The test that was failing was basicallyif(sound1 < sound2)
{
assert(sound2 < sound1 == false);
}
This is why, if sounds are equal in every other way I return which ever has a smaller pointer. It's just as arbitrary, but it's always consistent. I haven't seen it since I made that change though. Are you sure that you have the latest version of everything and your build is completely up to date?

As for the Preprocessor thing, I decided to make that change after noting that it didn't build correctly under Linux and looking at the way Ogre did it. If Ogre does it that way it can't be all bad, right?

cruzdanilo

14-12-2007 07:11:21

i cant understand why the preprocessor thing dont work under linux, i've already used this kind of thing a lot of times.

Do you understand the updating problem?? every time i update OgreAL on my project, i need to change the header files. its very easy to happen a mistake.

about the assertion, i have this error under the OgreAL Revision 103, the HEAD revision for now.

CaseyB

14-12-2007 07:25:47

I do understand the updating issue, but you'd end up having change the preprocessor definition each time if it went the other way. At the moment I can't think of a better way, so I did it the Ogre way.

I'll do some more digging into sort methods. Maybe there's something else that I am doing that is questionable and only works some of the time!

cruzdanilo

14-12-2007 08:16:14

the updating issue with the preprocessor definition only happens when its necessary to update the project file, not the sources. the project file is not updated often (almost never), and almost everybody makes a new project file for himself, not using the OpenAL project file. The headers and sources are updated every revision, all the time, so its a bigger problem.

about the error, have you ever got it running PlayPen under windows??

CaseyB

14-12-2007 08:20:09

Yeah, Playpen runs fine over here. I have tried several different configurations to try to recreate the assert, but I can't. Unfortunately that means I an going to have to sit and stare at it a while and see if I can work out what it might possibly be logically.

CaseyB

14-12-2007 08:28:36

cruzdanilo,

I just uploaded a tweak to the Sort method, give that a shot!

cruzdanilo

14-12-2007 09:18:49

i've tryed a lot of times and got no errors.

i will keep trying, but maybe its gone :D

thnx for your attention and for this great library

CaseyB

14-12-2007 10:06:48

I'm glad you like it! Even if that wasn't THE problem, it was definately A problem! ;) Let me know if you have any more trouble!

CaseyB

14-12-2007 11:45:16

-=UPDATE=-
Current version is 106 in SVN.

* Fixed (hopefully) assert crash on sorting Sounds
* Added a check for OpenAL version removing the need to update to SVN or tweak resource files on Linux
* Added bounds checking for valid input values
* Updated Doku
* Cleaned up the code a bit.

cruzdanilo

16-12-2007 02:45:57

man, on low performance computers the thread solution doesnt solve the problem of the sound stopping on freezing or slowdowns.

maybe loading more buffers on the queue is a good idea.

CaseyB

17-12-2007 03:54:44

I updated the Threading code to use boost::thread::yield() instead of sleeping for a specified period of time. On faster computers this will make it update more often, but if the sounds haven't moved and the buffers aren't in need of refilling this shouldn't cost much more than just the context switch. Give this a shot and see if it fixes your problem on the lower end machine.

cruzdanilo

18-12-2007 22:51:57

still stopping when freezing on low performance pcs.
on mid performance pcs, sometimes, ramdomly, the bg sound stops too, even without freezing. i think its the same problem.

good luck

thnx

CaseyB

03-02-2008 07:26:38

* Integrated scriptkid's patch to allow Sounds to be faded in and out.
* Implemented kungfoomasta's suggestion about callbacks
* Now sounds are queued for deletion to allow the callbacks to work
* Added VC9 project files

This was a bit rushed, so please let me know if there are any problems!

CaseyB

13-02-2008 01:53:12

* Fixed bug where the soundLooped and soundFinished callbacks were being called reliably.
* Added a patch provided to make rapid stopping and starting of sounds more reliable.

Current revision in SVN is 114.

kungfoomasta

13-02-2008 05:37:32

* Integrated scriptkid's patch to allow Sounds to be faded in and out.

Wow, I was just about to request this! :D

Thanks a lot for all your hard work on this. I took a break from OgreAL integration with my app, but I'll get back into it this weekend and test the sound callbacks.

CaseyB

13-02-2008 05:57:38

Cool, let me know how that goes!

alphasnd

05-08-2008 13:10:13

Here is a small patch against current SVN version to handle OGG on big endian systems (wav playback is still broken). May be it can be useful to someone else :

Index: OgreALOggSound.cpp
===================================================================
--- OgreALOggSound.cpp (revision 115)
+++ OgreALOggSound.cpp (working copy)
@@ -266,7 +266,8 @@
// Read the rest of the file
do
{
- sizeRead = ov_read(&mOggStream, data, mBufferSize, 0, 2, 1, &section);
+ sizeRead = ov_read(&mOggStream, data, mBufferSize, OGRE_ENDIAN == OGRE_ENDIAN_BIG ? 1 : 0, 2, 1, &section);
+
buffer.insert(buffer.end(), data, data + sizeRead);
}while(sizeRead > 0);
}
@@ -275,7 +276,8 @@
// Read only what was asked for
while(buffer.size() < size)
{
- sizeRead = ov_read(&mOggStream, data, mBufferSize, 0, 2, 1, &section);
+ sizeRead = ov_read(&mOggStream, data, mBufferSize, OGRE_ENDIAN == OGRE_ENDIAN_BIG ? 1 : 0, 2, 1, &section);
+
if(sizeRead == 0) break;
buffer.insert(buffer.end(), data, data + sizeRead);
}