kcat / openal-soft

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

EAX Reverb Regression #706

Closed Jenavieve-Rose closed 2 years ago

Jenavieve-Rose commented 2 years ago

Looks like a problem as a result of the issue mentioned here: https://github.com/kcat/openal-soft/issues/675#issuecomment-1079711208

In short, the game itself doesn't use EAX, but DSOAL makes a couple EAX calls during initialization that causes OpenAL Soft to "initialize" EAX support, which currently causes a default effect to initialize and be applied to sources. However, what it needs to do is track properties for the different versions of EAX, and only apply the last version set (i.e. nothing in the case of this game).

I added a workaround with commit 5c0eabc5264a58e8fe9f78da6198587d78770d01. It's not a proper fix, but should avoid this issue.

Originally posted by @kcat in https://github.com/kcat/openal-soft/issues/684#issuecomment-1100755947

I have compiled the latest version of OpenAl-Soft as of writing this and I have the reverb back in games that do not use reverb. dsoal_log.txt

Jenavieve-Rose commented 2 years ago

To clear up any confusion this is the same issue I had in issue #684. https://youtu.be/HKDf3J5iQZM It seems to have been reintroduced or the workaround disabled with the most recent commit.

kcat commented 2 years ago

Probably due to a recent commit introducing the per-version EAX property handling. While EAX2 has reverb silent by default, 3 and up don't. And when initializing a buffer, DSOAL makes an EAX4 call to set default source slots, which causes the effect to initialize with EAX4's non-silent defaults.

Kappa971 commented 2 years ago

I tried GTA 3 (EAX 3) with DSOAL pre and after the last commit and in both cases, the reverb level is exaggerated. Considering that other games (even GTA Vice City) do not suffer from this problem, maybe the developers of GTA 3 have misadjusted the reverb? Here the log: dsoal_log.txt With the old version of DSOAL (pre OpenAL Soft with EAX extensions), in GTA 3 the reverb was mild (but it could be that it was behaving the wrong way, I don't know).

The other games in my case seem to work fine (but I don't have an X-Fi to make comparisons).

Jenavieve-Rose commented 2 years ago

I have had similar issues with Call of Duty where the reverb is crazy intense in places to the point of drowning everything else out, but it works normally in other places too. I am inclined to think it could have been a bug with the game. I feel a lot of games had weird EAX issues till EAX 4 and games built on OpenAL seem mostly issue free.

mirh commented 2 years ago

Possibly related to what I complained here https://github.com/bibendovsky/eaxefx/issues/19

Kappa971 commented 2 years ago

I don't know if this (https://github.com/kcat/dsoal/commit/a16c19fdbb6c56bbd40a011362da0742a49f6f35) solved the problem @Jenavieve-Rose mentioned, but for GTA 3 there is still some exaggerated reverb. However, I don't know if this is the normal behavior of the game, as already mentioned.

I bought an X-Fi Titanium, it should arrive next week. If I can get it to work on Windows 11 or 10 without a BSOD, I can say for sure how GTA 3 should "sound" with EAX. Of course, this would still not help to solve a possible issue, but at least we will have a comparison with real hardware.

mirh commented 2 years ago

You can get it to work with W10, no biggie, but openal is going to be bugged in certain games. https://web.archive.org/web/20170720035149/http://forums.creative.com/showthread.php?t=726283 https://old.reddit.com/r/SoundBlasterOfficial/comments/bsw72w/will_openal_ever_be_fixed_on_the_titanium_cards/ https://www.vogons.org/viewtopic.php?f=62&t=42857&start=20#p740378 Stick with W7 if you can.

Kappa971 commented 2 years ago

Stick with W7 if you can.

I can't, I would lose Freesync and it's not acceptable. I hope the Unofficial X-Fi Support Pack 8.0 (Refresh 3) drivers work fine: https://danielkawakami.blogspot.com/.

mirh commented 2 years ago

I highly doubt @LAGonauta And btw that's an nvidia limitation more than anything, and you don't really need vsync anyway on a high refresh rate monitor.

Kappa971 commented 2 years ago

Maybe we should continue the discussion elsewhere, I don't think this is the right place.

Kappa971 commented 2 years ago

The X-Fi was delivered to me early. All the games I have tried work perfectly, even OpenAL games like Doom 3, Quake 4, Bioshock, even Unreal 2 seem to work fine (I finished the training course with no problems). But back to the main topic (I won't go off topic anymore), let's talk about the reverb on GTA 3. Even with the X-Fi, GTA 3 has an exaggerated reverb, but somehow different. It seems that the "echo" effect is less pronounced, the reverb is "shorter", I don't know how to describe it, and when you press the ESC key to go to the game menu, the reverb is stopped immediately (on the contrary, this doesn't happens with ALchemy "software" and DSOAL, entering the menu you will hear the reverb for a few seconds).

mirh commented 2 years ago

My hats off for doing what truly a lot of people couldn't be bothered to do (also interesting that you had no problem, maybe they used this hack?) But I'm afraid only windows XP could be the only true arbiter (not that authorial intent should matter more than "what your ears like", but still I feel like that would be overflying the most important piece of the equation).

I'm not sure if you can do pcie passthrough of non-gpu devices in windows then, but I'm wondering an XP qemu vm from some linux distro should definitively do it. And this could also probably still retain freesync for you :)

Jenavieve-Rose commented 2 years ago

You may want to open up a seperate ticket as this does not have anything to do with what I opened this ticket up about.

kcat commented 2 years ago

Does https://github.com/kcat/dsoal/commit/a16c19fdbb6c56bbd40a011362da0742a49f6f35 fix the issue mentioned here? It shouldn't force reverb to be audible anymore with games that don't use EAX.

Jenavieve-Rose commented 2 years ago

Does kcat/dsoal@a16c19f fix the issue mentioned here? It shouldn't force reverb to be audible anymore with games that don't use EAX.

Yes this has fixed the issue thanks

Kappa971 commented 2 years ago

I know this has been solved, but I want to talk about OpenAL Soft's reverb effect. Looking at two games, namely Splinter Cell and GTA 3, I can state that DSOAL (or OpenAL Soft) isn't setting the reverb intensity too high or too low, but it looks like a different reverb preset with a different intensity than ALchemy (SB X-Fi). For example there are places in Splinter Cell that have similar reverb intensity in both DSOAL and ALchemy, but others where in DSOAL the reverb is almost inaudible and looks like a completely different preset. So changing the value boost=0 in the OpenAL Soft configuration file would not solve anything, because there would still be this disparity. This would also explain why in GTA 3 there is a lot of reverb (more than ALchemy) while in other games there is not.

I can't record a video of the game running with ALchemy (X-Fi), it records the video but not the sound... it would have been easier to explain this.

mirh commented 2 years ago

What U hear (in creation mode possibly) or this should allow multi-channel recording.

kcat commented 2 years ago

OpenAL Soft's reverb implementation is very different from Creative's. Since OpenAL Soft's mixing bus is based on ambisonics, it takes a holistic approach to 3D sound, so it needs to handle the reflections in a way that makes some kind of sense in a full 3D environment and only worry about bringing that to speakers later (in comparison to many other reverb methods that use the individual output channels/speakers for its feedback and delay lines). It takes the same core concept of this kind of reverb (since it's using the same input parameters, there's going to be similarities there), but implements it in a speaker-agnostic way. Consequently, if Creative's reverb (likely) uses an implementation that ties its performance/quality to the speaker configuration, while OpenAL Soft uses an implementation that's more general agnostic to the speaker configuration, that could result in some differences when it's finally mixed and output to the speakers.

That said, it's not impossible there are some implementation issues causing certain parameters to act more strongly or weakly than expected on the reverb output (in particular I know the automatic initial reverb decay, an initial attenuation of the wet signal based on the sound distance and reverb parameters, is almost assuredly different). For this, it would help to know what specific reverb properties are in use that show a significant difference, along with recordings from the X-Fi and OpenAL Soft for the exact same scenario (same sound effect, same distance, minimal extraneous noise).