Jump to content

New Sound Manager svn patch


Recommended Posts

yes, issues like this (running out of OpenAL sources) are the target of the rewrite I'm doing now. I think its mostly a sound card issue as I can usually get thousands of sources but some machines top out at 200-300.

I'm on my third rewrite of the rewrite, so I must be geting close!

  • Like 1
Link to comment
Share on other sites

yes, issues like this (running out of OpenAL sources) are the target of the rewrite I'm doing now. I think its mostly a sound card issue as I can usually get thousands of sources but some machines top out at 200-300.

Is that really the cause of the error? Looking at the programmer's guide and OpenAL Soft's code for alGenSources, it seems AL_OUT_OF_MEMORY is returned when the memory allocation fails by returning NULL instead of a valid address, not related to the number of sources available (which could be AL_INVALID_VALUE?) Unless I'm completely misunderstanding it.

Edit: hmm digging a bit deeper, it seems AL_OUT_OF_MEMORY could also be thrown from the lowel-level API and is possibly related to sources.

Link to comment
Share on other sites

I hadn't really looked into it THAT much, but judging by the fact that the error came from inside CSoundBase::InitOpenAL, I'm pretty sure allocating a new source is the only memory type thing going on in there. My new code allocates all sources at startup time and manages them thereafter, so this isn't really an issue anymore.

Link to comment
Share on other sites

Not a priority, but while you're working on the sound manager, could you look into fixing the build when "--without-audio" is used? Here are the build errors I get with that build option, on Windows:


1> SoundManager.cpp
1>..\..\..\source\soundmanager\SoundManager.cpp(97): error C2061: syntax error : identifier 'ISoundItem'
1>..\..\..\source\soundmanager\SoundManager.cpp(214): error C2143: syntax error : missing ';' before '*'
1>..\..\..\source\soundmanager\SoundManager.cpp(214): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\..\..\source\soundmanager\SoundManager.cpp(214): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\..\..\source\soundmanager\SoundManager.cpp(215): error C2143: syntax error : missing ';' before '*'
1>..\..\..\source\soundmanager\SoundManager.cpp(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\..\..\source\soundmanager\SoundManager.cpp(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\..\..\source\soundmanager\SoundManager.cpp(43): error C2065: 'm_Items' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(43): error C2061: syntax error : identifier 'ItemsList'
1>..\..\..\source\soundmanager\SoundManager.cpp(44): error C2065: 'm_DeadItems' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(44): error C2061: syntax error : identifier 'ItemsList'
1>..\..\..\source\soundmanager\SoundManager.cpp(83): error C2653: 'ItemsList' : is not a class or namespace name
1>..\..\..\source\soundmanager\SoundManager.cpp(83): error C2065: 'iterator' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(83): error C2146: syntax error : missing ';' before identifier 'lstr'
1>..\..\..\source\soundmanager\SoundManager.cpp(83): error C2065: 'lstr' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(83): error C2065: 'm_Items' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(83): error C2227: left of '->begin' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>..\..\..\source\soundmanager\SoundManager.cpp(84): error C2065: 'lstr' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(84): error C2065: 'm_Items' : undeclared identifier
1>..\..\..\source\soundmanager\SoundManager.cpp(84): error C2227: left of '->end' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>..\..\..\source\soundmanager\SoundManager.cpp(84): fatal error C1903: unable to recover from previous error(s); stopping compilation

Link to comment
Share on other sites

  • 3 weeks later...

Hi

If anyone wants to take a look at the sound manager rewrite, its in my git repository https://github.com/s...ree/fix_sources

It goes into a distress mode when sources run out, in which it recycles them faster. A possible improvement would be to set priorities int these situations, but I could only bring them up in huge combat demo. Still needs some double checking and cleaning up before I patch svn.

Also the battles should sound much better I think.

Link to comment
Share on other sites

Hi

If anyone wants to take a look at the sound manager rewrite, its in my git repository https://github.com/s...ree/fix_sources

I gave this a spin. It seems to work fine, though I weren't able to trigger any combat on either of the combat demo maps. (I believe those maps were bugged a few months back, which is probably when you branched off.)

Link to comment
Share on other sites

I gave this a spin. It seems to work fine, though I weren't able to trigger any combat on either of the combat demo maps. (I believe those maps were bugged a few months back, which is probably when you branched off.)

yes, its broken, but you can still declare war after the game ends and let them fight away. I do need to merge my branch up...

  • Like 1
Link to comment
Share on other sites

yes, its broken, but you can still declare war after the game ends and let them fight away. I do need to merge my branch up...

I see. That worked fine too:

ERROR: Sound: Entering distress mode through shortage

ERROR: Sound: Coming out of distress mode suffering 0 errors

ERROR: Sound: Entering distress mode through shortage

ERROR: Sound: Coming out of distress mode suffering 0 errors

Link to comment
Share on other sites

OK the new SoundManager code is in a patch attached to its trac ticket (I'll also attach it here)

http://trac.wildfire...com/ticket/1766

This is a diff against the latest svn trunk, so patching should not be a problem. I'll be AFK for a week (so I didn't want to check changes in), hopefully this will work fine and can be incorporated during my absence or when I get back.

Battles should sound much fuller, and should work much better in low resource environments.

Also there is some extra logging here, about going into and out of distress mode. Going into distress mode dues to shortage and coming out with a 0 error count is normal (during large battles) and good behavior. On MacOs there seem to be times the system returns an unknown error when it can't play a sound. So in that case you might go into distress mode on an error and emerge with a big error count. I think this is also not a big problem. It shouldn't happen on non-mac platforms (let me know if it does) and doesn't affect the sound noticeably (also let me know).

I can try and track down the exact cause of the issue in the future.

Enjoy!

soundManagerEntity.patch

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

OK, it is in! I'll be around on IRC in case anything goes wrong.... Hopefully this will improve the sound for people. There are still two log messages included for testing purposes. It will say it is going into distress mode over large battles. Then when the battle subsides it should come out of distress mode, hopefully reporting no errors. I haven't seen errors anywhere but on Mac, and I'm not sure they needed to be worried about.

Link to comment
Share on other sites

I can't build the game anymore.

1>------ Build started: Project: simulation2, Configuration: Release Win32 ------

1> CCmpSoundManager.cpp

1>C:\Users\Bastijn\ps\source\lib/external_libraries/openal.h(34): fatal error C1083: Cannot open include file: 'AL/al.h': No such file or directory

2>------ Build started: Project: test, Configuration: Release Win32 ------

3>------ Build started: Project: pyrogenesis, Configuration: Release Win32 ------

2> test_root.cpp

3> Creating library ..\..\..\binaries\system\pyrogenesis.lib and object ..\..\..\binaries\system\pyrogenesis.exp

3>simulation2.lib(CCmpSoundManager.obj) : error LNK2019: unresolved external symbol "public: void __thiscall CSoundGroup::PlayNext(class CVector3D const &)" (?PlayNext@CSoundGroup@@QAEXABVCVector3D@@@Z) referenced in function "public: virtual void __thiscall CCmpSoundManager::PlaySoundGroup(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,unsigned int)" (?PlaySoundGroup@CCmpSoundManager@@UAEXV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@I@Z)

3>..\..\..\binaries\system\pyrogenesis.exe : fatal error LNK1120: 1 unresolved externals

2> Creating library ..\..\..\binaries\system est.lib and object ..\..\..\binaries\system est.exp

2>simulation2.lib(CCmpSoundManager.obj) : error LNK2019: unresolved external symbol "public: void __thiscall CSoundGroup::PlayNext(class CVector3D const &)" (?PlayNext@CSoundGroup@@QAEXABVCVector3D@@@Z) referenced in function "public: virtual void __thiscall CCmpSoundManager::PlaySoundGroup(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,unsigned int)" (?PlaySoundGroup@CCmpSoundManager@@UAEXV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@I@Z)

2>..\..\..\binaries\system est.exe : fatal error LNK1120: 1 unresolved externals

========== Build: 0 succeeded, 3 failed, 11 up-to-date, 0 skipped ==========

Link to comment
Share on other sites

Sounds like something is wrong with OpenAL, but while we wait for someone with more knowledge to help out you might want to run update-workspaces to make sure any new/changed source files are taken into account (you might of course have done that already, in which case I would suggest running clean-workspaces.sh and then update-workspaces and try compiling again just to be on the safe side :) ).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...