dsoal icon indicating copy to clipboard operation
dsoal copied to clipboard

[Grand Theft Auto III] How does EAX 3.0 supposed to work in this game?

Open rrPKrr opened this issue 5 months ago • 25 comments

Hey!

First of all I have never played GTA3 with EAX before (didn't even know it supported EAX to begin with), so I have no idea how the game is supposed to sound with it on. But after installing dsoal and enabling "Creative Labs EAX 3 (tm)" in the in-game options I can hear loud reverb effects being applied to pretty much every sound everywhere in game. This is very different from GTA Vice City where reverb effects apply to some specific locations (for example parking lots or under the bridges, etc).

My question is how is EAX 3.0 supposed to work in this game? Is it a bug or an intentional behavior?

rrPKrr avatar Jul 22 '25 15:07 rrPKrr

Can you check some of the old builds in #134 for better/different results?

mirh avatar Jul 23 '25 00:07 mirh

A recording of what it sounds like, and a debug log, can help. Without knowing what it sounds like, I can't say whether it's intentional or not, and if something's wrong, a log file can help show what's going on.

You can use this batch file to create a debug log: https://raw.githubusercontent.com/ThreeDeeJay/ALog/refs/heads/main/Drop%20exe%20to%20run%20with%20logging.bat

kcat avatar Jul 23 '25 01:07 kcat

@mirh I have checked older dsoal builds. Sounds pretty much identical across older/newer builds.

@kcat Right, I wasn't sure if it was a dsoal bug (or at all), so I didn't bother creating log files. But here is how it works for me (DSOAL r661 + OpenAL Soft r10008): https://www.youtube.com/watch?v=Ti5hWFArFuM dsoal.log alsoft.log

alsoft.ini settings: [general] channels=stereo stereo-mode=headphones stereo-encoding=hrtf default-hrtf=irc_1037_48000 [reverb] boost=0 [eax] enable=true

rrPKrr avatar Jul 23 '25 09:07 rrPKrr

That may be more or less how it's intended to sound. The reverb does change as the listener moves into different areas, sometimes being more pronounced and sometimes less. In the dsoal log I see it regularly setting the EAX 3.0 listener and buffer properties; interestingly, every time it updates the EAX listener properties, it sets all properties at once, then gets the environment size, then sets the environment size. The alsoft log shows a series of this error:

Environment Size out of range (value: 3.6e-44; min: 1; max: 100).

though I don't know if that's when setting all properties or setting just the environment size, or both. It's certainly not unusual for some games to set invalid EAX properties; 3.6e-44f is represented as 0x1a in hexadecimal, which is 26 (also the EAX_ENVIRONMENT_UNDEFINED enumeration, which is the environment ID that gets set when using custom environment properties). Maybe the game gets confused and tries to set the custom env ID but accidentally attempts to set the environment size property. Or maybe the game has an improperly defined EAX3 reverb property structure that has the environment ID where the environment size should be. Or maybe OpenAL Soft is returning the wrong value for the environment size that gets set back, but I don't see a problem there in OpenAL Soft's code.

kcat avatar Jul 23 '25 11:07 kcat

Interesting. What's the fallback behavior of alsoft when it receives invalid values for the environment size?

rrPKrr avatar Jul 23 '25 12:07 rrPKrr

https://www.youtube.com/watch?v=nsw-X_BFj8&lc=UgySQd7OwnuXrxP2rJl4AaABAg.8u-THoMFpmp8u-XGhStks&pp=0gcJCSMANpG00pGi Allegedly EAX 3 was indeed broken? And it seems strange that you report "loud reverb" even in older versions, as those were supposedly broken with it stopping very quickly.

This is how it should/might sound on OG creative cards, presumptively (I hope you aren't using the eax/alchemy fix btw) https://www.youtube.com/watch?v=O7Ji24qhpUQ https://www.youtube.com/watch?v=7gU0ZXN1vrs

mirh avatar Jul 23 '25 22:07 mirh

Interesting. What's the fallback behavior of alsoft when it receives invalid values for the environment size?

It returns an error and leaves everything as it was, which should be what real hardware does too. I'd be surprised if there's any hacks in hardware drivers to do anything about it. From mirh's examples, the only real issue seems to be the reverb gain is a little high, which isn't very surprising. I've seen videos of other games using EAX and the reverb levels were all over the place on different hardware, and I know OpenAL Soft's handling of reverb-related automatic attenuation isn't quite right though should be mostly okay.

kcat avatar Jul 24 '25 06:07 kcat

@mirh

https://www.youtube.com/watch?v=nsw-X_BFj8&lc=UgySQd7OwnuXrxP2rJl4AaABAg.8u-THoMFpmp8u-XGhStks&pp=0gcJCSMANpG00pGi Allegedly EAX 3 was indeed broken? And it seems strange that you report "loud reverb" even in older versions, as those were supposedly broken with it stopping very quickly.

The comments that mention EAX 3.0 related issues are very old. The oldest version mentioned in https://github.com/kcat/dsoal/issues/134 is v0.9.7 and the oldest rc version is r444. In both versions EAX 3.0's reverb works properly (aside from it being applied everywhere, which is supposedly a somewhat correct behavior after all) without any cutoffs. These two versions were the ones I called "older versions". I could test the ones which are supposed to break reverb effects in GTAIII if you'd tell me which ones I should try.

This is how it should/might sound on OG creative cards, presumptively (I hope you aren't using the eax/alchemy fix btw) https://www.youtube.com/watch?v=O7Ji24qhpUQ https://www.youtube.com/watch?v=7gU0ZXN1vrs

My bad. I should have mentioned from the get go that I do indeed use eax/alchemy fix. GTAIII/Vice City won't let me to select EAX options without the modified mss32.dll. Why, what's wrong with it?

Before you ask, these were the registry keys that I had to modify to make dsoal work in other games: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{47D4D946-62E8-11CF-93BC-444553540000} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{47D4D946-62E8-11cf-93BC-444553540000}

In an attempt to make GTAIII to recognize dsoal I have also modified these keys (taken from @ThreeDeeJay 's https://github.com/ThreeDeeJay/DSWRP/releases/tag/v1.2.0): HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{B0210780-89CD-11d0-AF08-00A0C925CD16} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{B2F586D4-5558-49D1-A07B-3249DBBB33C2} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{FEA4300C-7959-4147-B26A-2377B9E7A91D} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{B0210780-89CD-11d0-AF08-00A0C925CD16} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{B2F586D4-5558-49D1-A07B-3249DBBB33C2} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{FEA4300C-7959-4147-B26A-2377B9E7A91D}

It's also worth mentioning that these keys don't exist at all on my system: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{11AB3EC0-25EC-11D1-A4D8-00C04FC28ACA} HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID{11AB3EC0-25EC-11D1-A4D8-00C04FC28ACA} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{11AB3EC0-25EC-11D1-A4D8-00C04FC28ACA} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{47D4D946-62E8-11CF-93BC-444553540000} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{B0210780-89CD-11d0-AF08-00A0C925CD16} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{B2F586D4-5558-49D1-A07B-3249DBBB33C2} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID{FEA4300C-7959-4147-B26A-2377B9E7A91D} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{11AB3EC0-25EC-11D1-A4D8-00C04FC28ACA} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{47D4D946-62E8-11CF-93BC-444553540000} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{B0210780-89CD-11d0-AF08-00A0C925CD16} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{B2F586D4-5558-49D1-A07B-3249DBBB33C2} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} HKEY_CURRENT_USER\SOFTWARE\Classes\WOW6432Node\CLSID{FEA4300C-7959-4147-B26A-2377B9E7A91D}

After adding them manually the game still couldn't recognize dsoal. That's why I had to use eax/creative fix.

rrPKrr avatar Jul 24 '25 11:07 rrPKrr

Uh? That's odd. Did you try to reboot your computer? And I assume you aren't running the game as administrator right?

mirh avatar Jul 24 '25 11:07 mirh

@mirh That's right. I reboot my pc after making registry changes, and there is no reason for me to run the game as admin. Just for the sake of it, since I do all the changes manually, and could've made mistake while doing so, I have run the @ThreeDeeJay 's script with admin rights. Just to be sure instead of restarting pc I have shut it down with shutdown /f /s. GTAIII still doesn't allow me to select eax options without modified mss32 dll.

rrPKrr avatar Jul 24 '25 12:07 rrPKrr

I assume dsound3d also doesn't work? And could you try to put into every InprocServer32 an absolute path to dsoal dsound.dll rather than just the dll name?

mirh avatar Jul 24 '25 12:07 mirh

@mirh Before I do so I have to mention that your comments regarding eax/creative fix made me curious so I temporarily installed dsoal system wide, so the game let me choose eax options with original mss32.dll, and from the first glance the game sounds identical to modified mss32+dsoal. So I have to ask again, is there any reason to not use eax/creative fix? And just to be clear are we talking about the same fix you can find over here: https://www.gtagarage.com/mods/show.php?id=27928?

Now since your comments also imply that it should work with the original mss32 without installing dsoal system wide and that also made me curious, so I'll do just as you suggested and add absolute paths to dsound.dll in every instance I can find on my system, but that will take some time...

rrPKrr avatar Jul 24 '25 13:07 rrPKrr

Eeeh, I'm not so sure myself anymore tbh (btw remember to revert those keys once we finish because they aren't exactly a toy).

https://github.com/VideogameSources/gta3-decomp-alt/blob/main/src/skel/win/win.cpp#L1912

After some ghidra and XP sources digging, I believe this may be the line that causes directsound loading. That in turn has a long chain of directshow BS that eventually LoadLibrary(TEXT("dsound.dll") from the system folder. And that would mean I'm wrong, but what I don't understand though is how creative was supposedly calling it a day in 2007.

mirh avatar Jul 24 '25 13:07 mirh

@mirh

Eeeh, I'm not so sure myself anymore tbh (btw remember to revert those keys once we finish because they aren't exactly a toy).

Don't worry. I am not a complete noob when it comes to things like these.

Anyway, I have tried absolute paths, and still nothing. ~~No surprise there though. Since the game also tries to load dsound.dll from absolute paths (and eax/creative fix fixes just that), it shouldn't have worked anyway.~~ Worth trying though.

but what I don't understand though is how creative was supposedly calling it a day in 2007.

¯\_(ツ)_/¯

rrPKrr avatar Jul 24 '25 13:07 rrPKrr

Ok I found out the mystery. Once upon a time, indeed Windows own dlls were using *LoadLibrary*. But so unless you were launching the game from inside another folder, even if it's a system dll to be calling dsound.dll normal PATH conventions would still be respected. On the other hand what I'm seeing here in W10 22H2's quartz.dll is LoadLibraryExW(L"DSOUND.DLL",(HANDLE)0x0,0x800). The later value being the flag for LOAD_LIBRARY_SEARCH_SYSTEM32, and that's probably what has been in use at least since W8.

This means that when function PlayMovieInWindow calls directshow for the intro videos, that's what gets to load anything first. And when Mss32.dll tries to load it its normal way, it finds somebody already took care of it and it recycles the reference. But it's funny because then you just need to rename the movies folder ( ͡° ͜ʖ ͡°).

mirh avatar Jul 24 '25 18:07 mirh

@mirh Holy $#!+ Sherlock, it works.

I suppose this happens because CloseInterfaces function which frees DirectShow interfaces is only being called in case if movies were not found, but it's never being called after successfully playing logos?

rrPKrr avatar Jul 24 '25 19:07 rrPKrr

No, as I said it works because by skipping the movies the code that plays them never runs, hence dsound is loaded totally normal by mss32 rather than quartz. Now.. I guess back in topic, a list with all the different results you get for every older dsoal version wouldn't hurt.

mirh avatar Jul 24 '25 21:07 mirh

~~I am afraid there is no need to list differences for older versions just yet. 🤔 r661 is already bugged for me with unmodified mss32.dll+renamed movies folder... https://youtu.be/woTBCIL8-Ow~~

~~And that explains why I couldn't hear reverb cutoffs before. Because here is how it sounds with modified mss32.dll: https://youtu.be/wg5MEWSJWbQ~~

~~I mean, there is some slight cutoff in the second video as well, but it's nowhere near as drastic as in the first one.~~

rrPKrr avatar Jul 24 '25 23:07 rrPKrr

I mean.. there's also http://vaporeon.io/hosted/dsoal-builds/old/ I'm not sure if I understand correctly though: are you saying that the "alchemy fix" mod itself makes a difference?

mirh avatar Jul 25 '25 13:07 mirh

Sorry for the misinformation. There is indeed a bug that cuts off reverb effects in latest builds, but it happens under some specific conditions, which are not related to alchemy fix whatsoever. So, forget my previous post. The good news is that I have managed to find a pretty reliable and easy way to reproduce it.

Apparently it happens in specific locations when multiple sounds with a reverb effect play simultaneously. For example car horn sounds abruptly cut off when you fire a gun from the car in this location: https://youtu.be/N48Tnrh5NNg

These are the log files generated during that video: dsoal.log alsoft.log

However it never happens in this location: https://youtu.be/5dwoelL6XBk

Log files generated during the second video: dsoal.log alsoft.log

I've been testing earlier builds extensively for the last few hours, and it seems like this bug was introduced after DSOAL 0.9.5 + OpenAL Soft 1.23.1 ( https://github.com/ThreeDeeJay/dsoal/releases/tag/0.9.5 ). With DSOAL 0.9.5 however I can't trigger the bug no matter what I do: https://youtu.be/HUIL49bpAag

As for your initial question regarding the earlier versions of DSOAL, I have tested earlier builds starting from r400 ( https://github.com/ThreeDeeJay/dsoal/releases/tag/r400 ). The results are pretty universal for builds r400-r428: I can't hear any reverb whatsoever. https://youtu.be/wpCj89d1Jx4

The first version that produces audible reverb effects for me is r429 ( https://github.com/ThreeDeeJay/dsoal/releases/tag/r429 ), and the loudness of reverb effects in that version is pretty much the same as in latest versions.

rrPKrr avatar Jul 25 '25 14:07 rrPKrr

@mirh

there's also http://vaporeon.io/hosted/dsoal-builds/old/

Regarding these builds.

r444 - no cutoffs, loud reverb effects r441 - no cutoffs, loud reverb effects r435a - no cutoffs, loud reverb effects r435 - no cutoffs, loud reverb effects r430 - no cutoffs, loud reverb effects r422 - no reverb r418a - no reverb r418 - no reverb r391c - no reverb r391b - no reverb r391 - no reverb r390e - no reverb r390c - no reverb r390b - no reverb r390 - no reverb r388c - no reverb r388b - no reverb r388 - no reverb r386b - no reverb r294b - no cutoffs, even louder reverb effects? r294 - no cutoffs, even louder reverb effects, and they are... very reverby :>

By "no cutoffs" I mean I can't reproduce the bug from my previous post which I discovered in post 0.9.5 versions.

Also, it's interesting that the builds that were relevant around the time this video came out...

https://www.youtube.com/watch?v=nsw-X_BFj8&lc=UgySQd7OwnuXrxP2rJl4AaABAg.8u-THoMFpmp8u-XGhStks&pp=0gcJCSMANpG00pGi Allegedly EAX 3 was indeed broken? And it seems strange that you report "loud reverb" even in older versions, as those were supposedly broken with it stopping very quickly.

...don't produce any reverb whatsoever. So, I guess, indeed EAX 3 was broken in this game back then.

rrPKrr avatar Jul 25 '25 16:07 rrPKrr

To be honest you didn't need to test in-between builds once you found the two closest extremes for a change.. And if that's the case, the only difference is that either builds don't have reverb or they have it persisting for too long? Hardly helpful.

Anyhow one very very useful thing could be the sources https://github.com/VideogameSources/gta3-decomp-alt/blob/main/src/audio/eax/eax-util.cpp https://github.com/VideogameSources/gta3-decomp-alt/blob/main/src/audio/AudioManager.cpp https://github.com/VideogameSources/gta3-decomp-alt/blob/main/src/audio/sampman_miles.cpp (for as much the technical final-final calls within miles aren't available)

mirh avatar Jul 26 '25 01:07 mirh

On GTA 3 the reverb is strong even with the ALchemy software emulation on a Sound Blaster Z. With ALchemy and an X-Fi, the reverb is much less strong, Creative's OpenAL driver definitely sets a different level of reverb.

Someone should test with a Sound Blaster Audigy/X-Fi on a Windows XP PC and see what happens, but I suspect the reverb would be similar to ALchemy with X-Fi on Windows 10/11.

Kappa971 avatar Jul 26 '25 22:07 Kappa971

I'm also currently trying to get EAX 3.0 to work in both III and VC and I can confirm the symptoms already mentioned. In both games the reverb is exaggerated, but in III even a bit more because of the reverbs being added to pretty much everything except for the radio, while in VC it's just in certain areas, especially in areas where you got a roof above your head. And in both games, the OpenAL Soft log consists of this mentioned error, "Environment Size out of range (value: 3.6e-44; min: 1; max: 100)", where the value is actually exactly the same.

I also tried EAX 1.0, but with this version, I can actually hear no difference compared to the default audio hardware (dsound3d software emulation, I think) in both games. Or are there any after all?

So what I already tried to make the reverb a bit less pronounced is using the "boost" setting in alsoft.ini, setting it to -6, and while it does help with reducing the gain, there is still the issue that in both games, the reverb effect is just way too long. So is there some way to fix this? Or am I better off with using ALchemy in these games even though I don't have a Creative sound card?

And what I'm still not quite sure about, is it actually the normal behavior of GTA III that reverbs are applied that often? I couldn't really find out by the videos mentioned here as the reverb effects aren't so loud there.

(Used version r690 btw)

Mofkos avatar Dec 06 '25 08:12 Mofkos

I also tried EAX 1.0, but with this version, I can actually hear no difference compared to the default audio hardware (dsound3d software emulation, I think) in both games. Or are there any after all?

I don't hear any difference in EAX 1.0 either.

And what I'm still not quite sure about, is it actually the normal behavior of GTA III that reverbs are applied that often? I couldn't really find out by the videos mentioned here as the reverb effects aren't so loud there.

From what I can tell this is a normal behavior, and the difference in those videos isn't really about the loudness. It's just that reverb effects fade out more quickly on the real(?) hardware compared to GTAIII + DSOAL.

rrPKrr avatar Dec 10 '25 20:12 rrPKrr