Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: Fury on September 22, 2013, 02:36:37 pm

Title: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Fury on September 22, 2013, 02:36:37 pm
OpenAL is what FreeSpace 2 Open (FSO) uses as its audio subsystem to bring all those sounds and music out of your speakers or headphones. OpenAL is used because it is mature cross-platform audio API. In that department there are no serious alternatives to OpenAL.

When most people here mention OpenAL, they are usually referring to what is Creative's OpenAL. In the beginning it used to be open-source API (hence the name) but when Creative acquired it, they changed its license to proprietary. They kept binary downloads free for everyone though. Up until little over a month ago when Creative's site hosting OpenAL went down and it hasn't come back since.

But make note that Creative never once updated OpenAL since it was acquired, which happened back in 2005. Which would make Creative's OpenAL 8 years old now. Creative has included OpenAL drivers in their brand sound cards, but obviously those haven't been available for everyone nor is it guaranteed that they work in anything but Creative cards.

Considering the sorry state of OpenAL, how are we seeing OpenAL mentioned in launch screens in various video games? That's because Creative's implementation is not the only OpenAL out there. Remember that OpenAL used to be open-source before it was acquired by Creative? Some people made use of that and spinned their own updated versions of OpenAL. Many of them became proprietary and commercial, such as Rapture3D which I am sure you have seen in video game launch screens if you have paid any attention.

But no worries, there are free, open-source alternatives. Namely OpenAL Soft. Getting it is easy too, just three (or four) steps.

Go to http://kcat.strangesoft.net/openal.html
Download the binary package, the one that ends in -bin.zip. Which is at the time of writing this, openal-soft-1.15.1-bin.zip.
From the zip, extract Win32\soft_oal.dll to your FreeSpace 2 folder and rename it to OpenAL32.dll.
You might need to have known file extensions visible, so that your OpenAL32.dll won't have double extension by accident. Microsoft instructs how you can show known file extensions. (http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-7)

In case you had FSO already running, close it and then launch it again. If you don't notice any difference to Creative's OpenAL or if OpenAL Soft works better for you, do yourself a favor and uninstall Creative's OpenAL from Control Panel's Programs and Features, it's listed as OpenAL. If after this point FSO starts complaining about missing OpenAL, then you did not install OpenAL Soft correctly and FSO was using Creative's OpenAL up until it was uninstalled.

Should OpenAL Soft perform worse than Creative's OpenAL (which is highly unlikely), you can rename or delete the OpenAL32.dll in your FreeSpace 2 folder. Then you're back using Creative's OpenAL.

In my experience OpenAL Soft has fixed various problems, even some that weren't readily associated with audio. As such it would be greatly appreciated if you give OpenAL a chance, even if you don't have any audio problems.

Obviously this post concerns only people who use Windows. Linux folks already use OpenAL Soft and OS X folks have Apple's version of OpenAL.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Kolgena on October 10, 2013, 07:00:06 pm
What sort of things are you talking about when you say oal soft works better? Sound effects/3D positioning? Stuttering/popping? sound engine performance?

Just so I know what to look for when testing.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Fury on October 10, 2013, 11:51:23 pm
That would vary depending on sound card or chip and drivers, so I can't say what your experience will be. In my experience though there has been sometimes differences in how the two handle positional audio which might be the only difference you'll notice if you haven't had any issues with Creative's, but which is better may be subjective. Find out what differences you have (if any) by trying OpenAL Soft, no other way around it.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: The E on October 11, 2013, 02:17:41 am
Stickied for reference
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Kolgena on October 12, 2013, 04:57:44 am
At least for me, popping sounds (ubiquitous throughout briefing voice files) is gone, and 3D positional audio in 5.1 is actually working reasonably well now! Except, beams still have really weird sound effects, and I can't localize them well based on only sound.

Oddly enough, I can't find creative's openal on my computer. It's not in the list of programs, and I can't find it in my program files directories.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Fury on October 12, 2013, 09:17:34 am
The dll is installed to your System32 or SysWOW64 directory under Windows directory. However, you should run regsvr32 -u OpenAL32.dll in command prompt before you delete the file, if that is your intention.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Kolgena on October 12, 2013, 02:23:53 pm
The module "OpenAL32.dll" was loaded but the entry-point DllUnregisterServer was not found.

That's no good. wtf happend to my oal install?

Will it work to delete the dll then use something like ccleaner to remove its registry entries?
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: The E on October 12, 2013, 02:51:59 pm
Nothing happened. Openal does not install any handlers via regserv.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: FIZ on November 09, 2013, 11:18:45 am
This solved a long ongoing bug for me.  When playing any campaign, I would lose VA (even retail campaign) and music after a mission or two.  Cool find.  :yes:
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Lykurgos88 on December 04, 2013, 01:10:42 pm
Surprisingly I had more problems with this new OpenAL32.dll than with the old Creative's OpenAL. Here is what happened:

- I downloaded the binary package and then extracted and renamed win32\soft_oal.dll into Freespace 2\OpenAL32.dll
- I removed "Open AL" from the Windows 7 x64's "programs and features"
- Now the wxLauncher cannot find OpenAL! I cannot change any audio options, like sample rate or playback device.
- However it lets me to start the game, and from the log file I can verify that it DID indeed load the new openal32.dll:

Code: [Select]
Initializing OpenAL...
  OpenAL Vendor     : OpenAL Community
  OpenAL Renderer   : OpenAL Soft
  OpenAL Version    : 1.1 ALSOFT 1.15.1

  Found extension "AL_EXT_float32".
  Found extension "ALC_EXT_EFX".

  Sample rate: 48000 (48000)
  EFX enabled: NO
  Playback device: Speakers (ASUS Xonar Essence STX Audio Device)
  Capture device: Microphone (ASUS Xonar Essence STX Audio Device)
... OpenAL successfully initialized!

- The game seems to start nicely, but then I discover a bug that wasn't there before. I get this "pof" sound every time I change pages in the "Briefing screen" with narrated audio. You know, that screen which contains news and stuff, not the tactical map.

- Also one of the old annoyances remain: DPC latency spikes. In tutorial mission, if I just fly around without any afterburners (and without any background noices altogether), i get this quiet popping sound every few seconds from my humming engines (looping sound file). It might be because of my sound card. Man I should just switch to Unixonar drivers since these official ones have given problems at least 1-2 games, id software's RAGE was probably the worst.

BTW this is the program that enables to analyze DPC Latency: http://www.thesycon.de/deu/latency_check.shtml

So, I guess I should go back to the old version of OpenAL for now.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Fury on December 04, 2013, 01:55:02 pm
- Now the wxLauncher cannot find OpenAL! I cannot change any audio options, like sample rate or playback device.
That's because wxLauncher doesn't know to look for it in the FSO dir. It can look for it in any dir in system path or in its own dir. If you use wxLauncher, you have following options:
- Instead of using FSO dir, put the dll file to any of the directories included in system path.
- Add FSO dir to your system path.

I might add that the old launcher wouldn't have this problem as it is stand-alone executable residing in FSO dir.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: AdmiralRalwood on December 04, 2013, 09:25:15 pm
- Now the wxLauncher cannot find OpenAL! I cannot change any audio options, like sample rate or playback device.
That's because wxLauncher doesn't know to look for it in the FSO dir. It can look for it in any dir in system path or in its own dir. If you use wxLauncher, you have following options:
- Instead of using FSO dir, put the dll file to any of the directories included in system path.
- Add FSO dir to your system path.
Couldn't you also just copy the .dll to the wxLauncher folder, instead of (*shudder*) making your FSO folder a system path?
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Fury on December 04, 2013, 11:50:28 pm
You can, but then you would need to remember to keep the dll in not one, but two dirs. Be easier if you just copy the file to any of the dirs in system path, like system32. Or syswow64 if you're on 64-bit Windows. Or just add FSO to system path, nothing wrong with that. A lot of **** gets added to the path variable already, just go look at yours.

And of course, this is only up until SCP gets around to bundle OpenAL Soft in the executable instead of relying on external linking. But since wxLauncher wouldn't know that either, it also needs to bundle the dll either externally or within the executable.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: AdmiralRalwood on December 04, 2013, 11:52:10 pm
Or just add FSO to system path, nothing wrong with that. A lot of **** gets added to the path variable already, just go look at yours.
I keep my PATH variable carefully pruned, thank you very much.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: iVoid on January 11, 2014, 08:44:33 am
Thanks for this, it even helps to make FSO portable, which is nice. Couple questions:

Can I use the x64 binaries if I have a 64bit OS?

And can I use the libraries included in this package to compile FSO instead of the ones from creative? If so, is there any advantage to that?
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Beridian on January 12, 2014, 01:45:09 pm
Ok, I have now read my eyes sore on forum posts trying to get my audio to work in FSO. And found no sollution that works, openal is starting to become a nightmare. This is time I should be spending playing instead of trying to fix long known errors. But here it is, I manage to get openal installed, verified and then I run FSO. It detects openal, but find no audio devices, I have no less than 5 of those. 2 monitors, 1 onboard and 2 USB devices capable of playing sound (headset, speaker). It might be me being overly tirred, but right now I feel more like doing this  :banghead: than playing any games. And for the love of the Gods one CAPTCHA is enough damned it.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Shivan Hunter on January 12, 2014, 08:33:05 pm
Run a debug build (just start the game and exit, that should tell us what we need), copy the contents of freespace2/data/fs2_open.log, put it on pastebin.com (http://pastebin.com), and we may be able to tell you what's wrong.

"one CAPTCHA is enough damned it"

Yeah we get a lot of spam, I think it goes away after you have a few posts.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Kolgena on January 13, 2014, 02:21:03 am
Ok, I have now read my eyes sore on forum posts trying to get my audio to work in FSO. And found no sollution that works, openal is starting to become a nightmare. This is time I should be spending playing instead of trying to fix long known errors. But here it is, I manage to get openal installed, verified and then I run FSO. It detects openal, but find no audio devices, I have no less than 5 of those. 2 monitors, 1 onboard and 2 USB devices capable of playing sound (headset, speaker). It might be me being overly tirred, but right now I feel more like doing this  :banghead: than playing any games. And for the love of the Gods one CAPTCHA is enough damned it.

OpenAL soft currently doesn't work with wxlauncher for me. You might have the same problem? (Win 8.0) Try the super old creative OpenAL that we were using before Fury recommended OpenAL soft.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Herra Tohtori on January 13, 2014, 08:48:55 am
Talking about sound - this video portrays the most egregious audio problem currently plaguing FS2 Open:



Is there any way to resolve the sound source positioning in some more elegant way than just switching from right to left...?
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: TwoCables on December 16, 2014, 11:30:53 am
Go to http://kcat.strangesoft.net/openal.html
Download the binary package, the one that ends in -bin.zip. Which is at the time of writing this, openal-soft-1.15.1-bin.zip.
From the zip, extract Win32\soft_oal.dll to your FreeSpace 2 folder and rename it to OpenAL32.dll.
You might need to have known file extensions visible, so that your OpenAL32.dll won't have double extension by accident. Microsoft instructs how you can show known file extensions. (http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-7)

In case you had FSO already running, close it and then launch it again.

When I did this, I could no longer get rearmed by the Support ship. It would warp in and approach me, but then it would seem to get lost at about a couple hundred meters away and it would just sit there doing nothing as though it can't find me. It would follow me around if I started to move again, but it would never get any closer than a couple hundred meters. As soon as I deleted it, everything was fine.

Has anyone else experienced this? I'd like to fix it because I did notice a subtle improvement (but it could also be the placebo effect).
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: galneon on February 11, 2015, 11:50:50 am
I'm glad to see a thread like this here, and stickied no less.  I searched for a thread like this so I could create one extolling the virtues of OpenAL if one didn't already exist.  It gets a lot of flak, especially from developers trying to justify their use of inferior, but easier to implement, solutions like FMOD and Xaudio2, which are abominable in terms of positioning and realism but highly portable.

OpenAL Soft was updated last year to implement HRTF (head-related transfer function) support.  This results in headphones giving the wearer the impression that sounds are coming from in front of, behind, above, and under the user (and of course to the sides).  It works by simulating two microphones placed in the ears with all the dampening of sounds based on the shape of the ears and head that that would entail.  Basically, it emulates how people actually hear and how they process sounds from all directions with only two eardrums.  You can find HRTF demos on YouTube and they will work with stereo headphones of any quality.  I recommend listening to this one with headphones (and closed eyes):

http://www.youtube.com/watch?v=IUDTlvagjJA

I used OpenAL Soft for headphones and for discrete 7.1 surround until I finally purchased Rapture3D.  It features HRTF (and other things) as well as "tinted reconstruction" which attempts to adapt HRTF to stereo, quadraphonic, 5.1, 7.1, etc. speaker setups to simulate some of the improved directional perceptions of HRTF (such as sounds coming from above and below the listener).  It also comes with more HRTF presets than OpenAL Soft, which can be important as certain HRTF datasets will mesh better with certain people for the simple reason that we all have different ear and head shapes.

Some games that have extraordinarily impressive positional audio via OpenAL that almost no one knows about (and none of these require a physical soundcard as I use HDMI or an onboard Realtek chip depending on what PC I'm on):

Thief: Gold
Thief 2
System Shock 2
S.T.A.L.K.E.R. Series (Clear Sky and Call of Pripyat are especially impressive)
Unreal Tournament 3
And of course FreeSpace Open

There are more.  These are the ones I've most recently enjoyed on both Windows 7 and 8.1.

Please don't dismiss OpenAL just because Creative bought and then attempted to bury it just like they did Aureal3D.  Unlike A3D, OpenAL is still under development, most notably by the OpenAL Soft developer(s) and the Rapture3D developer.  Most developers spend almost no time working on their engine's audio, but almost any game with OpenAL support has serious potential that can be unleashed using the right methods.  FMOD/wwise/XAudio2 may still be the future because developers find them so easy to work with and port, but it's a bleak one.  Anyone with a good reference point for positional audio who has played any triple AAA titles in the last 5+ years knows this :/
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: ZeroDivision on December 29, 2015, 10:00:16 pm
On my system the audio would often clip or get distorted in intense battles and especially during explosions. Using OpenAL Soft instead of the default OpenAL from Creative seems to fix this.

About HRTF, I've tried it with a couple of games now (FS2 included) and for some reason it makes everything sound a bit thin. Sort of like having everything run through a high-pass filter and taking out a good chunk of bass in the process. Other than that it works pretty well.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Jackho on September 11, 2016, 04:02:19 am
Hi,

Haha! I'm glad I'd be curious enough to find this thread about sound while i'm searching for something else  :lol:
Now I finally got 5.1 sound placement after years of stereo in freespace. Good news!

Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Bryan See on January 20, 2017, 07:02:44 am
Excuse me, I have something to tell you.

3D sounds usually have only one channel, that is mono. Nowadays, in most modern games, 3D sounds have more than one channel, I presume. So, this warning at sound.cpp, line 354 needs to be changed.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: The E on January 20, 2017, 07:38:16 am
Excuse me, I have something to tell you.

3D sounds usually have only one channel, that is mono. Nowadays, in most modern games, 3D sounds have more than one channel, I presume. So, this warning at sound.cpp, line 354 needs to be changed.

No, it doesn't. Your presumption is wrong and based on an invalid interpretation of what a "3D sound" in FSO is.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: JZStudios on December 23, 2017, 12:01:50 am
So this is old, but it's Google's most recommended hit for surround sound in the game.
I'm just going to say I'm dumb and I don't understand, but maybe also things have changed slightly since this was released? Is there an easier step by step guide? Or an updated one now that both the OpenAL soft and FSO have been updated? I'm just really unsure of how or what to do with the various 32 bit and 64 bit files and where to put them. I don't want to just monkey around with things and break stuff.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: jr2 on December 23, 2017, 07:13:47 am
So this is old, but it's Google's most recommended hit for surround sound in the game.
I'm just going to say I'm dumb and I don't understand, but maybe also things have changed slightly since this was released? Is there an easier step by step guide? Or an updated one now that both the OpenAL soft and FSO have been updated? I'm just really unsure of how or what to do with the various 32 bit and 64 bit files and where to put them. I don't want to just monkey around with things and break stuff.

IIRC, You'll need the 32-bit .dll in the wxLauncher directory and the 64-bit in the FS2 directory (unless you're using a 32-bit FSO, in which case, just a 32-bit in the FSO directory will do fine).  There may be a specific subdirectory you're supposed to put it in.  Hop on the HLP Discord server (https://discord.gg/YNVP3WR) and ask.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: AdmiralRalwood on December 23, 2017, 01:38:37 pm
Current nightly builds include the OpenAL Soft DLL so it doesn't require any effort on the user's part.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: jr2 on December 25, 2017, 09:19:50 am
Current nightly builds include the OpenAL Soft DLL so it doesn't require any effort on the user's part.

Would just need a 32-bit in the wxLauncher folder then, right? (if the FSO build was 64-bit anyways)
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Gregster2k on December 26, 2017, 10:24:12 am
Just to throw my $0.02 in here, I can second everything Galneon said - I own a copy of Rapture3D "User" - bought it for $50(?) and it works w/ most OpenAL apps (not all, though - it worked with FS Open last I checked a few years ago). It continues to receive updates from Blue Ripple Sound (for free - buy once, get updates forever) and its HRTFs are, at least to my ears, the best 3D sound I've ever heard. I recommend using open-back headphones such as the Audio-Technica ATH-AD900X; closed-backs may sound muffled.

edit: For games which support 7.1 but not OpenAL, Razer Surround _kinda_ works but sounds inferior and in my exp. is laggy and glitchy (often turns itself off)

edit2: Can confirm putting 32bit in wxlauncher dir and 64-bit dll in FSO dir seems to be the way to go for any 3rd party OAL https://www.hard-light.net/forums/index.php?topic=94134.0
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: LazPL on January 05, 2021, 04:56:42 pm
How can I force a specific sound device to be used? In my fresh FSO install (Knossos) on my fresh new laptop, the sound is disregarding whatever sound device is selected in windows, it only comes out of the laptop speakers. It also disregards the windows volume settings... All I can do is mute the sound completely.
I guess I have whatever OpenAL version Knossos installed.
Any ideas?
Thanks!
Any ideas?
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: Antares on January 05, 2021, 05:04:36 pm
You should be able to select your preferred playback device in the settings window, under the Audio menu.
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: LazPL on January 06, 2021, 05:47:04 am
You should be able to select your preferred playback device in the settings window, under the Audio menu.
Thanks Antares, but that's precisely the problem - The selected audio output setting is ignored by FSO, whatever device I have connected, whether wired or Bluetooth, and whatever device is selected in Windows when I launch Knossos, the FSO sound will come through the laptop speakers - and what is more, the volume settings are also ignored - as they're controlling the selected output device, which is not the same as the one FSO is using. Really strange. This doesn't happen with any other software. Thanks for any ideas!
Title: Re: The state of audio (OpenAL) in FreeSpace 2 Open
Post by: LazPL on January 06, 2021, 07:10:18 am
I just realized that I could set the preferred audio output device in Knossos - and that it overrides whatever Windows is set to use... So, problem solved! My bad, sorry...