kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.22k stars 536 forks source link

Bioshock EAX support #1001

Open kcajjones opened 5 months ago

kcajjones commented 5 months ago

Using OpenAL Soft v1.23.1 with Bioshock (classic). Game has working audio but in-game EAX toggle is greyed out. Log file shows: [ALSOFT] (EE) EAXSet [EAX_FX_SLOT] Flags out of range (value: 3; min: 0; max: 1)

Full log here: bioshock.log

Game is listed as using EAX 5.0 which, as far as I know, every implementation has been using Creative's OpenAL.

kcajjones commented 5 months ago

Partially fixed by setting Bioshock.exe to Windows XP Service Pack 3 compatibility mode. Game now allows the EAX toggle and can be enabled.

I don't have a Creative Soundblaster X-fi card and Windows XP to test the correct EAX sounds but there are definitely some effects added using EAX via OpenAL Soft.

Further multiple errors in log: [ALSOFT] (EE) EAXSet [EAX_SOURCE] Flags out of range (value: 23; min: 0; max: 7).

bioshock.log

kcat commented 5 months ago

If the game uses OpenAL natively, I'm curious why it would need to be set to XP SP3 compatibility mode to enable EAX. It'd make sense for DSound, which removed hardware acceleration (and EAX as a consequence) with Vista and later, so there'd be no reason to try if on Vista or later. But with OpenAL, hardware acceleration was always and still is available with appropriate hardware/drivers.

In any case, the Flags out of range errors may be bugs. When setting the EAXSOURCE_FLAGS source EAX property for EAX5, it forwards to eax3_set, which in turn checks against the EAX2 flags that fails against the EAX5 flags. Similarly with setting EAXFXSLOT_ALLPARAMETERS effect slot property for EAX5, it call Eax5AllValidator which first calls Eax4AllValidator, the latter of which only checks against the EAX4 flag.

It should be noted that OpenAL Soft doesn't actually handle the EAX5 flags. Something to do with upmixing, 3D elevation filters, and speaker levels. I can fix it for them to be recognized and not error, but they'll ultimately not do anything.

kcat commented 5 months ago

Commit f21e9161df8daaa410bd44cdaf60b26580905b69 should fix the flags out of range errors.

Kappa971 commented 5 months ago

I played BioShock months ago with an X-Fi Titanium HD which has OpenAL hardware support and I don't remember having to select Win XP compatibility. It's very strange, the game was released at the time of Windows Vista... Also I'm on Windows 11 (the card is theoretically not supported but still works). I didn't try OpenAL Soft because luckily the card worked well throughout the campaign (except for a single BSOD).

kcajjones commented 5 months ago

I can't explain why, but it definitely makes it work.

There's a mention of it on PCGamingWiki stating that Windows 8 and above have an issue with sounds not playing that can be fixed with Windows XP SP3 compatibility mode. It references the Steam BioShock forums - although I couldn't find the post in question.

Kappa971 commented 5 months ago

I can't explain why, but it definitely makes it work.

There's a mention of it on PCGamingWiki stating that Windows 8 and above have an issue with sounds not playing that can be fixed with Windows XP SP3 compatibility mode. It references the Steam BioShock forums - although I couldn't find the post in question.

I had stuttering audio issues after a few minutes of playing with a Sound Blaster Z card and its OpenAL software driver, no problems with X-Fi (except a BSOD), and I don't remember setting any compatibility modes. Maybe there is some incompatibility with OpenAL Soft which is somehow mitigated by setting Win XP compatibility mode. Are you sure it's not enough to run the game as administrator?

image

The part that tells you how to activate EAX doesn't make much sense... If you install OpenAL (by Creative), it installs wrap_oal.dll in SysWOW64 and System32 and the game should be directed to that via openal32.dll (located in the same folders). wrap_oal.dll is listed as Generic Software and is used when you don't have OpenAL support in hardware, but it only supports EAX 2.0 so how is this supposed to help with BioShock?

image

Maybe there's something I don't understand? ๐Ÿ˜…

kcat commented 5 months ago

Maybe there's something I don't understand? ๐Ÿ˜…

Does the game ship its own openal32.dll for hardware only, perhaps? Or maybe it has issues detecting EAX support if it's using the router. Those are the two ideas I can think of off the top of my head for that.

Kappa971 commented 5 months ago

Does the game ship its own openal32.dll for hardware only, perhaps?

I don't see openal32.dll along with bioshock.exe so no.

Or maybe it has issues detecting EAX support if it's using the router.

The game has no problems detecting EAX on X-Fi cards. Also I just tested with OpenAL Soft 1.23.1 (log file alsoft_log.txt) and the game detects EAX, with soft_oal.dll renamed to openal32.dll and copied to the executable folder (although I don't know if it works correctly in game).

ThreeDeeJay commented 4 months ago

I also had to use Windows XP compatibility last time I tested it, using 1.22.2 (demo). 28Cb4nokAB6Gmj1z11ZrJFP8RIM-a_n-IknBwKxQtEg-1

But even with EAX enabled, I wasn't able to get 3D audio, and I read that the game actually uses FMOD for audio mixing, not OpenAL or DirectSound, so if I understand correctly, it just applies EAX as a post-processing effect to the surround mix provided by FMOD, which might explain the unexpected behavior. I also tested it in Windows XP with an X-Fi sound card and still got the same result. Using wrap_oal.dll to convert OpenAL to DirectSound and then DSOAL would most likely have result, granted it doesn't break stuff to begin with.

Although the game is configured to use OpenAL, it only uses it for the nice EAX effects. Everything else is handled by FMOD Source https://youtu.be/vq6rda4oJac

By default the game uses the proprietary FMOD audio engine, and you cannot successfully alter BioShock's audio system to another one, such as the generic OpenAL sound renderer (ALAudio.ALAudioSubsystem). This is because the game's main audio found under the \Program Files\2K Games\BioShock\Content\Sounds_Windows directory comes in FMOD's proprietary streaming .fsb format and so can only be played back by the FMOD engine. So altering the audio renderer will only result in sound playback in the game's main menu and duirng .bik movie files, but not in the game itself. If you're having sound issues with FMOD see the Audio Options under the In-Game Settings section for details of solutions. Source: https://tweakguides.bidecraft.com/Bioshock_7.html

I can confirm attempting to replace FMOD's sound system with OpenAL fails to play everything but the main menu BGM The same happens with a couple other Unreal Engine 2.5/3 games, so unless OpenAL Soft gets FMOD soundbank support, I don't think these games will ever get proper 3D audio (and even then EAX would probably be broken), though some like A Hat in Time can use X3DAudio HRTF.

The remaster is even worse because apparently they broke EAX altogether (it's even missing from the audio options and the config setting doesn't work, even on XP)

mirh commented 3 months ago

wrap_oal.dll is listed as Generic Software and is used when you don't have OpenAL support in hardware, but it only supports EAX 2.0 so how is this supposed to help with BioShock?

Wrap_oal is both "Generic Software" and "Generic Hardware". The guy quoted in that thread, in turns references this. From the fact that they mention soundmax soundcards existing, I'm going to assume they may have as well been using windows XP.

so if I understand correctly, it just applies EAX as a post-processing effect to the surround mix provided by FMOD, which might explain the unexpected behavior.

So.. what? They still need an api to output the audio, and it's not like they could make their own EAXยฎ with blackjack and hookers.

and you cannot successfully alter BioShock's audio system to another one

I mean, that sounds pretty normal tbh. It's the same in mass effect with ISACT, and in ME2 with wwise.

Kappa971 commented 3 months ago

Wrapoal is both "Generic Software" and_ "Generic Hardware". The guy quoted in that thread, in turns references this. From the fact that they mention soundmax soundcards existing, I'm going to assume they may have as well been using windows XP.

I don't know what "Generic Hardware" does but I doubt any modern sound card would be recognized as such, no cards today have dedicated hardware voices, so wrap_oal probably just creates a "Generic Software" device with EAX 2.0 support and stereo output, ergo that guide on PCGamingWiki may be wrong (Does BioShock support EAX 2.0?).

Download ALCapsViewer on a modern PC without Creative cards, install OpenAL (should install OpenAL32.dll and wrap_oal.dll), open ALCapsViewer and see what devices are listed (This might clarify everything). This is what it lists with an X-Fi: image

mirh commented 3 months ago

I don't know what "Generic Hardware" does but I doubt any modern sound card would be recognized as such

Of course there's no hardware directsound today, but that supposed fix is super old indeed. Also, it hasn't stopped "geniuses" from using alchemy to sort-of fix native openal games this way.

(Does BioShock support EAX 2.0?)

It might be some fun to try to load the executable in ghidra.. But anyway, it appears the "creative eax audio" is actually a toggle for the entire openal subsystem? Patch 1.1 though probably blacklisted "generic software".

Download ALCapsViewer on a modern PC without Creative cards

I know.. I did make the OpenAL tools package after all. But if you place dsound.dll (from either alchemy or dsoal) in the same folder of the router/wrapper/executable you'd see another entry pop up.

Kappa971 commented 3 months ago

Of course there's no hardware directsound today, but that supposed fix is super old indeed. Also, it hasn't stopped "geniuses" from using alchemy to sort-of fix native openal games this way.

https://web.archive.org/web/20080514015042/http://www.soundblaster.com/products/gaming/article.asp?articleID=71545&categoryID=13 Generic Hardware

Non-OpenAL audio solutions
If you don't have an OpenAL compatible card installed, or your sound card drivers or OpenAL run-time are obsolete, 
then you might encounter problems with BioShock's sound when the "Use Creative EAX Audio" is set to "ON".
Some people have reported stuttering or crackling sound.

In this situation, OpenAL is still trying to process 3D audio for you, but it can't find a working OpenAL hardware
device. On a Windows XP system, it will instead look for a DirectSound3D sound card on your PC. OpenAL can pass the
game's audio  instructions onto DirectSound3D. The quality of 3D audio you will hear might not be great - 3D 
positioning and reverb quality may be compromised, and at worst the sound may be distorted.

How can this happen today? Forcing ALchemy to be used on non-Creative cards? For what purpose? I think it's better to use OpenAL Soft rather than ALchemy's EAX software emulation (it's pretty bad).

Generic Software

If there is no DirectSound3D device, or you are running Windows Vista which doesn't support DirectSound3D hardware
sound, then OpenAL's software mixer will take over. The OpenAL software mixer currently has not been optimized
for BioShock.

This is what PCGamingWiki recommends but I think it's wrong. Putting wrap_oal.dll in the game directory and renaming it to openal32.dll what does it do? Do you have 3D audio without EAX? Because I don't think the game is backwards compatible with EAX 2.0 and as you said it seems like an antiquated solution.

So, if you don't have a fully OpenAL compatible hardware solution, usually the best solution is to try the game
with "Use Creative EAX Audio" set "ON" and then "OFF" and see which sounds better! When the setting is "OFF",
you'll hear the default audio mixer which ships with BioShock. Without a proper OpenAL sound card, this might be your
best bet. It doesn't have hardware grade sample-rate conversion, state-of-the-art HRTF algorithms for headphone and
2-speaker 3D, or hardware accelerated reverb. But it does support features like reverb and 3D panning on 5.1 and
7.1 systems

So if you have a Creative card (with OpenAL hardware support, Host OpenAL works badly), you can enable Use Creative EAX Audio normally. If you don't have a Creative card:

  1. Use OpenAL Soft and enable Use Creative EAX Audio;
  2. Disable Use Creative EAX Audio.
mirh commented 3 months ago

How can this happen today? Forcing ALchemy to be used on non-Creative cards?

I didn't say that (even though it's certainly possible and documented). I meant that some smartasses, rather than actually fixing openal in certain games, went the roundabout way through alchemy restoring the "generic hardware" renderer.

I think it's better to use OpenAL Soft rather than ALchemy's EAX software emulation (it's pretty bad).

Last time I checked it wasn't that bad (at least if you managed to hit "Using Native OpenAL Renderer" instead of "Using Creative Software 3D Library"). But sure, no doubt that openal soft is the only thing worth using in 2024.

Putting wrap_oal.dll in the game directory and renaming it to openal32.dll what does it do?

It does what it does in every single other game ever? Like, seriously? It bypasses the router discovery and selection process, and it forces whatever compliant openal implementation(s) that are in the other dll (I wonder if the game couldn't be extra finnicky when the first device name it meets isn't also the default one?)

Do you have 3D audio without EAX?

As linked, the game likely blacklisted generic software in patch 1.1 (it would be nice to check the demo perhaps?). If I had to take a guess (considering that I checked even the original 2007 disc, and it doesn't come with any openal dependency) they shipped the damn game not even knowing/understanding that a generic redist existed and that their premium audio option wasn't technically just limited to quality sound cards.

Kappa971 commented 3 months ago

Last time I checked it wasn't that bad (at least if you managed to hit "Using Native OpenAL Renderer" instead of "Using Creative Software 3D Library"). But sure, no doubt that openal soft is the only thing worth using in 2024.

Trust me, ALchemy's EAX software emulation is terrible, so much reverb (I owned a Sound Blaster Z). And this "Using Native OpenAL Renderer" instead of "Using Creative Software 3D Library" is another mistake. Sound Blaster Z (and later) uses Creative ALchemy for DirectSound3D games and Host OpenAL (sens_oal.dll, OpenAL in software) for OpenAL games. ALchemy (in software) uses its OpenAL implementation (Using Creative Software 3D Library) , it doesn't use sens_oal.dll. What you "recommended" is to rename sens_oal.dll to ct_oal.dll making ALchemy believe that the card in use has hardware support for OpenAL, and so using sens_oal instead of its internal emulation. This is wrong to do because the games will have problems.

Then as already mentioned, ALchemy's EAX software emulation is terrible while Host OpenAL has always given me problems such as popping or stuttering audio in BioShock or Prey (after a few minutes of play) as well as having the same exaggerated reverb problems as ALchemy.

Everything I wrote I tested personally.

It does what it does in every single other game ever? Like, seriously? It bypasses the router discovery and selection process, and it forces whatever compliant openal implementation(s) that are in the other dll (I wonder if the game couldn't be extra finnicky when the first device name it meets isn't also the default one?)

I know what it does, but how does the game behave? According to the wrap_oal documentation: "Generic Hardware" = using DirectSound3D (impossible today) "Generic Software" = using DirectSound (I doubt the game would run well like that).

Do you have 3D audio without EAX?

Forget this.

ThreeDeeJay commented 3 months ago

I meant that some smartasses, rather than actually fixing openal in certain games, went the roundabout way through alchemy restoring the "generic hardware" renderer.

Putting wrap_oal.dll in the game directory and renaming it to openal32.dll what does it do?

It does what it does in every single other game ever? Like, seriously? It bypasses the router discovery and selection process, and it forces whatever compliant openal implementation(s) that are in the other dll (I wonder if the game couldn't be extra finnicky when the first device name it meets isn't also the default one?)

To be fair, given wrap_oal.dll wraps OpenAL to DirectSound3D, renaming it to OpenAL32.dll would force open the door to DSOAL, which does provide some tangible benefits in some cases.

e.g. Just Cause comes with a rare but subpar GameCODA/Sensaura(?)-based built-in HRTF, and neither DSOAL nor OpenAL Soft alone can disable that filter on their own, so enabling OpenAL Soft's HRTF would make positioning even more diffuse from the double HRTF processing. Only by adding wrap_oal.dll alongside DSOAL are we able to get proper 3D audio, in addition to setting reverse-y=true since verticality is flipped because of course it is (not to mention, without wrap_oal.dll, that flag doesn't even work, which I presume means the game's built-in HRTF is still handling the 3D spatialization).

According to this, wrap_oal allows to "restore EAX effects in native OpenAL games" but I'm also not sure why translating OpenAL calls to DS3D for EAX would work better than using OpenAL's EFX or even EAX directly. Were there sound cards that lacked ct_oal.dll and needed this wrapper to support hardware mixing in OpenAL games? ๐Ÿค” Anyhow, I'm not sure how this changes EAX behavior in Bioshock but I'll give it a shot when I get a chance. I did notice that apparently wrap_oal + DSOAL checks for EAX 2, 3 and 4 but then settles with 2.0. in ALCapsViewer according to the log. EFX10ShowWin32_yylr47ClqI

it appears the "creative eax audio" is actually a toggle for the entire openal subsystem?

I really doubt so, unless earlier builds did work differently, since like I mentioned before, actually changing the audio system to OpenAL results in no audio since OpenAL/Soft doesn't seem to be capable of decoding FMOD soundbanks. I've only seen that switch work in games where the default audio subsystem (like Galaxy) uses more generic sound file formats. And to think there was a time when FMOD supported hardware EAX/HRTF directly.

Trust me, ALchemy's EAX software emulation is terrible, so much reverb (I owned a Sound Blaster Z).

Yeah, without proper hardware like the X-Fi series, ct_oal.dll, ALchemy won't yield good results, especially with the Creative Software 3D Library, but IMO sens_oal/Host OpenAL does sound better and more accurate to hardware sound. Maybe adjusting buffer settings would fix popping? Either way, I'd still go with DSOAL mainly because of custom HRTF but also at least I can adjust the reverb volume, flip axes, etc.

mirh commented 3 months ago

Sound Blaster Z (and later) uses Creative ALchemy for DirectSound3D games and Host OpenAL (sens_oal.dll, OpenAL in software) for OpenAL games.

Which isn't what I said unless you tinker with it.

What you recommended is to rename sens_oal.dll to ct_oal.dll

I didn't recommend anything at all, and this has nothing to do with bioshock. I said that many clueless people are so used to just applying alchemy to old games, that they just use it indiscriminately even when openal is involved. And that may be more or less awful, but nonetheless apparently it lets you enable the in-game EAX option.

I know what it does, but how does the game behave?

I actually just checked both the demo and the game on steam.. And indeed it even looks like they let you enable everything with "generic software" too? (I couldn't legitimately confirm that was the renderer being used because unlike other games they don't seem to have a console or a log to tell you, but EnumerateWin32 reported that was the default)

Even though from decompiling the executable I could tell they are still doing something with the name of that string, in the same bitmask that also stores the EAX version. FWIW they are properly checking each of them from 5 to 2. Separately from that (FMOD::OutputOpenAL) I could also have they have like every other supposed api under the sun compiled in (from ds, to wasapi, to winmm and asio) but I really couldn't make any sense of how they are wired.

p.s. seemingly even some world of warcraft build uses/used to have this particular FMOD configuration where it could selectively use its own mixer or openal

renaming it to OpenAL32.dll would force open the door to DSOAL, which does provide some tangible benefits in some cases.

So what then? It's stupid. If really you cannot get the game to pickup the device you want, you should just rename soft_oal to it if any.

Just Cause comes with a rare but subpar GameCODA/Sensaura(?)-based built-in HRTF,

And that used openal?

why translating OpenAL calls to DS3D for EAX would work better than using OpenAL's EFX or even EAX directly.

In 2018 dsoal's eax and oal-soft's eax were separate (in fact as we know dsoal was very much the potpourri of regressions and fixes in those days)

I did notice that apparently wrap_oal + DSOAL checks for EAX 2, 3 and 4 but then settles with 2.0. in ALCapsViewer according to the log.

I never understood the point of EAX3.0EMULATED and EAX4.0EMULATED tbh

since like I mentioned before, actually changing the audio system to OpenAL results in no audio

That's still all within FMODAudio.FMODAudioSubsystem, it doesn't have to use the ALAudio.ALAudioSubsystem that you are thinking

And to think there was a time when FMOD supported hardware EAX/HRTF directly.

Literally this

Kappa971 commented 3 months ago

According to this, wrap_oal allows to "restore EAX effects in native OpenAL games" but I'm also not sure why translating OpenAL calls to DS3D for EAX would work better than using OpenAL's EFX or even EAX directly. Were there sound cards that lacked ct_oal.dll and needed this wrapper to support hardware mixing in OpenAL games? ๐Ÿค”

There were probably sound cards that supported DirectSound3D but not OpenAL.

Anyhow, I'm not sure how this changes EAX behavior in Bioshock but I'll give it a shot when I get a chance.

With wrap_oal + ALchemy or DSOAL, I could speculate that the game could run in some sort of EAX 4.0 compatibility mode, detecting the "Generic Hardware" device. it's a mystery what happens if you only use wrap_oal as noted on PCGamingWiki. In this case the game should only detect a "Generic Software" device and wrap_oal should translate OpenAL calls to DirectSound (not DirectSound3D), but what happens?

Yeah, without proper hardware like the X-Fi series, ct_oal.dll, ALchemy won't yield good results, especially with the Creative Software 3D Library, but IMO sens_oal/Host OpenAL does sound better and more accurate to hardware sound. Maybe adjusting buffer settings would fix popping?

Host OpenAL is as bad as ALchemy (reverb, reverb and more reverb ๐Ÿ˜…) and also, as already written, it has some problems that I haven't found solutions to. In Host OpenAL you can't adjust any buffer settings.

I have an X-Fi on a modern PC and it works fine in these games (well in Bioshock I had a BSOD but only once in the entire campaign). The only problem is that 90% of the time when developers added EAX to games, they didn't adjust the sound volume properly, causing audio clipping (this can be easily noticed in Doom 3). The solution is to have to adjust the volume in the game menu (but the developers should have done it!), it's very annoying.

mirh commented 3 months ago

There were probably sound cards that supported DirectSound3D but not OpenAL.

None, because the moment openal became its own standalone api wrap_oal already existed. ~~And I'm somewhat skeptical this could be about bugged native openal implementations, because (from cm_oal, to nvopenal and rtk_oal) their use is rare enough that certainly their presence would stick out in the problem description Maybe the game or the router (well, at least some older routers) could mismatch the actual audio device being selected in the OS, and decide they were going to output to some other endpoint?~~

Uh, would you guess. I just realized that HOAL was actually born for licensing to motherboard vendors, and it does seem like some soundmax drivers did include it. So go figure the absolute state of software in ~2008.

With wrap_oal + ALchemy or DSOAL, I could speculate that the game could run in some sort of EAX 4.0 compatibility mode

It's not a "compatibility mode", it's the whole thing as it should. (I could also find a snippet of "FMOD::ChannelDSound" code going progressively though its EAX4, EAX3 and EAX2 versions but again I'm too dumb to understand more)

In this case the game should only detect a "Generic Software" device and wrap_oal should translate OpenAL calls to DirectSound (not DirectSound3D), but what happens?

The issue there isn't even "I have no multichannel audio" or "positioning sucks", it's literally "I have stuttering". Which definitively cannot happen due to too low resources.. So it could only be some stupid random bug that then disappears.

... interestingly enough a guy reported just copying the vanilla openal32 into the game folder would be enough to call it a day. This is compatible with the buggy native implementation hypothesis, since the position of the router dll influences device selection (a bit like I noted here, but with the opposite silver lining that has ending up with generic software as a positive)

didn't adjust the sound volume properly, causing audio clipping (this can be easily noticed in Doom 3). The solution is to have to adjust the volume in the game menu

Considering all the atrocious discussions we had on it.. It doesn't seem so simple really (btw there's a guy claiming the fix that was committed last year should be reverted if you still have this pet peeve)

Kappa971 commented 3 months ago

Considering all the atrocious discussions we had on it.. It doesn't seem so simple really (btw there's a guy claiming the fix that was committed last year should be reverted if you still have this pet peeve)

Yes the issue with Doom 3 was much more complex but I was just referring to the way you can hear audio clipping with the default game audio settings and EAX enabled on X-Fi. Doom 3 behaves strangely when you reduce the volume in game menu: the difference in volume between ambient sound and weapons changes, the volume of weapons doesn't seem to reduce to the same extent as ambient sound and dialogue. It seems that the game reads a file to establish the volume of the various sound sources, but at 0 db (the default setting) the volume levels don't respect this file (the funny thing is that the volume is more balanced this way but there is audio clipping with EAX). The fix allow the game to lower the volume normally and maintaining the "balance" that occurs when the volume is set to 0 db. I don't know what the problem is with this fix and why it was removed. There is a patch for the original game but regarding all this, I'll stop here.

ThreeDeeJay commented 2 months ago

So what then? It's stupid. If really you cannot get the game to pickup the device you want, you should just rename soft_oal to it if any.

@mirh The point in my example isn't just about forcing the OpenAL Soft library/device, but more importantly, bypass the built-in HRTF and spatialize objects instead of channels, which is what happens when just renaming soft_oal to OpenAL32.dll I know in most games, the longer OAL>DS3D>OALS route is likely redundant and useless, but I'm just saying there are cases where it does work better than OAL>OALS

And that used openal?

Apparently yeah, at least as a fallback When using wrap_oal, it generates a DSOAL log that shows Buffer3D and EAX 2/3 calls and even 4.0 support query. Otherwise, there are no Buffer3D or EAX calls.

In 2018 dsoal's eax and oal-soft's eax were separate (in fact as we know dsoal was very much the potpourri of regressions and fixes in those days)

JC still needs the OAL-DS3D wrapper even in the latest builds so either it hasn't been fixed or that was never the issue.

That's still all within FMODAudio.FMODAudioSubsystem, it doesn't have to use the ALAudio.ALAudioSubsystem that you are thinking [...]https://youtu.be/COyS0yDuzGg Literally this

My FMOD video used DirectSound3D, not OpenAL, so I don't really think it's the same, unless FMODAudioSubsystem in Bioshock can still be forced to use DS3D natively for audio mixing, as opposed to e.g. Source engine, which can use DirectSound3D but only to use objects as virtual speakers to virtualize the surround mix.

it's a mystery what happens if you only use wrap_oal as noted on PCGamingWiki. In this case the game should only detect a "Generic Software" device and wrap_oal should translate OpenAL calls to DirectSound (not DirectSound3D), but what happens?

@Kappa971 When the game doesn't find any OpenAL libraries (which seems common since apparently it doesn't ship OpenAL redist even on Steam), sounds will be missing (besides menu BGM which always uses DirectSound) Adding wrap_oal.dll as-is to the game folder or SysWOW64 will do nothing because it needs to enumerate libraries via the router (OpenAL32.dll). So adding that (or renaming wrap_oal.dll to force it) will allow the game to use "Generic Software" which fixes sounds and makes EAX (up to 2.0 only?) selectable... as long as you use Windows XP compatibility though I just found out that's just to make the game detect EAX capability, but we can instead just set/add this in %APPDATA%\Bioshock\Bioshock.ini

[ShockGame.ShockUserSettings]
bEAXEnabled=True

With a wrapper like DSOAL, there will also be an emulated "Generic Hardware" which supports up to EAX 4.0, so I wonder if there'd be any benefits if DSOAL supported EAX 5.0 from OpenAL Soft. ๐Ÿค”

Anyhow, the EAX option (which tbf is "audio" not "reverb") doesn't seem to be reverb-related but instead it just seems to force DirectSound (when set to OFF, which explains why HRTF isn't applied despite being explicitly enabled in alsoft.ini) or OpenAL (ON) for output (not mixing, which is handled by FMOD), while the Reverb option is what actually toggles reverb (noticeable when pausing right after loud sounds in certain areas) even when there are no oal libraries found or setting reverb boost=-12 in alsoft.ini. Though when using the OAL>DS3D wrapper + DSOAL, I noticed EAX calls in the log regardless of the EAX and reverb settings being enabled/audible or not.

So I wonder if the EAX option was just a half-assed afterthought, added just for the marketing buzzword, which would explain why they did away with it in the remaster. Or were there actual, proven benefits from this particular EAX implementation back then or even now? Either way, I still think the best method is still just adding soft_oal.dll as OpenAL32.dll to virtualize the 7.1 mode and running as WinXP compat for EAX (or forcing it via config, or oddly enough, enabling at least one Recording device) in case that's even useful.

mirh commented 2 months ago

bypass the built-in HRTF and spatialize objects instead of channels, which is what happens when just renaming soft_oal to OpenAL32.dll

It would seem strange for openal-soft to be bugged? Or now that I think to it.. Did the game even expect the api to be used in the first place? Because I don't see them redistributing (nor shipping) any sort of dll, so maybe it's just that they used gamecoda as a convenient glue for not having to bother with console audio.

Apparently yeah, at least as a fallback

I'm not sure why you are surprised of the usual progression of first checking the local folder for dlls to load, before the system ones.

When using wrap_oal, it generates a DSOAL log that shows Buffer3D and EAX 2/3 calls and even 4.0 support query. Otherwise, there are no Buffer3D or EAX calls.

You mean with openal? That really seems like the api would be a second class citizen. Maybe with just cause's development having started in 2003, gamecoda wasn't really up to par with it (assuming sensaura ever actually got to update it). Not that the first openal games (UT2003 and SWJK2) weren't even older, but baby Avalanche Studios certainly wasn't Epic or Raven.

Or maybe there's some fancy pants "smart selection" logic that breaks completely apart for some ungodly reason (I'll once again remind everyone that before 2005-2006 ct_oal didn't exist, and openal just opened DirectSound3D)

My FMOD video used DirectSound3D, not OpenAL

I'm talking about bioshock. What else did you mean with changing the audio system, if not trying to tinkering with the AudioDevice value inside the ini? A bit like that failed mass effect 2 video.

forced to use DS3D natively for audio mixing, as opposed to e.g. Source engine, which can use DirectSound3D but only to use objects as virtual speakers to virtualize the surround mix.

Oh, that's what you meant. I don't really know if FMOD couldn't have some hackable way to toggle it (it doesn't seem that impossible, considering everything and the kitchen sink seems compiled in as I said above) but it would seem pretty strange if they specifically added this output with creative's blessing and naming.. only to cut them out?

When the game doesn't find any OpenAL libraries, sounds will be missing (besides menu BGM which always uses DirectSound)

While admittedly I still haven't figured this out, I'm pretty skeptical that would be the case. Like, a) you don't ship an AAA game with broken audio on a fresh windows installation b) everybody and their aunt would have had the problem on release day then.

FMOD in particular certainly couldn't have been so dumb.

will allow the game to use "Generic Software" which fixes sounds and makes EAX (up to 2.0 only?) selectable

Putting aside that as I said, many games have logic to specifically single out "generic" renderers (including this one, even though I couldn't understand what they do with it)

With a wrapper like DSOAL, there will also be an emulated "Generic Hardware" which supports up to EAX 4.0, so I wonder if there'd be any benefits if DSOAL supported EAX 5.0 from OpenAL Soft.

It's doubtful if directsound ever had EAX5, and at least the directsound code that I have seen in the game didn't have such calls.

it just seems to force DirectSound (when set to OFF, which explains why HRTF isn't applied despite being explicitly enabled in alsoft.ini) or OpenAL (ON) for output (not mixing, which is handled by FMOD)

Literally what they said in the interview. Though now what I check some whatever old changelog, indeed it seems like FMOD_OUTPUTTYPE_OPENAL only happened after the internal mixing, and it was good at most for letting the sound card handle 3d virtualization. Meanwhile directsound (when coupled with FMOD_HARDWARE at least) really seemed limitless.

Too bad I couldn't get a hold of the old 4.0x documentation (especially considering it seems like that between versions 4.04 and 4.07 they went through two different openal codebases)

added just for the marketing buzzword, which would explain why they did away with it in the remaster.

Everything from creative was a marketing buzzword, so.. yeah? But really you shouldn't read too much into tea leaves. The lazy developers at bioware couldn't even understand that in their remastered 2021 game they needed a fucking openal driver in order to have surround sound.

or oddly enough, enabling at least one Recording device

Uhm.. Now that I check, FMOD 4.07.21 (released on 20/08/07) "fixed a problem with Vista WASAPI output mode" that reported "an error when no default input device is detected".

ThreeDeeJay commented 2 months ago

It would seem strange for openal-soft to be bugged? Or now that I think to it.. Did the game even expect the api to be used in the first place? Because I don't see them redistributing (nor shipping) any sort of dll, so maybe it's just that they used gamecoda as a convenient glue for not having to bother with console audio.

@mirh I don't recall reading about the game supporting OpenAL/EAX but I think we were just discussing about gameCODA's theoretical OpenAL support and after seeing mentions in the DRM-free executable, I decided to give it a shot and to my surprise, even EAX seemed to work. I just double-checked and reverse-y=true (actually needed by the game) doesn't work when soft_oal.dll is used as OpenAL32.dll which I guess means the game's mixer is the one still handling the lmix so I think this might just be a quirk of the game's audio engine and there may not be anything OpenAL Soft can do about it, other than just add wrap_oal and DSOAL to the mix.

I'm talking about bioshock. What else did you mean with changing the audio system, if not trying to tinkering with the AudioDevice value inside the ini?

Ah, so I guess you meant FMOD_OUTPUTTYPE_OPENAL as opposed to ALAudio.ALAudioSubsystem Speaking of, I tried downgrading the remaster's fmodex.dll to a version before 4.33 (where they removed FMOD_OUTPUTTYPE_OPENAL but it crashed on startup with an error. I'm not sure

I don't really know if FMOD couldn't have some hackable way to toggle it (it doesn't seem that impossible, considering everything and the kitchen sink seems compiled in as I said above) but it would seem pretty strange if they specifically added this output with creative's blessing and naming.. only to cut them out?

But then again, they did cut out EAX in the remaster, which annoyed some people. Also, I someone managed to hex edit a DLL to force a specific API, though I think it was just the equivalent to AudioDevice but I wonder if that could be done for other games that use older FMOD with OpenAL/DirectSound3D support available but not used. FMOD 3.75 SDK includes an almost identical demo to the one in my FMOD video, and it detects "hardware" support with DSOAL.

While admittedly I still haven't figured this out, I'm pretty skeptical that would be the case. Like, a) you don't ship an AAA game with broken audio on a fresh windows installation b) everybody and their aunt would have had the problem on release day then.

FMOD in particular certainly couldn't have been so dumb.

I mean... At least on modern Windows, if there are no OpenAL libraries found and either the game isn't run as XP or no enabled recording devices, most sounds will likely be missing. I remember running into something like that myself back in the day but I think it was sample-rate related so there's even more causes for missing audio. I think the lucky ones just happened to have OpenAL installed by another game, Steam, Windows Update or whatever cuz let's be real, since when has game audio not been half-assed?

Putting aside that as I said, many games have logic to specifically single out "generic" renderers (including this one, even though I couldn't understand what they do with it)

Perhaps that's really what fixed Just Cause? I'd assume it would be odd for an OpenAL game to expect a Generic Software or Generic Hardware device, but I wonder if that would allow OpenAL Soft to work directly instead of relying on wrap_oal+DSOAL @kcat Where is the OpenAL Soft device name string used for enumeration? I wanna try changing it to the Generic... ones to see if that does the trick.

It's doubtful if directsound ever had EAX5, and at least the directsound code that I have seen in the game didn't have such calls.

Yeah I'm not aware of any native DS3D game with EAX 5.0 either, but I do know of a handful of OpenAL games with EAX 5.0 that use wrap_oal.dll so I wonder if there's any feature loss during API call translation to DS3D and if there's any way to test. Perhaps @kcat knows ๐Ÿ‘€

Kappa971 commented 2 months ago

So... Has anyone here tested BioShock with OpenAL Soft? Are there any bugs or issues besides having to run the game "as administrator"? If the game runs well, I think we can close this issue and edit the tips in PCGamingWiki. What do you think?

ThreeDeeJay commented 2 months ago

I still think the best method is still just adding soft_oal.dll as OpenAL32.dll to virtualize the 7.1 mode and running as WinXP compat for EAX (or forcing it via config, or oddly enough, enabling at least one Recording device) in case that's even useful.

@Kappa971 I think this is our best option for Bioshock atm, but I only tested the first level. Someone would need to play through the full game to see if there are issues or a better method. In my playthrough over a decade ago, I just used an X-Fi with CMSS-3D add IIRC everything seemed to work fine but tbh I was playing more attention to the HRTF than the reverb.

Kappa971 commented 2 months ago

@Kappa971 I think this is our best option for Bioshock atm, but I only tested the first level. Someone would need to play through the full game to see if there are issues or a better method. In my playthrough over a decade ago, I just used an X-Fi with CMSS-3D add IIRC everything seemed to work fine but tbh I was playing more attention to the HRTF than the reverb.

I played BioShock a year ago with an X-Fi Titanium HD (and CMSS-3D but on stereo speakers, it still does something), Windows 11 and official drivers and I had no major issues (one BSOD, but I wouldn't be surprised if that happened in 2007 too). If I remember correctly the reverb is present in some places, they didn't abuse it like in Doom 3 (and the volume is finely tuned, no audio clipping with the default audio settings). I've never tried it with OpenAL Soft, maybe @kcajjones can tell us when he finishes playing the game. For example I tried, I think 2 years ago, OpenAL Soft with Prey (2006) and it had problems, the audio seemed muffled (I don't know how it behaves now), so we need to be 100% sure that OpenAL Soft works well with BioShock before recommending it.

mirh commented 2 months ago

about gameCODA's theoretical OpenAL support and after seeing mentions in the DRM-free executable,

Sigh.. This sent me on a rabbit hold and I just figured half of what hypothesized the old openal 1.0 times to be kinda wrong. https://web.archive.org/web/20050623074049/http://opensource.creative.com/pipermail/openal.mbox/openal.mbox https://web.archive.org/web/20050623084802/http://opensource.creative.com/pipermail/openal-devel.mbox/openal-devel.mbox

Once upon a time, there only existed OpenAL32.dll (which everybody on the system just replaced with whatever single one they wanted). Then the router was created in late 2003. Both creative's and nvidia's native dlls were already a thing (just as the wrapper, something I should have already knew if I remembered changelogs), even though only the gods know where they used to ship.

At the same time (or at least, until that time plus some) alcOpenDevice("DirectSound3D") was the actually somehow recommended way to initialize the thing, because. The router then eventually having to kinda shim that, as openal-soft also had to figure out for itself ....

I decided to give it a shot and to my surprise, even EAX seemed to work.

Look, I'll make this quick with what I just found in ghidra (also thanks to ReLOADeD for the exe unpacking work):

if (alIsExtensionPresent("EAX3.0")){
    iVar3 = _strncmp(?alGetString?,"Creative",8);
    if (iVar3 == 0) {
      return 1;
    }
}
return 0;

I could also find specific checks about the OpenAL32 and wrap_oal dlls, but the "audio load" function is far more complex to "decode" than just the one specific to check for EAX3 (so I'll just recommend you to experiment with dlls locations if the first try isn't enough)

which I guess means the game's mixer is the one still handling the lmix so I think this might just be a quirk of the game's audio engine and there may not be anything OpenAL Soft can do about it

~~https://web.archive.org/web/20060221080621/http:/www.gamecoda.com/documents/IntroductoryFAQ.pdf#page=9 I'm gonna go out on another huge limb, but it seems that the openal layer required like a pre-existing openal application to begin with (openal --> gamecoda --> different platforms)? Whereas they may have just directly targeted the gamecoda high-level api, which on windows primarily relied on directsound? Even though this doesn't explain why openal is also a backend they expose externally (supposedly they never even supported linux or osx).~~

Okay, I'm pretty fucking depressed and tired by now.. have a nice day (I'd be curious to know how other games behave though)


Ah, so I guess you meant FMOD_OUTPUTTYPE_OPENAL as opposed to ALAudio.ALAudioSubsystem

As I already said, it's called FMODAudio.FMODAudioSubsystem inside of bioshock's ini. I don't know what's so hard about it.

Speaking of, I tried downgrading the remaster's fmodex.dll to a version before 4.33 but it crashed on startup with an error.

I mean, of course if it was compiled against library version X, a way older version would miss a lot of the symbols it expects. I suppose nothing is unfixable with the right expertise then, but out of the box I'm doubtful even the opposite (upgrading old to new) could be a cakewalk.

But then again, they did cut out EAX in the remaster, which annoyed some people.

Again what? The remaster was released in 2016. Absolutely no shit they dropped it, considering they probably couldn't even test it. Good for them then, if they even upgraded fmod and properly adjusted sounds (unlike with mass effect where AFAIU they retweaked some sounds to be more attuned with "generic software")

someone managed to hex edit a DLL to force a specific API, though I think it was just the equivalent to AudioDevice

No? Like, I'll grant I know nothing about Gothic but that's obviously just toggling the output inside of FMOD. In this sense it's equivalent to the (again, admittedly very poorly named) "use creative eax audio" option.

FMOD 3.75 SDK includes an almost identical demo to the one in my FMOD video, and it detects "hardware" support with DSOAL.

Of course? What else could they have used in 2005 to get the best audio (or well, even surround at all) in windows?

I mean...

You can already tell from the thumbnails that's all "modern" problems. Back in the day if any, I believe the problem people used to have more was stuttering and whatnot.

or no enabled recording devices

Remind me again how people can not have at least a single input device? Or is the actual requirement that it must be currently connected?

I think the lucky ones just happened to have OpenAL installed by another game, Steam, Windows Update or whatever cuz let's be real, since when has game audio not been half-assed?

When it stopped to rely on specific hardware (and hence driver) behaviour ๐Ÿต

I'd assume it would be odd for an OpenAL game to expect a Generic Software or Generic Hardware device, but I wonder if that would allow OpenAL Soft to work directly instead of relying on wrap_oal+DSOAL

Ehrm.. When I said "single out" what I meant was blacklists primarily. I know STALKER outright flips the bird to generic hardware, and even the openal router isn't super lovely about it. Even though, I believe that code only exist to allow graceful downgrade once hardware directsound hasn't been found, and it has in turn dedicated code to help its matching.

It's intriguing to note that while oal-soft does custom matching for "DirectSound3D" as I said above, it cares absolutely nothing about the Generics instead.

Where is the OpenAL Soft device name string used for enumeration? I wanna try changing it to the Generic... ones to see if that does the trick.

Only "Generic Software" exists once in the executable.. so to be sure whatever they do with I don't expect it to be anything "high-end". Also that sounds a lot like my headbanging I did in #757 (that sure is unfortunate, now made even more possibly insane from the likely implications of the gamecoda code)

but I do know of a handful of OpenAL games with EAX 5.0 that use wrap_oal.dll

Uhm.. Like every single one of them, duh? How else could they have even supported audio on a normal pc?

Are there any bugs or issues besides having to run the game "as administrator"?

I'm pretty sure we just pinned down the audio problem to having (some degree of) at least one enabled recording device if reporting Vista+. Do you have different evidence?

ThreeDeeJay commented 2 months ago

CMSS-3D but on stereo speakers, it still does something

@Kappa971 Yeah, I think it uses crosstalk cancellation for HRTF when set to Speaker (as opposed to headphones) which is was surprisingly decent last I checked

reverb is present in some places

But the real question is: what exactly is applying reverb? Reverb works without the EAX option or even any OpenAL library installed/found, so I think OpenAL isn't actually used for reverb like I had read/said initially, but just for output which would I guess be useful for surround virtualization if it was enabled/supported by the library.

And if reverb was applied by FMOD, how come it was removed in the Remaster after upgrading to FMODEx? Given how they removed the functionality while keeping a useless audio setting in the GUI, it's hard not to assume negligence or worse.

Hell, I couldn't even use DSOAL/OpenAL Soft to force a permanent reverb preset because apparently it's using WASAPI or something. I guess an alternative would be a system-wide effect like the EAX Reverb VST in EqualizerAPO. That wouldn't be that much different from the original audio, especially if they were lazy enough to use a single reverb preset everywhere (tho tbf at least it was turned off/attenuated in some areas).

I could also find specific checks about the OpenAL32 and wrap_oal dlls, but the "audio load" function is far more complex to "decode" than just the one specific to check for EAX3 (so I'll just recommend you to experiment with dlls locations if the first try isn't enough)

@mirh So it only enables EAX 3.0 when it finds a device containing the string "Creative"? also I don't know what you mean by experimenting with dlls locations

I'd be curious to know how other games behave though

Apparently there's also Men of Valor, Duke Nukem Forever and "Team Fortress 2 with dsp_facingaway", but I'm yet to test/confirm them.

Again what? The remaster was released in 2016. Absolutely no shit they dropped it, considering they probably couldn't even test it. Good for them then, if they even upgraded fmod and properly adjusted sounds

The amount of OpenAL games has only increased since 2016, so it's not like we're talking about DirectSound3D with premium sound cards. I doubt they wanted to drop "EAX"/OpenAL, but I don't think they had a choice since the move to FMODEx meant no more OpenAL. Alternatively, perhaps they could've replaced FMOD with the ALAudio subsystem for actual EAX and fixed that, but that's a tall order for devs who even forgot to include the redist back when it did use OpenAL and in the remaster kept a placebo Reverb setting lmao.

No? Like, I'll grant I know nothing about Gothic but that's obviously just toggling the output inside of FMOD. In this sense it's equivalent to the (again, admittedly very poorly named) "use creative eax audio" option.

Yeah, you're right AudioDevice isn't the right analogy, I just meant forcing FMOD's OpenAL mode as I clarified later

Of course? What else could they have used in 2005 to get the best audio (or well, even surround at all) in windows?

The point was that games that used old FMOD (pre-Ex) maybe could be hacked to force native DS3D/OpenAL

You can already tell from the thumbnails that's all "modern" problems. Back in the day if any, I believe the problem people used to have more was stuttering and whatnot.

I've found a bunch of reports like these of missing audio even on Vista (which had been out for about half a year by the time the game released) but tbf most people were still on XP where missing audio might not has been as common because even back then they recommended running with XP compat and enabling a recording device.

Remind me again how people can not have at least a single input device? Or is the actual requirement that it must be currently connected?

IME I just disable them so they're not mixed into gameplay recordings, which ShadowPlay likes to do by default. idk about others And yeah, the input device has to also be plugged in. Otherwise this will result in no audio even if it's enabled, so that's a good thing to point out.

Ehrm.. When I said "single out" what I meant was blacklists primarily.

Then it's gotta be something else because obviously Just Cause only sees the 2 Generic devices and it still works.

Uhm.. Like every single one of them, duh? How else could they have even supported audio on a normal pc?

Even more reason to find out whether EAX 5.0 features could be salvaged from wrap_oal or if they were just discarded, in case other games also have better results via wrap_oal+DSOAL as opposed to using soft_oal directly ๐Ÿค” And are some of those features already made possible on OpenAL Soft's end? Like is this just a (better?) equivalent to 128 simultaneous voices processable in hardware and up to 4 effects on each?

mirh commented 2 months ago

Reverb works without the EAX option or even any OpenAL library installed/found,

It wouldn't be the first time software reverb (perhaps based on I3DL2) tries to straight up replicate EAX.

Hell, I couldn't even use DSOAL/OpenAL Soft to force a permanent reverb preset because apparently it's using WASAPI or something.

Of course it does, no sense in using anything else. If any I wonder if you couldn't trick it with XP compatibility?

So it only enables EAX 3.0 when it finds a device containing the string "Creative"?

My timid understanding is actually that strncmp starts from the beginning of the string (and it probably is case-sensitive too). It's very baffling though, considering even soundblasters doesn't seem to have had all that much name consistency.

also I don't know what you mean by experimenting with dlls locations

The game folder and system folder (both with the normal router, and with direct openal-soft forcing)

Apparently there's also Men of Valor, Duke Nukem Forever and "Team Fortress 2 with dsp_facingaway"

?? I meant other gamecoda games..


The amount of OpenAL games has only increased since 2016, so it's not like we're talking about DirectSound3D with premium sound cards.

OpenAL on premium cards X-Fis is also kinda busted since about a decade or so. Now, admittedly they could just have used openal-soft.. And between fmod 4.13 (when the 64 bit version supported openal) and 4.33 (when openal was removed) they could have just settled with that, but I'm gonna bet they had a far nicer time shipping to eighth generation consoles with 4.44.53. And at least EAX itself had to go out regardless, isn't it?

(I really couldn't have expected any OAL surge then, but I'm skeptical more than a handful of them did actually dirtied their hands with the api as opposed to just going along with whatever their simple game engine used out of the box).

Alternatively, perhaps they could've replaced FMOD with the ALAudio subsystem for actual EAX and fixed that

No they couldn't (and I'm not sure what an .ini with probably the default UE2 settings could say) As you said, you need FMOD to handle the (duh) FMOD banks and sounds - and even though I believe they are still running some kind of hodgepodge UE2.5 build (ghidra couldn't help me the slightest here) I'm kinda salty about vanilla ALAudio <UE3 audio after yesterday.

The point was that games that used old FMOD (pre-Ex) maybe could be hacked to force native DS3D/OpenAL

And I'm saying that in 2005 you don't have no need of hacks, because clearly that was the only api available. At most whether FMOD_HARDWARE was used or required is up in the air, but I don't see why that shouldn't have been the case at a time when cpu time was spare and everybody just assumed plain 2D stereo otherwise.

And yeah, the input device has to also be plugged in. Otherwise this will result in no audio even if it's enabled, so that's a good thing to point out.

I see then - so that really cracks the mystery, isn't it?

Even more reason to find out whether EAX 5.0 features could be salvaged from wrap_oal or if they were just discarded

?? No, I'm saying: every single one of the EAX 5 games of course had to came with wrap_oal (or at least something equivalent, BF2 development predated openal 1.1 but they still have two dlls). Otherwise they couldn't have had audio.

And are some of those features already made possible on OpenAL Soft's end?

Yes of course? It has eax5 support. The only things I couldn't match with a quick ctrl+f are "voice" (which is a microphone thing that from whatever eax4 game applied the in-use EAX reverb profile to your voice), FlexiFX (which is kind of a mashup of previous features?) and "PurePath" (which just means "send the audio to just one speaker")

Like is this just a (better?) equivalent to 128 simultaneous voices processable in hardware and up to 4 effects on each?

https://github.com/kcat/openal-soft/issues/791 https://github.com/kcat/dsoal/issues/53#issuecomment-1151077091

ThreeDeeJay commented 2 months ago

If any I wonder if you couldn't trick it with XP compatibility?

@mirh That's a no-go BioshockHD_0qhymWz6tZ

?? I meant other gamecoda games..

mrpenguinb told me about these games, which contain all of these strings in the exe like JC: GameCODA,Creative,EAX3.0,DirectSound3D,/wrap_oal.dll and /OpenAL32.dll:

There's also a couple ones mentioned in the DS3D games list

Also, I just found the SDK and this:

How is GameCODA compatible with OpenAL? An API layer is provided which allows applications written using OpenAL together with the EAX reverb extensions to run on game consoles as well as the PC. This is the first time that such comprehensive OpenAL support has been available on the three console platforms.

I currently use EAX reverb. Can I do the same with GameCODA? GameCODAโ€™s reverb engine implements a superset of the I3DL2 (i.e. essentially the same as the EAX 3.0) standard. The superset functions include support for exclusion and echo, modulation and panning effects. On a Creative Sound Blaster Audigy, the reverb API is mapped directly to the EAX 3.0 (and greater) API for hardware accelerated reverb.

As you said, you need FMOD to handle the (duh) FMOD banks and sounds

By fixing ALAudio, I meant actually porting soundbanks to generic WAVs or whatever OpenAL is compatible with, and I guess also porting reverb zones to EAX/EFX.

?? No, I'm saying: every single one of the EAX 5 games of course had to came with wrap_oal (or at least something equivalent, BF2 development predated openal 1.1 but they still have two dlls). Otherwise they couldn't have had audio.

Yes of course? It has eax5 support. The only things I couldn't match with a quick ctrl+f are "voice" (which is a microphone thing that from whatever eax4 game applied the in-use EAX reverb profile to your voice), FlexiFX (which is kind of a mashup of previous features?) and "PurePath" (which just means "send the audio to just one speaker")

https://github.com/kcat/openal-soft/issues/791 https://github.com/kcat/dsoal/issues/53#issuecomment-1151077091

I was asking about the presence of those EAX 5.0 features specifically when using wrap_oal.dll and DSOAL, not OpenAL Soft directly, in case we do happen to get better results with the former like the examples above or other games that perhaps rely on/are fooled by Creative's wrapper to expose certain features.

On a similar note, I wonder why many games (even native DS3D) query for high EAX versions like EAX 3/4, but fallback to EAX 2. I might have to gather more details and instances where it happens and submit a new issue ๐Ÿค”

kcat commented 2 months ago

By fixing ALAudio, I meant actually porting soundbanks to generic WAVs or whatever OpenAL is compatible with, and I guess also porting reverb zones to EAX/EFX.

OpenAL isn't "compatible" with WAVs or any other file format. The file is loaded by the app, using whatever audio loading library or routines it has, and passes the samples to OpenAL. Similar for files defining reverb zones, it's up to the app to load them and supply the appropriate data to OpenAL from them. OpenAL is just as compatible with FMOD soundbanks and the like, in the end it's all up to the app to load the files and give OpenAL the data it needs from them (you're just more likely to find libraries or existing code to load and decode wav, ogg, mp3, flac, etc, than an FMOD soundbank loader (that isn't FMOD itself)).

I'm also not sure converting FMOD soundbanks would be that easy. As the name suggests, soundbanks contain a bank of sounds -- multiple sounds relevant to the object or scene it's associated with, possibly with metadata about how the sounds relate to each other -- not something that could be conveyed by standard wav, ogg, etc, files (at least not without special fields that a converter could put relevant information in, that the loader would read and handle as appropriate).

ThreeDeeJay commented 2 months ago

@kcat I see, so IIUC this is ALAudio's limitation, not necessarily OpenAL's.

So to recap, and anyone feel free to correct me if I'm wrong, the problem is that even though Bioshock's FMOD Unreal Engine subsystem already can use OpenAL, it's only used for output (channel-based, not object-based) and I don't know how/if there's a way to force OAL (or DS3D, maybe on XP?) for mixing, especially without losing soundbank support.

So the only alternative I can think of is switching to ALAudio UE subsystem which does use OpenAL for mixing (object-based) but since that doesn't use FMOD or support its soundbanks, those would need to be converted to something else that ALAudio can read โ€”fsbext can extract Bioshock soundbanks (FSB3 (ADPCM))โ€” along with linked metadata, if any. Unless... @Smirftsch any idea if ALAudio could ever support FMOD soundbanks in Bioshock or in general? There's so many games that could finally get upgraded to 3D audio.

EAX reverb is on a similar boat since apparently (at least in Bioshock) it's done entirely in FMOD, not OpenAL as we previously thought, so reverb parameters would need to be ported/translated in ALAudio to something OpenAL can interpret.

But yeah, I'm not saying any of this would be easy. Just weighing theoretical routes the original devs (or competent programmers AKA not me lol) could take. I'm more than happy to test stuff tho ๐Ÿ‘€๐Ÿ‘Œ

Kappa971 commented 2 months ago

So to recap, and anyone feel free to correct me if I'm wrong, the problem is that even though Bioshock's FMOD Unreal Engine subsystem already can use OpenAL, it's only used for output (channel-based, not object-based) and I don't know how/if there's a way to force OAL (or DS3D, maybe on XP?) for mixing, especially without losing soundbank support.

EAX reverb is on a similar boat since apparently (at least in Bioshock) it's done entirely in FMOD, not OpenAL as we previously thought, so reverb parameters would need to be ported/translated in ALAudio to something OpenAL can interpret.

This doesn't make sense (or I'm confused): if FMOD takes care of everything (including reverb), what does the "Use Creative EAX" option do? It would also mean that what is written on this site is false, the game doesn't use EAX 5.0 or hardware acceleration or 3D Audio and that Creative scammed everyone.

So the only alternative I can think of is switching to ALAudio UE subsystem which does use OpenAL for mixing (object-based) but since that doesn't use FMOD or support its soundbanks, those would need to be converted to something else that ALAudio can read โ€”fsbext can extract Bioshock soundbanks (FSB3 (ADPCM))โ€” along with linked metadata, if any. Unless... @Smirftsch any idea if ALAudio could ever support FMOD soundbanks in Bioshock or in general? There's so many games that could finally get upgraded to 3D audio.

An advice would be to play the game and have fun without worrying too much at this point ๐Ÿ˜…

mirh commented 2 months ago

@mirh That's a no-go

Uhm.. we are talking about the original bioshock, yes? It makes zero sense that could not run on XP.

since using OpenAL Soft directly doesn't work either, just like JC

I.e. they have the blacklist that you can totally try to work around.

different gameCODA implementation called SenAudio.SenAudioSubsystem (SenAudio.dll) in Unreal engine which doesn't work with wrap_oal, but UseHardwareSound=1 supposedly allows DS3D

For the absolute love of me I couldn't find UseHardwareSound referenced anywhere, be it executable, libraries or unrealscript (though it must be said that UE extractor/explorer had just so many problems with decompilation). Regardless, the openal init function is the same of just cause. It's just that it misses the wrap_oal thingy. I suspect this may be because the game is 2 years older, hence gamecoda itself is older (somehow new enough that it still has the usual eax3 "creative" check, yet old enough that they ship OpenAL32.dll version 0.9.5.1).

My 2c would be that whatever the problem of openal-soft not engaging, is either the normal blacklist issue, or that it may expect whatever early openal 1.0 quirk (it's older than the first svn revision, even though SensAudio.dll does support ALC_ENUMERATION_EXT). But I might be wrong. Btw the opeanl32.dll wrapper's alExtensions list has been modified to report the string "EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3", and its alIsExtensionPresent function does some stupid loop I couldn't quite figure out where "EAX2.5" is mentioned. ๐Ÿ˜

Also, I just found the SDK and this:

That's what I had linked before realizing the hidden "Creative" check they implemented flips the bird to any documentation or theory. EDIT: oh, lmao... now that I think to it, the alVendor of the wrapper would in fact manage to pass that! So that's kinda it's entire super magic.


By fixing ALAudio, I meant actually porting soundbanks to generic WAVs or whatever OpenAL is compatible with

That sounds like a lot of work for nothing. I don't have ever developed a game, but I'm pretty sure every pro studio uses wwise or fmod or something along that because they have pretty nice dev environments/editors.

I was asking about the presence of those EAX 5.0 features specifically when using wrap_oal.dll and DSOAL

There is not much you can do with them if wrap_oal doesn't have such code to begin with, do you? To be 100% fair, they do seem to check its support and do *some little thing* with it. But I found some functions where all the others are set except it, and there seems to be pretty less instances of its GUIDs (even though, it's still a double digits amount). Perhaps that was just supposed to be some extra indirect hardware check/lock for their own cards? Or perhaps, who knows.. maybe if you QuerySupport the EAX50 context/source/slots they could return positively?

in case we do happen to get better results with the former like the examples above or other games that perhaps rely on/are fooled by Creative's wrapper to expose certain features.

Normally I'm of the school "we do what we do because we can", but I really don't want to partake in this sick game that could encourage people to do the stupid thing in other games too Unless we really demonstrated that some super dumb application has.. what? Two independent sound systems, with directsound actually mapped to openal concepts while somehow this takes the L? But at that point it seems sadism towards people, not really programming.

On a similar note, I wonder why many games (even native DS3D) query for high EAX versions like EAX 3/4, but fallback to EAX 2.

๐Ÿ™„๐Ÿ™„ you really seem to have some kinda of amnesia in this thread.. By no means I can claim this must always be the case, but I just told you a pretty obvious situation where this happens (certainly common for at least the majority of gamecoda games)

I'm also not sure converting FMOD soundbanks would be that easy.

FMOD should be slightly easier but still, for wwise I know it's almost rocket science. On the other hand, presumably the studios should still have the original sounds at hand.

This doesn't make sense (or I'm confused)

He's dreaming of some 300IQ hack for the game where you rewrite or reroute its audio engine. AFAIU this would be the only thing doable to have "best openal", because supposedly the game only implements it as an afterthought after its own sound mixing (directsound meanwhile wouldn't have this limitation, not sure if alone or when coupled with wrap_oal). That sounds so stupid, but alas I'm not the one testing the games so I cannot shoot the messenger.

ThreeDeeJay commented 2 months ago

This doesn't make sense (or I'm confused): if FMOD takes care of everything (including reverb), what does the "Use Creative EAX" option do? It would also mean that what is written on this site is false, the game doesn't use EAX 5.0 or hardware acceleration or 3D Audio and that Creative scammed everyone.

@Kappa971

"Use Creative EAX Audio" basically tells the game's audio system to use an OpenAL output. "Use Reverb" switches the reverb on and off. [...] On a Windows XP system, it will instead look for a DirectSound3D

That's literally just about it. OAL/DS3D for output (not mixing) so it just allows virtualizing surround but no actual EAX/3D audio IME. I'm yet to see evidence of that EAX setting actually having anything to do with audible reverb, despite boost and seeing EAX calls in the log. Same results with OpenAL Soft directly and even ALchemy.

DS3D mode (XP compat without OpenAL installed) is even worse: only virtualized stereo (even when set to 7.1) and still no audible EAX reverb so it's better to just use OpenAL Soft directly.

I'm this ๐Ÿค close to calling the whole EAX 5.0 "support" just another Creative/2K marketing scam but I don't wanna jump the gun just yet. I'll give them the benefit of the doubt at least until I test whether it works as it pretends to, in XP with an X-Fi.

An advice would be to play the game and have fun without worrying too much at this point ๐Ÿ˜…

I still stand by this:

Either way, I still think the best method is still just adding soft_oal.dll as OpenAL32.dll to virtualize the 7.1 mode and running as WinXP compat for EAX (or forcing it via config, or oddly enough, enabling at least one Recording device) in case that's even useful.

When in doubt, you can just search and check out the top BioShock config in the database. This configuration profile link will either be updated with the best known config or link to it if we ever find a different, better method.

mirh commented 2 months ago

That's literally just about it. OAL/DS3D for output (not mixing) so it just allows virtualizing surround ... DS3D mode (XP compat without OpenAL installed) is even worse

So, well, yeah.. we don't really have any game where ds3d is better than openal.

I'll give them the benefit of the doubt at least until I test whether it works as it pretends to, in XP with an X-Fi.

The X-Fi on Vista+ should be also fine with oal (though yeah, I wouldn't risk it).

Kappa971 commented 2 months ago

That's literally just about it. OAL/DS3D for output (not mixing) so it just allows virtualizing surround but no actual EAX/3D audio IME. I'm yet to see evidence of that EAX setting actually having anything to do with audible reverb, despite boost and seeing EAX calls in the log. Same results with OpenAL Soft directly and even ALchemy.

DS3D mode (XP compat without OpenAL installed) is even worse: only virtualized stereo (even when set to 7.1) and still no audible EAX reverb so it's better to just use OpenAL Soft directly.

I'm this ๐Ÿค close to calling the whole EAX 5.0 "support" just another Creative/2K marketing scam but I don't wanna jump the gun just yet. I'll give them the benefit of the doubt at least until I test whether it works as it pretends to, in XP with an X-Fi.

I'm the first to think that Creative isn't a very fair company towards its users, but I'm pretty skeptical about this BioShock thing. For example, I also remember that BSOD I had in BioShock caused by the X-Fi drivers... I've played with other OpenAL games and it never happened in any of them. This makes me think that BioShock is doing more with the hardware than using OpenAL only for output.

Also on the previous site: image image image

ThreeDeeJay commented 2 months ago

Uhm.. we are talking about the original bioshock, yes? It makes zero sense that could not run on XP.

@mirh Nope, I was still talking about the remaster. We already know the original works (and may even need) XP compat, but I just wanted to check if the remaster could get VSS via DLL drop-in instead of having to set up something like HeSuVi.

alVendor of the wrapper would in fact manage to pass that! So that's kinda it's entire super magic.

Wait, it actually works!! https://github.com/ThreeDeeJay/openal-soft/commit/dc150c8ce5f7eecd2a5adaa0caf158f5f6062b34 Just gotta rename soft_oal.dll to OpenAL32.dll so there's no need for DSOAL or wrap_oal in Just Cause๐Ÿ‘ Setting the Windows speaker config to 7.1 seems to cause missing sounds/crash (maybe gameCODA didn't support it so it gets confused?). MOV still refuses to load OpenAL regardless of UseHardwareSound and XP compat. mrpenguin tested it in Fable but it crashed in-game and we're trying to figure out why. Anyhow, I guess we might need a vendor string setting cuz I doubt it'd use Creative's by default.

That sounds like a lot of work for nothing. I don't have ever developed a game, but I'm pretty sure every pro studio uses wwise or fmod or something along that because they have pretty nice dev environments/editors.

Yeah, sadly the trend is switching from DS3D/OAL to FMOD like RBR RSF, Truck sims, BeamNG, etc., but the point would have been actually delivering the advertised EAX 5.0 and 3D audio. Obviously I don't expect that now, but we never know, the HLA mod (VR and Steam Audio 3D HRTF) would seem a lot more far-fetched on paper but it is a thing so it might just be a matter of skill and will.

Normally I'm of the school "we do what we do because we can", but I really don't want to partake in this sick game that could encourage people to do the stupid thing in other games too Unless we really demonstrated that some super dumb application has.. what? Two independent sound systems, with directsound actually mapped to openal concepts while somehow this takes the L? But at that point it seems sadism towards people, not really programming.

I wouldn't expect people to start throwing science at the wall to see what sticks either, unless there is a good reason for it. Cuz wouldn't you know it? We really did get results after such a long conversation (even if it was way off-topic lmao) tbh I usually despise adding wrappers and complexity, but what's an extra DLL, compared to a significantly worse experience and the time and effort we save people on misinformation? I'm obviously adding this to the database, which is designed to redirect people to the new method when they view the current one once it's added.

๐Ÿ™„๐Ÿ™„ you really seem to have some kinda of amnesia in this thread.. By no means I can claim this must always be the case, but I just told you a pretty obvious situation where this happens (certainly common for at least the majority of gamecoda games)

tbf it's hard to keep track with so many simultaneous convos (See: my first reply), but a quick search took me to they do seem to check its support and do *some little thing* which seemed about wrap_oal or EAX 5.0, which still doesn't explain why it also happens when just using DSOAL.

He's dreaming of some 300IQ hack for the game where you rewrite or reroute its audio engine. AFAIU this would be the only thing doable to have "best openal", because supposedly the game only implements it as an afterthought after its own sound mixing (directsound meanwhile wouldn't have this limitation, not sure if alone or when coupled with wrap_oal). That sounds so stupid, but alas I'm not the one testing the games so I cannot shoot the messenger.

I mean, Smirftsch's ALAudio literally replaces Galaxy soundsystem to use native OpenAL (Soft) EAX and 3D audio in a handful of UE games, so this isn't really a new concept, especially when those games might not even have a partial built-in ALAudio implementation like BS and other FMOD games.

I'm the first to think that Creative isn't a very fair company towards its users, but I'm pretty skeptical about this BioShock thing. For example, I also remember that BSOD I had in BioShock caused by the X-Fi drivers... I've played with other OpenAL games and it never happened in any of them. This makes me think that BioShock is doing more with the hardware than using OpenAL only for output. Also on the previous site: image image image

@Kappa971 I guess with ct_oal.dll there's always risk of BSOD since it's hardware but then again, I'm yet to see evidence of hardware mixing/rendering (with 3D HRTF and EAX reverb) like in proper DS3D/OAL games.

The closest I've found were X-Fi CA20K (no 3D HRTF, just virtualized stereo ๐Ÿคข) and X-Fi Fatal1ty on XP (no HRTF at all, maybe because they used Stereo mode) so you can see why I take marketing (especially Creative's) with a grain of salt.

Meanwhile, there's tons of footage of games with a proper/-ish OpenAL/EAX 5.0 implementation: Mass Effect/LE, Battlefield 2/Project Reality, UT 2004, UT3, Quake 4.

mirh commented 2 months ago

Just gotta rename soft_oal.dll to OpenAL32.dll so there's no need for DSOAL or wrap_oal in Just Cause๐Ÿ‘

Theoretically that should be new enough that it should be able to enumerate your dll, if you spoof your device and openal names to something containing the word "Audigy".

MOV still refuses to load OpenAL regardless of UseHardwareSound and XP compat.

That's super cursed (readme even mentions Audigys are broken, even though patch 1.2 mentioned that should be good again). I wonder if re-building the vanilla openal32 0.9.7.0 wrapper would have it working (i.e. then it's just some early beta openal 1.0 quirk that has been lost today) or if instead the Mark Zlamal's modifications aren't expecting something precise from the creative-tweaked dll.

Cuz wouldn't you know it? We really did get results after such a long conversation (even if it was way off-topic lmao)

Yes, but we got here exactly because I knew it couldn't be that way. Now take the random joe that hears dsoal supports eax5 so there's nothing to loose (be it as it may that wrap_oal even supported it, which as I said I couldn't exactly 100% rule out)

which seemed about wrap_oal or EAX 5.0, which still doesn't explain why it also happens when just using DSOAL.

The gamecoda thing? Because gamecoda evidently is openal native, so it loads the wrapper as its pseudo-driver. And that advertises its AL properties like so, no matter what the output devices are then.

I mean, Smirftsch's ALAudio literally replaces Galaxy soundsystem to use native OpenAL (Soft) EAX and 3D audio in a handful of UE games

Fair-ish enough, but it's one thing to replace a sort of plugin that has specifically been compartmentalized in the game with just a few interfaces and whatnot.. And then there's ripping out not just the audio 3D processing but even just the logic that probably was used to load sounds and whatever else. Like.. Isn't fmodex like 10 times as big as alaudio?

ThreeDeeJay commented 2 months ago

if you spoof your device and openal names to something containing the word "Audigy".

@mirh Like this? https://github.com/ThreeDeeJay/openal-soft/commit/3e9217f237ead4b22bddba60bb98dee5cb177a89 (ignore the extra quotes). I thought setting the vendor to Creative was enough, though I don't know how to check if the game's actually making EAX (3.0) calls like when using the wrap_oal+DSOAL. I didn't notice any difference even with boost=12 even in indoor areas using either soft_oal/wrap_oal

That's super cursed (readme even mentions Audigys are broken, even though patch 1.2 mentioned that should be good again). I wonder if re-building the vanilla openal32 0.9.7.0 wrapper would have it working (i.e. then it's just some early beta openal 1.0 quirk that has been lost today) or if instead the Mark Zlamal's modifications aren't expecting something precise from the creative-tweaked dll.

No luck with 0.x/1.x DLLs I found online. Only when switching SenAudio to ALAudio does it load OpenAL32.dll (but just like Bioshock, everything besides DirectSound stuff like some BGM/FMV is silent)

Yes, but we got here exactly because I knew it couldn't be that way. Now take the random joe that hears dsoal supports eax5 so there's nothing to loose (be it as it may that wrap_oal even supported it, which as I said I couldn't exactly 100% rule out)

I mean, IME both methods seem audibly indistinguishable and only with the "stupid" method do we know there's some EAX 3 activity (or at least attempt) going on, though maybe it's just some seemingly empty calls like in Bioshock. And yeah, DSOAL with EAX5 doesn't make sense atm, though I wonder if OpenAL EAX 5.0>wrap_oal>DS3D>ALchemy>Native renderer>log could provide some clues of what it's doing with EAX5 calls ๐Ÿค”

The gamecoda thing? Because gamecoda evidently is openal native, so it loads the wrapper as its pseudo-driver. And that advertises its AL properties like so, no matter what the output devices are then.

Again, that still doesn't explain why it happens in some native DirectSound3D games. Like, RightMark 3D sound reports EAX4 usage, but Tomb Raider Angel of Darkness only queries it but then it falls back to EAX3 even though the game explicitly supports EAX 4.0. I was starting to suspect it was related to EAX Unified (eax.dll, required for EAX) but GTA San Andreas uses it and still reports EAX4 usage. So I don't know what's going on. Adding eax.dll 4.x to games like Prince of Persia The Two Thrones using 3.x only checks for EAX4 then falls back to EAX3, which makes sense because tbh I wouldn't expect the new dll to magically add EAX4 features.

mirh commented 2 months ago

Like this? https://github.com/ThreeDeeJay/openal-soft/commit/3e9217f237ead4b22bddba60bb98dee5cb177a89 (ignore the extra quotes). I thought setting the vendor to Creative was enough

Yes, the last thing is enough to have the game accept openal-soft when you force it by replacing the dll. I was saying what you need to not have to replace it. And that's good but last but not least you should also change the name of the sound device in windows accordingly.

No luck with 0.x/1.x DLLs I found online. Only when switching SenAudio to ALAudio does it load OpenAL32.dll

Oooh, lmao? Well, yeah. If it doesn't even attempt to load the default one (check in procmon) then I guess that was a red herring. Maybe it was just a file included with whatever UE2 build they used (and that could also explain why it's so awfully old).

(but just like Bioshock, everything besides DirectSound stuff like some BGM/FMV is silent)

Of course when the soundbanks are all specific to coda.

Again, that still doesn't explain why it happens in some native DirectSound3D games.

It should not explain that? As you said, they are directsound games. Completely different set of rules. Even though now that you mention these.. Yeah, I'm kinda wondering if they couldn't have some other BS creative lock.

Btw hope you are using the full ass installer for eax unified because otherwise you aren't getting its CLSID installed.

ThreeDeeJay commented 2 months ago

Yes, the last thing is enough to have the game accept openal-soft when you force it by replacing the dll

But it's already accepting OpenAL Soft (with just Creative vendor) when I replace OpenAL32.dll EAX "support" seems the same too, or is the "Audigy" string for a specific game other than gameCODA/Just Cause? Btw I just noticed something odd: When loading the DLL from the system folder, it keeps using the built-in HRTF instead of OpenAL Soft's (log reports Opening default playback device) while it works when the DLL is in the game folder (logs Opening playback device "DirectSound3D") so I guess the game/gameCODA's hardcoded the path bypasses the usual enumeration?

ALCapsViewer32_XlecqcTBgF

If it doesn't even attempt to load the default one (check in procmon) then I guess that was a red herring.

Yeah, I doubt MOV's built-in OpenAL32.dll is anything more than a leftover from the unused ALAudio device It's like the opposite of Bioshock which actually needed it but didn't have it lmao, though after finding out it falls back to DS3D I do now realize why XP may not have been as plagued with problems as I initially though.

Also no mentions of OpenAL in procmon even with the DLL using Creative's vendor and Audigy device name.

It should not explain that? As you said, they are directsound games. Completely different set of rules.

Hence the question.

Btw hope you are using the full ass installer for eax unified because otherwise you aren't getting its CLSID installed.

Yeah, tho I often also update its eax.dll from the installer's 4.0.0.1 to 4.0.1.0 included in some games because why not.

mirh commented 2 months ago

But it's already accepting OpenAL Soft (with just Creative vendor) when I replace OpenAL32.dll

I know, I was just telling you how not even to need to replace it. Not that important tbh, but you know.. you never know.

Btw I just noticed something odd: When loading the DLL from the system folder, it keeps using the built-in HRTF instead of OpenAL Soft's

You meant that it keeps falling back to the default rendering situation, rather than using openal soft at all?

while it works when the DLL is in the game folder

If you have wrap_oal in the system folder it seems remotely expectable.

so I guess the game/gameCODA's hardcoded the path bypasses the usual enumeration?

I'm afraid it might potentially be more fucked up than that.. Do you remember when I said to try different folder and names because lots of random stuff seemed to happen? Well, after frankly far too much time wasted, now that I checked all the sub-functions it's actually pretty legit and fair.

  DVar2 = GetCurrentDirectoryA(0x105,aCStack_34c);
  if (DVar2 != 0) {
    iVar6 = 0x104;
    pcVar3 = aCStack_34c;
    do {
      if (*pcVar3 == '\0') {
        if (iVar6 != 0) {
          FUN_0094e220(auStack_248 + -iVar6,0x104 - (-iVar6 + 0x104),"/OpenAL32.dll");
        }
        break;
      }
      pcVar3 = pcVar3 + 1;
      iVar6 = iVar6 + -1;
    } while (iVar6 != 0);
    pHVar4 = LoadLibraryA(aCStack_34c);
    *(HMODULE *)(param_1 + 4) = pHVar4;
    if ((pHVar4 == (HMODULE)0x0) && (DVar2 = GetCurrentDirectoryA(0x105,aCStack_34c), DVar2 != 0)) {
      iVar6 = 0x104;
      pcVar3 = aCStack_34c;
      do {
        if (*pcVar3 == '\0') {
          if (iVar6 != 0) {
            FUN_0094e220(auStack_248 + -iVar6,0x104 - (-iVar6 + 0x104),"/wrap_oal.dll");
          }
          break;
        }
        pcVar3 = pcVar3 + 1;
        iVar6 = iVar6 + -1;
      } while (iVar6 != 0);
      pHVar4 = LoadLibraryA(aCStack_34c);
      *(HMODULE *)(param_1 + 4) = pHVar4;
    }
    if (*(int *)(param_1 + 4) != 0) {
      cVar1 = FUN_0094e270();         // alcOpenDevice  +  alGenSources something
      if ((cVar1 != '\0') && (cVar1 = FUN_0094e300("DirectSound3D"), cVar1 != '\0')) {
        cVar1 = FUN_0094e360();       // alcCreateContext + alcMakeContextCurrent
        if (cVar1 != '\0') {
          cVar1 = FUN_0094e950();     // that EAX3.0 & "Creative" check
          if (cVar1 != '\0') {
            return 1;
          }
          FUN_0094e2b0();             // alcDestroyContext something
        }
        FUN_0094e8f0();               // alcCloseDevice
      }
      FreeLibrary(*(HMODULE *)(param_1 + 4));
      *(undefined4 *)(param_1 + 4) = 0;
    }
    FUN_0094e4e0();
  }
  UVar5 = GetSystemDirectoryA(aCStack_34c,0x105);
  if (UVar5 != 0) {
    iVar6 = 0x104;
    pcVar3 = aCStack_34c;
    do {
      if (*pcVar3 == '\0') {
        if (iVar6 != 0) {
          FUN_0094e220(auStack_248 + -iVar6,0x104 - (-iVar6 + 0x104),"/OpenAL32.dll");
        }
        break;
      }
      pcVar3 = pcVar3 + 1;
      iVar6 = iVar6 + -1;
    } while (iVar6 != 0);
    hFindFile = FindFirstFileA(aCStack_34c,&_Stack_140);
    if (hFindFile != (HANDLE)0xffffffff) {
      FindClose(hFindFile);
      pHVar4 = LoadLibraryA(aCStack_34c);
      *(HMODULE *)(param_1 + 4) = pHVar4;
      if (pHVar4 != (HMODULE)0x0) {
        cVar1 = FUN_0094e270();                // alcOpenDevice  +  alGenSources something (ditto)
        if ((cVar1 != '\0') && (cVar1 = FUN_0094e300(0), cVar1 != '\0')) {        // alcOpenDevice (ditto)
          cVar1 = FUN_0094e600(auStack_244);   // god kill me
          FUN_0094e8f0();                      //  alcCloseDevice (ditto)
          if ((cVar1 != '\0') && (cVar1 = FUN_0094e300(auStack_244), cVar1 != '\0')) {
            cVar1 = FUN_0094e360();           // alcCreateContext + alcMakeContextCurrent  (ditto)
            if (cVar1 != '\0') {
              cVar1 = FUN_0094e950();         // that EAX3.0 & "Creative" check (ditto)
              if (cVar1 != '\0') {
                return 1;
              }
              FUN_0094e2b0();                 // alcDestroyContext something
            }
            FUN_0094e8f0();                   // alcCloseDevice (ditto)
          }
        }
        FreeLibrary(*(HMODULE *)(param_1 + 4));
        *(undefined4 *)(param_1 + 4) = 0;
      }
    }
  }
  return 0;

This seems to be them poking the dlls they can find, to see what's best to load. But please follow up with me on that FUN_0094e600...

Also no mentions of OpenAL in procmon even with the DLL using Creative's vendor and Audigy device name.

Ok, then it was really the wrong path to focus on (even though I eventually realized the other thing by looking at the old sources). YET I can totally confirm you that SensAudio.dll has all the right code present for openal. But ghidra really didn't seem to like the file (even the directsound loading code couldn't have its caller resolved) so just like with UseHardwareSound I couldn't find its logic. Let alone understand it.

Hence the question.

Yes, but there hasn't to be a single answer in this case (they all are different games, sharing no code in common).

ThreeDeeJay commented 2 months ago

I know, I was just telling you how not even to need to replace it.

Ohh, you mean like with the router, right? I'm so used to just replacing OpenAL32.dll that I keep forgetting that's a thing. Even then, soft_oal.dll (with just vendor set to Creative Labs Inc. which now logs Opening playback device "OpenAL Soft") still loads fine in JC, though I had to use the redist router because OpenAL Soft's crashed at the loading screen for some reason.

You meant that it keeps falling back to the default rendering situation, rather than using openal soft at all?

Yup

If you have wrap_oal in the system folder it seems remotely expectable.

Nope, I had deleted it to narrow down the libraries loaded to only the ones I'm testing/using.

SensAudio.dll has all the right code present for openal.

Shame. So close.., Meanwhile: Mark Zlamal in 2002 progressively losing his mind over DirectSound. If only there was an alternative to it...

kcat commented 2 months ago

To point out, commit 62b6a61cf8884b31c97f65c62419cc42a6070446 (or 32a76dbb839c94d6086e3ec3d9ebed11e34ec53d) adds options to override the vendor (and version, and renderer) strings. Setting either the __ALSOFT_VENDOR_OVERRIDE envvar to whatever you want, or setting

[game_compat]
vendor-override = ...

in the alsoft.ini file. Can't override specific device names yet, though.

mirh commented 2 months ago

though I had to use the redist router because OpenAL Soft's crashed at the loading screen for some reason.

That sounds like a crash worth reporting

Even then, soft_oal.dll still loads fine in JC,

I know, but I was grasping at straws for MOV

To point out, commit 62b6a61 (or 32a76db) adds options to override the vendor (and version, and renderer) strings.

Can't believe this is what it took to get it after 2 years (even though AFAICT it's really just AL_VENDOR and alcDefaultName that make a difference, everything else seems kinda random).

Can't override specific device names yet, though.

Actually, what I had in mind in #757 was some kind of "automatic tracking of the current default device". Not sure if such global option couldn't be detrimental or annoying for other non-gaming or at least more modern applications", but it would seem subpar that switching from headphones to speakers could break it.

kcat commented 2 months ago

Can't believe this is what it took to get it after 2 years

This is the first proof I can recall of seeing it happen. And it's still not something I really like doing, since even though an app can do this to unnecessarily lock feature support to specific vendors, another app may do it "properly" to avoid a buggy feature from specific vendors or to detect vendor-specific behavior. It's a double-edged sword. Leaving the override in place, either on accident or through apathy, can cause difficult-to-track misbehavior (e.g. checking for the vendor being "Creative" to determine whether the 32-bit MCFORMATS formats are integer, as Creative implemented them, or float, as OpenAL Soft does) just as easily as allowing it to access missing features (e.g. only enable EAX when the vendor is "Creative").

mirh commented 2 months ago

This is the first proof I can recall of seeing it happen.

That there is a vendor check (well, and EAX3.0 reported as "present" even if not necessarily supported) for openal to be loaded at all? Yeah. But again, #757 was pretty much 80% of the same concerns even if just simply to try having the router finally be happy with enumeration without dll replacements.

either on accident or through apathy, can cause difficult-to-track misbehavior (e.g. checking for the vendor being "Creative" to determine whether the 32-bit MCFORMATS formats are integer, as Creative implemented them, or float, as OpenAL Soft does)

Even if that was the case, I'm pretty sure that could be special cased for those few dumb applications if found. But not much dissimilar, yeah, my biggest uneasiness was potentially regressing other normal software (from whatever needless vendor check they did themselves, to "perturbing the sanity" of the ALC_ENUMERATE_ALL_EXT results). Like, not 20yo games that 50% of times are broken anyway, but stuff that goes into production (I still have PTSD from that time I set a global qt scale factor in my system, ending up making Origin crash).

But until yesterday I was hoping at most we could get away with it at most just by including the "Audigy" string in the name (which isn't exactly ideal, but at the same time it would still give you freedom about any other character in the name).

just as easily as allowing it to access missing features (e.g. only enable EAX when the vendor is "Creative").

Why would EAX, an extra feature that you use only if wanted, have to be hideable? (reply on the other issue perhaps, here we really went overboard with stacked up digressions)

ThreeDeeJay commented 2 months ago

@kcat Thanks, that did the trick! Just Cause even needs the other compat flag because the HRTF is upside down (even when using the built-in Sensaura one or X-Fi hardware in XP lol) which means only with OpenAL Soft 3D audio can sound right in this game so thanks for that too๐Ÿ‘

[game_compat]
reverse-y=true
vendor-override=Creative Labs Inc.

@mirh It still doesn't trigger OpenAL in Men of Valor (even with the router and "Audigy" device or my X-Fi or with XP compat)

btw I noticed something interesting in Bioshock:

I also tried to run both games in my XP VM but they keep crashing on startup/main menu. ๐Ÿ˜”

Kappa971 commented 2 months ago

I know this is not the right place, maybe this issue should be closed because it is completely off topic now.

Anyway, It seems that Fallout 3 uses DirectSound3D (as well as New Vegas), or at least that's what they say on the web. It's very strange because these games came out in late 2008 and late 2010 respectively. I don't think they use EAX. Personally I don't know if all this is true, with my stereo speakers and CMSS-3D with ALchemy and not, I don't notice any differences, on the contrary ALchemy creates audio artifacts and buffer errors in its log file that I couldn't fix by changing the values โ€‹โ€‹of "Duration" and "Buffer" in various ways, so I removed ALchemy and I noticed something: using Windows' native DirectSound, the game applies a distortion effect, for example, on holotapes played with the PipBoy (you need to change the value of two settings in the configuration file because the volume is very low) which doesn't work with ALchemy or DSOAL.

This game needs a good remaster, the PC port is broken without mods...