dsoal icon indicating copy to clipboard operation
dsoal copied to clipboard

Hitman 2 Silent Assassin muffled audio issue.

Open Phantom-Aspekt opened this issue 2 years ago • 54 comments

In Hitman 2 the audio seems to muffle as the source moves further from the camera to an extreme level.

For example when you get into a firefight with the enemy their gunshots will sound progressively more muffled with every step you take away from them to the point that they sound like they are shooting from behind a wall even though they are in the open and only about 5-10 meters away.

This occurs with the current build but I also tried it with a much older build from 2019 which had the same issue at slightly less extreme extent. For example You can actually hear your footsteps in third person using the older build and hear the muffle change when using the mouse wheel to adjust how close the camera is.

Phantom-Aspekt avatar May 27 '22 06:05 Phantom-Aspekt

I tried the demo in a fresh Windows 11 install (plus registry tweaks) with the current build of DSOAL and OpenAL Soft with this alsoft.ini but I didn't notice any significant muffling with distance https://youtu.be/Mt6kLrGXmxQ

ThreeDeeJay avatar May 31 '22 02:05 ThreeDeeJay

Possibly a result of https://github.com/kcat/openal-soft/issues/701? A bug in the 1.22.0 release of OpenAL Soft, which would still happen if using an older DSOAL with OpenAL Soft 1.22.0, and is now fixed in the current Git of OpenAL Soft.

kcat avatar May 31 '22 02:05 kcat

I already have tweaked the registry using this script in a .reg file.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\CLSID\{47D4D946-62E8-11CF-93BC-444553540000}\InprocServer32]
@="dsound.dll"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}\InprocServer32]
@="dsound.dll"

[HKEY_CURRENT_USER\Software\Classes\WOW6432Node\CLSID\{47D4D946-62E8-11CF-93BC-444553540000}\InprocServer32]
@="dsound.dll"

[HKEY_CURRENT_USER\Software\Classes\WOW6432Node\CLSID\{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}\InprocServer32]
@="dsound.dll"

I have DSOAL working fine in pretty much every other game using EAX. I used the same files in Codename 47 and Blood Money with no issues.

I downloaded all the files you linked and tried them which ended up with the same issue, this recording is using the files you linked. I also downloaded the demo and tested with the files I already had. The demo works perfectly fine but the version I use from Steam seems to have the issue. The same issue happens with Hitman Contracts.

As you can hear in the video, the EAX reverb and sound placement seems fine but there is 100% an issue with sounds at a distance.

I also built a fresh OpenAL32.dll using the master openal-soft repository, still the same unfortunately.

Phantom-Aspekt avatar Jun 03 '22 06:06 Phantom-Aspekt

@Phantom-Aspekt Apparently the steam version was censored and they might have messed up some audio stuff, so you might wanna try downgrading.

Also, you could try capping FPS to 60/vsync in 60hz if you haven't already. Some games like GTA San Andreas have some broken audio when unlocking framerate and apparently this game has similar issues, too.

ThreeDeeJay avatar Jun 03 '22 09:06 ThreeDeeJay

Tried the uncensored 1.01 version, same issue.

Also worth noting that Alchemy works fine for both versions & Contracts.

Phantom-Aspekt avatar Jun 03 '22 18:06 Phantom-Aspekt

@Phantom-Aspekt, try to deactivate the chorus effect of OpenAL Soft, it seems to solve the problem. I don't know what we're missing with it turned off though.

[General]
excludefx=chorus

I also opened a problem in the OpenAL Soft repository

EDIT Disabling the chorus effect will now disable EAX, as it was causing undefined behavior, so forget what I wrote about the chorus effect.

Kappa971 avatar Jun 07 '22 11:06 Kappa971

I tried the demo that @ThreeDeeJay linked and I confirm that EAX works perfectly.

The assumptions are that the game is giving strange values (which ALchemy and the old Creative drivers accept), or there is a hidden bug in OpenAL Soft or DSOAL (which of the effects could make a sound muffled?), or the game fails to understand the speaker setup (it looks like it's trying to use a 5.1 setup with center and rear speakers on a stereo setup).

Kappa971 avatar Jun 13 '22 16:06 Kappa971

Unfortunately the game just outright crashes for me if I turn off the chorus effect.

I also ran the game with channels=surround51 set in alsoft.ini along with DTS Headphone X, still sounded the same as when set to stereo.

It sounds much more like an occlusion issue rather than the game putting out 5.1 on a stereo system considering the sound muffles based on distance rather than where it is placed around you.

Phantom-Aspekt avatar Jun 21 '22 14:06 Phantom-Aspekt

Unfortunately the game just outright crashes for me if I turn off the chorus effect.

I also ran the game with channels=surround51 set in alsoft.ini along with DTS Headphone X, still sounded the same as when set to stereo.

It sounds much more like an occlusion issue rather than the game putting out 5.1 on a stereo system considering the sound muffles based on distance rather than where it is placed around you.

https://github.com/kcat/openal-soft/issues/714#issuecomment-1161812835 Also now disabling the chorus effect disables EAX.

Kappa971 avatar Jun 21 '22 14:06 Kappa971

I noticed the same problem in Blood Money with DSOAL and EAX turned on. The issue has been present both before DSOAL used the EAX extension of OpenAL Soft and afterwards. I just retested with the OpenAL Soft 1.22.2 official release and self-compiled DSOAL at commit a16c19f and the issue is still present. It's interesting that @Phantom-Aspekt says it was working fine for them in Blood Money. I have the game running in Wine, maybe that causes issues, too.

Hiradur avatar Jul 01 '22 07:07 Hiradur

As you can see in https://github.com/kcat/dsoal/issues/57, there are regressions going back years and years in time ~~(conversely fe2978f17b949bdf6d013968635fe9dcc69b2492 wasn't really all that big of day and night change as we had initially assumed).~~ EDIT: well nvm So I'd recommend you testing versions here and there (including one from 2011 ultimately) for potential clues, while you wait for the big boys to debug the problem.

mirh avatar Jul 01 '22 18:07 mirh

This is not a regression, as it also happens with older versions of DSOAL (I tried one from late 2020, I don't think it makes sense to go further back because EAX, I think, was not fully implemented yet). There's something weird about these old Hitman games...

Kappa971 avatar Jul 01 '22 21:07 Kappa971

Well, in #57 they found some early 2018 one worked.

mirh avatar Jul 02 '22 00:07 mirh

Well, in #57 they found some early 2018 one worked.

With all due respect, but I don't understand what it has to do with this issue 😅

Hitman 2 is not crashing, but it is playing some sounds incorrectly.

Kappa971 avatar Jul 02 '22 22:07 Kappa971

It has to do that people think the biggest change/shift/news like ever in the history of the library is fe2978f17b949bdf6d013968635fe9dcc69b2492, and so when doing regression testing they stop there. But it's not like that, like you can see in my example of 2018 builds helping with bisecting. Though now that I check the commit graph, that's not even random.. it's by far the year with the most activity.

mirh avatar Jul 03 '22 01:07 mirh

In Blood Money at least, the issue is only present when EAX is enabled. Blood Money apparently uses EAX4. I doubt testing with DSOAL builds before EAX4 support was introduced (5c5b37cfdaf55b074a118f5e1090b3a3ff81f92f) would help narrowing down the issue in Blood Money. Although it certainly wouldn't hurt to test at least with one older build to confirm.

I noticed the issue in Blood Money already in 2021 if not 2020, and retried every couple of months with newer OpenAL Soft and DSOAL builds but it's never been fixed until now. I also tested with DSOAL builds before fe2978f since that commit was not available at that time. Maybe there would be a working build in the time span from 5c5b37cfdaf55b074a118f5e1090b3a3ff81f92f to sometime in 2021. It should be noted that all my testing was done in Wine.

As far as Hitman 2 is concerned, testing with pre-2018 builds of DSOAL could be useful since that game only uses EAX3.

Hiradur avatar Jul 03 '22 11:07 Hiradur

Maybe if DSOAL had a "debug" mode to figure out what the game is trying to do...

Kappa971 avatar Jul 04 '22 22:07 Kappa971

Maybe if DSOAL had a "debug" mode to figure out what the game is trying to do...

You can set the DSOAL_LOGLEVEL environment variable to 3 to get an API trace which is pretty much what you were asking for.

I attached a video recording of the issue in Blood Money including logs from OpenAL Soft and DSOAL. I used the official 1.22.2 OpenAL Soft release in combination with DSOAL at commit a16c19f. Testing was done in Wine.

2022-07-05_hitman_blood_money_eax_bug.zip

Hiradur avatar Jul 05 '22 15:07 Hiradur

I also shared the log files (Hitman 2) here: https://github.com/kcat/openal-soft/issues/714 @kcat couldn't understand the problem... I guess it's like walking in the dark, and we can only thank Creative.

Kappa971 avatar Jul 05 '22 16:07 Kappa971

It does seem as though air absorption is cranked way up in that recording. EAX3 doesn't have access to the context's meters per unit or the air absorption level to control it, but it does have access to the source's air absorption factor. Since there's no error being logged, one would presume whatever it's setting is valid, but there's still something wrong somewhere.

I do need to add a way to trace what EAX values are getting set now with OpenAL, but I'm not keen on adding per-call traces to OpenAL. I'll need to add it back to DSOAL in a way that won't interfere with performance when not doing a trace log.

kcat avatar Jul 05 '22 19:07 kcat

My mistake on mentioning that Blood Money was working, I seem to have been using dsoal-r294 when I did a quick test. It's definitely got muffled audio using newer builds.

Phantom-Aspekt avatar Jul 11 '22 09:07 Phantom-Aspekt

Hi, is there any news regarding this? In case I could help test a DSOAL debug build.

Kappa971 avatar Oct 20 '22 18:10 Kappa971

@Kappa971 @Phantom-Aspekt I just posted some results from some quick tests over at https://github.com/kcat/openal-soft/issues/714#issuecomment-1484696435 so if certain OpenAL Soft builds newer than 1.22.0 are the issue as my tests suggest, we might wanna close this issue and continue the conversation there, since I found that the issue doesn't seem to happen in 1.22.0 with the latest DSOAL.

ThreeDeeJay avatar Mar 27 '23 08:03 ThreeDeeJay