Could not find file opengl32.dll when using Creative Alchemy to re-enable surround sound/EAX

Posts
5
Likes
11
When using Creative Alchemy to re-enable EAX support/surround sound in-game (been a problem since Vista due to how Sound API works in Windows (more info here ) it causes this error message when using the MBII launcher - Essentially disallowing me from using the launcher because the error message keeps popping up taking focus even while in-game

I use Alchemy in combination with XP SP2 compability mode to re-enable surround sound/virtual surround for headphones for better spatial sound - Being able to differentiate sounds coming from behind etc. True surround sound in Jedi Outcast/Academy has always been tied into EAX (Unless something has changed recently with the JKOpen projects etc?)

The software injects dsound.dll and dsound.ini into the GameData folder which I presume causes the problem. I could also see some sort of read/write permission screwing up when it's doing that, which might cause the issue?

Beyond the topic, but /soundinfo command seems to be disabled within the mod while joined to a game for some reason as well. I always presumed it's some sort of antiabuse/cheat method?

Here's a dump of the full error message.

It's bypassable just by launching the mod from a .bat.

Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'C:\Pelit\Jedi Academy\GameData\opengl32.dll'.
File name: 'C:\Pelit\Jedi Academy\GameData\opengl32.dll'
  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
  at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
  at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
  at System.IO.File.OpenRead(String path)
  at MB2Launcher.AntiCheat.GetMD5_AC(String fileName)
  at MB2Launcher.AntiCheat.RunScan()
  at MB2Launcher.LauncherMainF.FuncOnStart()
  at MB2Launcher.LauncherMainF.Form1_Load(Object sender, EventArgs e)
  at System.Windows.Forms.Form.OnLoad(EventArgs e)
  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl()
  at System.Windows.Forms.Control.WmShowWindow(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at MB2Launcher.LauncherMainF.WndProc(Message& keyPressed)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
MBIILauncher
  Assembly Version: 1.9.3.0
  Win32 Version: 1.9.3.0
  CodeBase: file:///C:/Pelit/Jedi%20Academy/GameData/MBIILauncher.exe
----------------------------------------
System
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
  Assembly Version: 3.5.0.0
  Win32 Version: 3.5.30729.8693 built by: QFE
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Management
  Assembly Version: 2.0.0.0
  Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
  <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 

ent

Movie Battles II Team
Posts
848
Likes
390
Why do you need EAX if DirectSound works perfectly? If you look at the sound code then it counts everything the same including the surrounding positions for every channel (only 2 channels - nothing very "surround"). The only difference in how sounds get mixed and one more layer that EAX uses, basically: counted sound data -> dsound vs counted sound data -> eax mixers -> dsound.
Sound mixing does not change the "surrounding" effect, since it was counted before.
 
Posts
5
Likes
11
ent,

It's been a long while (2007?) since I've confirmed how surround sound works in JK2/JKA (I do have a set of speakers to confirm this, but it takes a bit of an effort to set them up in my current apartment).

EAX shouldn't affect the number of channels being utilized - this would be the common sense and I know as much, but I distinctly remember rear speakers only being cloned/non-existent (sound output being two channels) while EAX is not enabled. Since Vista you can't even have distinct rear channels being utilized without running the game in compatibility mode and Alchemy. So for some reason, enabling rear channels in JK2/JKA is directly tied into having EAX enabled. EAX in theory should only add capabilities for reverb/occlusion effects etc.but that doesn't seem to be the case.

I use Creative's CMSS3D with headphones that simulate a binaural effect with speakers set up to 7.1 in windows control panel so running the game with XP SP2 compatibility mode the game outputs the sound to 7 distinct channels allowing the drivers to apply an effect that allows me to differentiate between sounds in the rear and front even with the audio signal in the end being 2 channels. In fact even modern games such as CS:GO can benefit from this because modern gaming engines do not handle spatial headphone audio well.

I know my way around gaming audio, it's a passion of mine.

Here's more information about audio in games in general.

I'll try to actually test that my rear speaker hypothesis is correct - I can tell the difference between running/not running EAX in game, but someone could argue that could be placebo. Can anyone think of a map in basejka/MBII that has a constant distinct sound coming from a certain direction? I could alternatively test it with another player or a bot of course.
 

ent

Movie Battles II Team
Posts
848
Likes
390
I have rewritten the whole sound engine (it took so much time to understand that all) and even added support to such formats as ogg and flac in the game and I know what I am talking about. The game outputs up to 2 channels, and if your rear speakers worked with all those technologies it's just because your tool counted it with its own way with some filters. It's something like fooling yourself, but liking the effect.

I will repeat: the sounds are counted the same - mixed differently.

The only difference is with EAX enabled we are able to mix any amount of channels (weapon channels, voice channels, ambient channels that called from the same entities etc) but w/o it you are able to listen only one channel per entity (so if some entity decided to play 2 sounds on weapon channel then only one will get played back).

My rewritten sound code fixes it though - w/o any dependency like EAX it mixes all channels fine.

Also mixing doesn't affect that issue with your speakers, it only lets you hear more sounds at once.
 
Posts
5
Likes
11
I don't mean to sound rude, perhaps we're talking about two separate things? I'm talking about positional audio beyond 2.0 (In its default state the game only pans audio from right to left) while you seem to talk about sound channels (number of concurrent sounds being played)

I just went through the process of connecting my rear speakers, and tested if rear speakers (4.1 setup) have distinct sounds (so no accidental cloning of the front to the rear) by making a server and having the map set as Lunarbase. I joined imperials and went to the generator room where the generator hum creates a sound which is set to certain coordinates.

With the following settings and a card with Creative's X-fi chip (I believe certain versions of Alchemy worked without Creative cards these days, mine was in the drivers) :
* in Windows 10, with jamp.exe set to compability mode of XP SP2
* Alchemy installed and dll's injected into the GameData folder
* EAX enabled in game (Requires a server restart/connect as the generator ambient sound isn't fired again if you do a soundrestart by enabling/disabling EAX)
* Speakers configured as 4.1/4.0

I first faced the generator and then had my back against it. With these settings the rear speakers would indeed be active with the back against the generator with the front speakers being quieter and vice versa. With any of these things lacking: (EAX enabled, Alchemy DLL's injected, XP SP2 compability mode active) the rear speakers would be absolutely silent, thus these steps allows one to achieve actual surround audio in the game.

I can take a video of this experiment and PM a link to you once I charge my camera and prove it to you if you don't believe me. I can't record in-game audio in surround with any tool, after all.

edit: When I have the time I should actually make a tutorial out of this and check whether it works with non-Creative cards and take some demos and render them with various pseudo HRTF techniques active in sound processing (Dolby Headphones, Creative's CMSS3D, Razer Surround).

edit2: I could swear that the game actually does some processing to sounds coming from behind giving them a distinct sound even with surround sound disabled. They sound slightly different, giving a different sound signature to sounds coming from the rear with just 2 channels being put out.
 
Last edited:

ent

Movie Battles II Team
Posts
848
Likes
390
I just checked the code. I used to think game always counted up to 2 output channels, but seems like with EAX you can have as many as EAX can supports.

So instead of counting left and right volumes it just sends entity coordinates to EAX system and then the system plays it back in its own environment that can be translated to any possible amount of output channels.

I am taking my words back.
 

Lessen

pew pew
Movie Battles II Team
Posts
1,251
Likes
995
shoutouts to TigerZeta for making this thread, I ran into it while googling what the deal with EAX was, and learned about Creative ALchemy and how it works with the sound card I have installed. Now EAX actually works, and it's pretty cool, but still kinda quirky.

Like, if a multi-life class dies and you're near the body, and the player respawns somewhere else that isn't loaded for you, and does a voice chat, the sound will come from the dead body. Which is funny.

And it sorta sounds like the Deka firing noise somehow doesn't have any directional information at all, but I haven't tested that rigorously.

I think the directional noise IS more accurate than with EAX off, but the sense of distance might be a little worse.

One thing that's nice is that if you trigger the same sound over and over again in a short time (like rolling over a bunch of buttons), they won't cancel/cut each other with EAX on. I wonder if the sound bug of taunts (and other sounds) cutting off early doesn't happen either...
 
Posts
52
Likes
57
You don't need ALchemy in JA since it uses OpenAL, and thus independent from DirectSound.
 

ent

Movie Battles II Team
Posts
848
Likes
390
One thing that's nice is that if you trigger the same sound over and over again in a short time (like rolling over a bunch of buttons), they won't cancel/cut each other with EAX on. I wonder if the sound bug of taunts (and other sounds) cutting off early doesn't happen either...
With OpenAL actually. OpenAL mixes them fine. EAX does another job. Though the option in UI is called EAX, it actually activates OpenAL with EAX features.
 

Lessen

pew pew
Movie Battles II Team
Posts
1,251
Likes
995
You don't need ALchemy in JA since it uses OpenAL, and thus independent from DirectSound.
Huh, are you completely sure of that? I thought I remembered having really weird behavior with EAX enabled before I learned about ALchemy, but... maybe I'm just better at telling what's going on now than I was then (like: realizing that voice taunts are coming from people's dead bodies).

It wouldn't be hard for me to test (playing with or without the alchemy files in the folder)
 

ent

Movie Battles II Team
Posts
848
Likes
390
No idea what alchemy is, and there are no any mentions about that in the code and so in the game.
I guess it is some kind of post-process filter for your audio driver?
 
Posts
52
Likes
57
Huh, are you completely sure of that? I thought I remembered having really weird behavior with EAX enabled before I learned about ALchemy, but... maybe I'm just better at telling what's going on now than I was then (like: realizing that voice taunts are coming from people's dead bodies).

It wouldn't be hard for me to test (playing with or without the alchemy files in the folder)

I use OpenAL myself with my X-Fi card and I'm pretty sure OpenAL is supposed to work properly on any OS. The sole purpose of ALchemy is to intercept DirectSound and DirectSound3D calls and translate them into OpenAL calls that Creative cards support natively. In their push towards software sound, Microsoft wiped out DirectSound from Vista onwards, therefore rendering any EAX/3D sound features based on DirectSound obsolete. That is, until folks at Creative came up with their translator app called ALchemy.
 
Top