kcat / openal-soft

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

Bioshock EAX support #1001

Open kcajjones opened 1 month ago

kcajjones commented 1 month 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 1 month 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 1 month 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 1 month ago

Commit f21e9161df8daaa410bd44cdaf60b26580905b69 should fix the flags out of range errors.

Kappa971 commented 3 weeks 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 3 weeks 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 3 weeks 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 3 weeks 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 3 weeks 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).