From: Erik H. <er...@eh...> - 2009-10-04 14:06:21
|
Allright, the new sound system has been committed. The basics works as follow: There is one SoundMgr that handles multiple SoundGroup classes. Each SoundGroup class handles multiple SoundSample classes. A SoundSample class defines the properties of each individual sound like pitch, volume, position, orientation, sound cone paramters, etc. This class can be created all over the code but *has* to be assigned to a SampelGroup before you can hear it. Current sample groups are "atc", "avionics" and "fx" for the master airplane effects. The position of a SoundSample is relative to (0,0,0) of the model and hence relative to the base position of the SampleGroup. A SampleGroup class has to be assigned to the SoundManager to be heard and holds data of a group of samples (maybe 'sample cloud' might be a good description). This class has to be created for each individual model that can produce one or more sounds. The SampleGroup class can be altered by modifying it's volume, position and orientation. Repositioning this class also means repositioning all it's associated samples. Altering it's orientation also means repositioning the absolute (real world) position (and orientation) of the associated sound samples. The SoundMagaer can be repositioned which basically means moving the listener around. It's also possible to alter the listener orientation en velocity with this class, together with the master volume. Erik |
From: Curtis O. <cur...@gm...> - 2009-10-04 21:57:15
|
On Sun, Oct 4, 2009 at 9:05 AM, Erik Hofman wrote: > > Allright, the new sound system has been committed. The basics works as > follow: > > There is one SoundMgr that handles multiple SoundGroup classes. > Each SoundGroup class handles multiple SoundSample classes. > > A SoundSample class defines the properties of each individual sound like > pitch, volume, position, orientation, sound cone paramters, etc. This > class can be created all over the code but *has* to be assigned to a > SampelGroup before you can hear it. Current sample groups are "atc", > "avionics" and "fx" for the master airplane effects. The position of a > SoundSample is relative to (0,0,0) of the model and hence relative to > the base position of the SampleGroup. > > A SampleGroup class has to be assigned to the SoundManager to be heard > and holds data of a group of samples (maybe 'sample cloud' might be a > good description). This class has to be created for each individual > model that can produce one or more sounds. The SampleGroup class can be > altered by modifying it's volume, position and orientation. > Repositioning this class also means repositioning all it's associated > samples. Altering it's orientation also means repositioning the absolute > (real world) position (and orientation) of the associated sound samples. > > The SoundMagaer can be repositioned which basically means moving the > listener around. It's also possible to alter the listener orientation en > velocity with this class, together with the master volume. > Hi Erik, One quick question: will the sound configuration xml files need to change to match the new system or will there be backwards compatibility? Thanks, Curt. -- Curtis Olson: http://baron.flightgear.org/~curt/ |
From: Erik H. <er...@eh...> - 2009-10-05 07:45:16
|
Curtis Olson wrote: > Hi Erik, > > One quick question: will the sound configuration xml files need to > change to match the new system or will there be backwards compatibility? It's backwards compatible. I do plan a new format change to be able to position the sounds in 3d-model space instead of OpenAL/OpenGL space. That will require adding a a new <version/> xml tag but the omission of it will still mean the previous format. Erik |
From: Alan T. <ajt...@v-...> - 2009-10-05 10:37:32
Attachments:
BuildLog.htm
|
Sorry to be the messenger, but compilation of soundmgr_openal.cxx and all flightgear files using soundmgr_openal.hxx fails under VC90. See attached build log. I am using the 3rd part libraries as per flightgear/source/projects/VC90/README.msvc. i.e. (Precompiled librairies and headers for compiling Win32 executables with VS2008 : ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty +OSG-20090628.zip) Same error with more recent fgfs-win32-VS90-3rdParty+OSG-20090820. Do I need a more recent version of OpenAL? Alan -----Original Message----- From: Erik Hofman [mailto:er...@eh...] Sent: 05 October 2009 08:45 To: FlightGear developers discussions Subject: Re: [Flightgear-devel] New Sound system committed Curtis Olson wrote: > Hi Erik, > > One quick question: will the sound configuration xml files need to > change to match the new system or will there be backwards compatibility? It's backwards compatible. I do plan a new format change to be able to position the sounds in 3d-model space instead of OpenAL/OpenGL space. That will require adding a a new <version/> xml tag but the omission of it will still mean the previous format. Erik ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Flightgear-devel mailing list Fli...@li... https://lists.sourceforge.net/lists/listinfo/flightgear-devel |
From: Erik H. <er...@eh...> - 2009-10-05 11:12:38
|
Alan Teeder wrote: > Sorry to be the messenger, but compilation of soundmgr_openal.cxx and all > flightgear files using soundmgr_openal.hxx fails under VC90. No problem, I already was expecting these reports since I can't test on all platforms. > See attached build log. It's beyond me why gcc didn't complain (I did compile with halt on all warnings) but I failed to include alc.h. Should be fixed in CVS now. Erik |
From: Alan T. <ajt...@v-...> - 2009-10-06 16:47:23
|
Thanks for fixing this. However the pre-built libraries referenced in README.msvc do have an old version of alut.h which is missing the alcGetError and associated definitions. I don´t know who maintains these useful archives. Alan -----Original Message----- From: Alan Teeder [mailto:ajt...@v-...] Sent: 05 October 2009 11:37 To: 'FlightGear developers discussions' Subject: Re: [Flightgear-devel] New Sound system committed Sorry to be the messenger, but compilation of soundmgr_openal.cxx and all flightgear files using soundmgr_openal.hxx fails under VC90. See attached build log. I am using the 3rd part libraries as per flightgear/source/projects/VC90/README.msvc. i.e. (Precompiled librairies and headers for compiling Win32 executables with VS2008 : ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty +OSG-20090628.zip) Same error with more recent fgfs-win32-VS90-3rdParty+OSG-20090820. Do I need a more recent version of OpenAL? Alan |
From: Erik H. <er...@eh...> - 2009-10-06 19:48:53
|
Alan Teeder wrote: > Thanks for fixing this. > > However the pre-built libraries referenced in README.msvc do have an old > version of alut.h which is missing the alcGetError and associated > definitions. I don´t know who maintains these useful archives. It's not alut.h that defines these functions but it's alc.h Maybe you need to include it in the project files somewhere? Erik |
From: Alan T. <ajt...@v-...> - 2009-10-06 20:16:16
|
Erik Sorry, I gave the wrong missing name -- I should have written alutGetError, as this is not in the older alut.h (or al.h or alc.h). Apologies for the confusion. Alan -----Original Message----- From: Erik Hofman [mailto:er...@eh...] Sent: 06 October 2009 20:48 To: FlightGear developers discussions Subject: Re: [Flightgear-devel] New Sound system committed Alan Teeder wrote: > Thanks for fixing this. > > However the pre-built libraries referenced in README.msvc do have an old > version of alut.h which is missing the alcGetError and associated > definitions. I don´t know who maintains these useful archives. It's not alut.h that defines these functions but it's alc.h Maybe you need to include it in the project files somewhere? Erik |
From: Erik H. <er...@eh...> - 2009-10-07 07:17:27
|
Alan Teeder wrote: > Erik > > Sorry, I gave the wrong missing name -- I should have written alutGetError, > as this is not in the older alut.h (or al.h or alc.h). Hmm ok, I'll need to find a way around it then. Thanks for the report. Erik |
From: Erik H. <er...@eh...> - 2009-10-07 07:33:02
|
Alan Teeder wrote: > Erik > > Sorry, I gave the wrong missing name -- I should have written alutGetError, > as this is not in the older alut.h (or al.h or alc.h). Ah that was just a matter of commenting out the proper section. Should be fixed now. Erik |
From: Vivian M. <viv...@li...> - 2009-10-11 10:00:02
|
Alan Teeder wrote: > > Sorry to be the messenger, but compilation of soundmgr_openal.cxx and all > flightgear files using soundmgr_openal.hxx fails under VC90. > > See attached build log. > > I am using the 3rd part libraries as per > flightgear/source/projects/VC90/README.msvc. > i.e. > (Precompiled librairies and headers for compiling Win32 executables with > VS2008 : > ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90- > 3rdParty > +OSG-20090628.zip) > > Same error with more recent fgfs-win32-VS90-3rdParty+OSG-20090820. > > Do I need a more recent version of OpenAL? > > Alan > > -----Original Message----- > From: Erik Hofman [mailto:er...@eh...] > Sent: 05 October 2009 08:45 > To: FlightGear developers discussions > Subject: Re: [Flightgear-devel] New Sound system committed > > > Curtis Olson wrote: > > > Hi Erik, > > > > One quick question: will the sound configuration xml files need to > > change to match the new system or will there be backwards compatibility? > > It's backwards compatible. I do plan a new format change to be able to > position the sounds in 3d-model space instead of OpenAL/OpenGL space. > That will require adding a a new <version/> xml tag but the omission of > it will still mean the previous format. > I finally got around to updating FG/SG to Head. As we know - it fails under MSVC9. Here's how I fixed it: Downloaded and installed OpenAL 1.1 Core SDK from Creative Labs. Downloaded freealut-1.1.0 from Creative Labs. Compiled it by converting the MSVC 7 project files supplied to MSVC9, and including OpenAL 1.1 Core SDK. Put the generated alut.dll in the active path. Patched soundmgr_openal.cxx/hxx and sample_group.hxx with +#elif defined(_WIN32) +# include <al.h> or +#elif defined(_WIN32) +# include <al.h> +# include <alc.h> +# include <AL/alut.h> as appropriate. Built FG/SG with \freealut-1.1.0\include and \OpenAL 1.1 Core SDK\include. Linked FG to \freealut-1.1.0\admin\VisualStudioDotNET\alut\Release and OpenAL 1.1 Core SDK\libs\Win32. As they say here in the UK "simples". Does it work - yes, except FG now crashes on exit. I can now hear excellent sound, and nice new 3D clouds, with almost no impact on framerate. I expect Fred can come up with a better, easier way. Vivian |
From: Geoff M. <ub...@ge...> - 2009-10-11 13:43:04
|
> +#elif defined(_WIN32) > +# include <al.h> > +# include <alc.h> > +# include <AL/alut.h> Thanks Vivian! For a long time now I have had to make this patch locally, since I too use the OpenAL SDK, and it no longer uses an 'AL' sub-directory. It would also be great if this include block only occurred in a _ONE_ header (hxx), and not in any source(s) (cxx)... And I chose to use a 'USE_OPENAL_SDK' switch, rather than the 'generic' WIN32 switch... so other WIN32 players can continue to still use <AL/al.h> etc, if they have it setup that way. I hope this makes it into CVS sometime soon... Regards, Geoff. |
From: Erik H. <er...@eh...> - 2009-10-11 13:50:20
|
Geoff McLane wrote: > I hope this makes it into CVS sometime soon... Was his soon enough? ;-) Erik |
From: Geoff M. <ub...@ge...> - 2009-10-11 14:04:19
|
On Sun, 2009-10-11 at 15:49 +0200, Erik Hofman wrote: > Geoff McLane wrote: > > I hope this makes it into CVS sometime soon... > > Was his soon enough? ;-) > > Erik So slick and quick... thanks... Geoff. |
From: Nicolas Q. <nqu...@gm...> - 2009-10-12 17:23:05
|
Hi Erik (sorry Erik ;)) Bit of background : I used to use Vivian setup when I first starting building my own exe a while back (OpenAL SDK 1.1 + freealut 1.0.1) and sound worked. I switched to Fredb's third party libs a few months back, sound worked. Now, I can build a working exe with my old/Vivian's setup, but get no working sound (and no errors) but I do have the crash on exit. I believe it's because we're trying to release the alcDevice and alcContext a second time by calling AlutExit., after doing it manually in the stop method of the soundmanager. Anyone has sound on Vista64, with VC9, with latest CVS and OpenAL SDK 1.1 + freealut 1.0.1 ? Before anyone mentions hardware problems, I only have a generic software device since Vista never had support for hardware 3d positional audio in hardware through DirectSound, it was dropped before release. There never was generic hardware positional audio support in Vista. So only the "Generic Software" device available to OpenAL, thus cannot be that my default device is a malfunctioning hw wrapper (we pass null to the device selection code, so we get the default one, whatever it is) And OpenAL works fine here, many other apps using the exact same dll, so I'm at a bit of a loss at the moment to root that one out. Will look further into it as time permits, but would love to hear if anyone has to this setup working under Vista64, especially as it use to work (yes, I've gotten rid of AL part of the 3rd party stuff to avoid it being referenced, to make sure the SDK is used. I've triple checked everything) Cheers, and thanks again Erik for working on the sound system. Nic On Sun, Oct 11, 2009 at 10:04 AM, Geoff McLane <ub...@ge...> wrote: > On Sun, 2009-10-11 at 15:49 +0200, Erik Hofman wrote: > > Geoff McLane wrote: > > > I hope this makes it into CVS sometime soon... > > > > Was his soon enough? ;-) > > > > Erik > > So slick and quick... thanks... > > Geoff. > > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Flightgear-devel mailing list > Fli...@li... > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > -- Be Kind. Remember, everyone is fighting a hard battle. |
From: Erik H. <er...@eh...> - 2009-10-12 17:28:28
|
Nicolas Quijano wrote: > Now, I can build a working exe with my old/Vivian's setup, but get no > working sound (and no errors) but I do have the crash on exit. I believe > it's because we're trying to release the alcDevice and alcContext a > second time by calling AlutExit., after doing it manually in the stop > method of the soundmanager. I think this is fixed by a patch I just committed. Since alut is initialized without a Context it shouldn't try to destroy it either. Erik |
From: Vivian M. <viv...@li...> - 2009-10-13 07:57:59
|
Erik Hofman > > Nicolas Quijano wrote: > > Now, I can build a working exe with my old/Vivian's setup, but get no > > working sound (and no errors) but I do have the crash on exit. I believe > > it's because we're trying to release the alcDevice and alcContext a > > second time by calling AlutExit., after doing it manually in the stop > > method of the soundmanager. > > I think this is fixed by a patch I just committed. > Since alut is initialized without a Context it shouldn't try to destroy > it either. > Nope, that doesn't fix it - still get crash on exit. But I no longer get sound stopping when I change window size at runtime. Vivian |
From: Erik H. <er...@eh...> - 2009-10-13 08:05:24
|
Vivian Meazza wrote: > Nope, that doesn't fix it - still get crash on exit. But I no longer get > sound stopping when I change window size at runtime. You might want to comment out some code in SGSoundMgr::~SGSoundMGr to see what exactly might cause it. Erik |
From: Nicolas Q. <nqu...@gm...> - 2009-10-15 16:34:27
|
(Most of this written last night before bed) Hi all, commenting out code in the destructor won't help, as the problem is being set-up much earlier, while FGFS is still in the initialization stages (dt == 0) : in debug, there is a fatal assert on SGSoundSample::freedata, being called by SGSoundMgr::requestBuffer, line 429), itself being called from SGSampleGroup::update (line 104), rumble.wav, ultimately going back up the call chain to fgOSMainLoop. I suspect the exit bug in Release is when it starts freeing stuff that's not there to be freed. I say suspect 'cause I can't get there in Debug, as it fails before finishing complete initialization. the alutinit++ stuff is wrong : alutinit is at 2 at the time the destructor checks it, thus never calling alutExit (not that it matters, alutInit does nothing but set a flag variable in the variant we use) there is one incrementation too much in there, and since it can only be initialized once, why track a number ? I believe SoundManager::load might be where it's all happening, or starting to happen. You do use a weird param setup, assigning unitialized values from pointers to stack variables then passing the address of the stack variables as params, only to write them back in the pointers at the end :) It returns garbage on trying to load the ATC voice, maybe because there is no valid AL context as the (internal) message error says, before the catch code gets rid of it. Doesn't assert there 'though, churns on until it gets to rumble.wav. Why is SoundManager::load a static member function ? it's never called that way, and always as a member function, so why ? (not major, but bad form) Also, if (_data != NULL) { delete[] _data; _data = NULL; } in free_data() in sample_openal.hxx is the offending party (in debug). I believe delete[] is the problem, _data not explicitly being an array (and not using new in any shape or form) Will look more into it, but if more people, not just on windows, could take some time to run the new sound system in debug, we might root out a few bugs in it while we're at it. Could you guys build in debug and run it through and see what you come up with ? I'm sure Erik could use the help. Hope this helps, will investigate further, Cheers, Nic On Tue, Oct 13, 2009 at 4:05 AM, Erik Hofman <er...@eh...> wrote: > Vivian Meazza wrote: > > > Nope, that doesn't fix it - still get crash on exit. But I no longer get > > sound stopping when I change window size at runtime. > > You might want to comment out some code in SGSoundMgr::~SGSoundMGr to > see what exactly might cause it. > > Erik > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Flightgear-devel mailing list > Fli...@li... > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > -- Be Kind. Remember, everyone is fighting a hard battle. |
From: Erik H. <er...@eh...> - 2009-10-15 17:14:25
|
Hi Nicolas, Nicolas Quijano wrote: > (Most of this written last night before bed) > Hi all, commenting out code in the destructor won't help, as the problem > is being set-up much earlier, while FGFS is still in the initialization > stages (dt == 0) : in debug, there is a fatal assert on > SGSoundSample::freedata, being called by SGSoundMgr::requestBuffer, line > 429), itself being called from SGSampleGroup::update (line 104), > rumble.wav, ultimately going back up the call chain to fgOSMainLoop. > I suspect the exit bug in Release is when it starts freeing stuff that's > not there to be freed. I say suspect 'cause I can't get there in Debug, > as it fails before finishing complete initialization. Thanks for the hint. I believe I've found the cause of it after reading this section. Let me know if it helps. > the alutinit++ stuff is wrong : alutinit is at 2 at the time the > destructor checks it, thus never calling alutExit (not that it matters, > alutInit does nothing but set a flag variable in the variant we use) > there is one incrementation too much in there, and since it can only be > initialized once, why track a number ? Hm that was a left over from a previous version. I thought I'd removed the line. Anyhow, Although FlightGear doesn't use the soundmanager class twice anymore I did use it to load sample while the 'real' soundmanager was not yet active (and nothing is preventing you from doing so). So I'll leave the code there, just in case. > Why is SoundManager::load a static member function ? it's never called > that way, and always as a member function, so why ? (not major, but bad > form) This is from the time when it was called from the soundgroup class, but you are right, it's not needed anymore. > Could you guys build in debug and run it through and see what you come > up with ? > I'm sure Erik could use the help. Actually I've asked for help several times, so yeas please report anything that might be wrong. Erik |
From: Olaf F. <fg...@of...> - 2009-10-15 21:11:11
|
Hi Erik, I need attached patch to compile the new sound system on Windows. I use alut/openal headers and libs from Frederic: ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty+OSG-20090820.zip Cheers, Olaf BTW: If you are doing commits: Please remove my MSVC80 project files from the flightgear repository. project/VC80. I will not update them any more. |
From: Tom P <zo...@gm...> - 2009-10-15 21:37:19
|
Hi Erik If you plan on doing the commit Olaf asked, could you also move the top-level FlightGear.dsp and .dsw into a directory named projects/VC60/ Those files are old, and just plain confusing if they are left at the top level. Tom Olaf Flebbe wrote: > Hi Erik, > > I need attached patch to compile the new sound system on Windows. > > I use alut/openal headers and libs from Frederic: > > ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty+OSG-20090820.zip > > > Cheers, > Olaf > > BTW: If you are doing commits: Please remove my MSVC80 project files > from the flightgear repository. project/VC80. I will not update them > any more. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > Flightgear-devel mailing list > Fli...@li... > https://lists.sourceforge.net/lists/listinfo/flightgear-devel |
From: Olaf F. <fg...@of...> - 2009-10-16 05:43:41
|
Hi, > > If you plan on doing the commit Olaf asked, could you also move the > top-level FlightGear.dsp and .dsw into a > directory named projects/VC60/ > > Those files are old, and just plain confusing if they are left at the > top level. And btw, they do not work at all.... Olaf |
From: Alasdair C. <al...@bt...> - 2009-10-16 13:14:05
|
On Fri, 2009-10-16 at 11:50 +0200, Erik Hofman wrote: > I finally found why the sound orientation was wrong, this should now be > fixed in CVS (sound positioning relative to the aircraft origin is still > to be done). > > Erik > CVS as off 10 minutes ago gives me SimGear compile error: sample_openal.cxx: In member function ‘void SGSoundSample::set_relative_position(SGVec3f)’: sample_openal.cxx:167: error: no match for ‘operator=’ in ‘((SGSoundSample*)this)->SGSoundSample::_relative_pos = pos’ ../../simgear/math/SGMathFwd.hxx:37: note: candidates are: SGVec3<double>& SGVec3<double>::operator=(const SGVec3<double>&) make[2]: *** [sample_openal.o] Error 1 Am I alone? regards Alasdair > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Flightgear-devel mailing list > Fli...@li... > https://lists.sourceforge.net/lists/listinfo/flightgear-devel |
From: Erik H. <er...@eh...> - 2009-10-16 09:50:35
|
I finally found why the sound orientation was wrong, this should now be fixed in CVS (sound positioning relative to the aircraft origin is still to be done). Erik |