kcat / dsoal

A DirectSound DLL replacer that enables surround sound, HRTF, and EAX support via OpenAL Soft
GNU Lesser General Public License v2.1
387 stars 51 forks source link

Far Cry doesn't seem to be using EAX #33

Closed Kappa971 closed 2 years ago

Kappa971 commented 2 years ago

Hi, as the title suggests, the reverb effect in Serious Sam TFE/TSE doesn't seem to work. In pcgamingwiki it is specified: "EAX 2.0 reverb; no DirectSound3D support". I tried with ALchemy and in some areas there is reverb (reverb can be heard in Serious Sam TFE's Karnak level) but not with DSOAL. OS Windows 11.

Here is the Serious Sam TFE log file if it can be useful: dsoal_log.txt This is an example: https://www.youtube.com/watch?v=9wShr1XqP6o

Kappa971 commented 2 years ago

Far Cry also suffers from the same problem (noted in Level 2 Carrier). Here the log file if it can be useful: dsoal_log.txt

Setting DSOAL_LOGLEVEL = 1 results in these errors in Far Cry: 2a7c:fixme:dsound:IKsPrivatePropertySetImpl_Get unsupported property: {f2957840-260c-11d1-a4d8-00c04fc28aca} 2a7c:err:dsound:DSBuffer_Initialize Panning for multi-channel buffers is not supported

Kappa971 commented 2 years ago

The reverb effect in Serious Sam seems to work with OpenAL Soft 1.21.0, although to hear it I had to set boost = +12.

Far Cry doesn't seem to be using EAX at all, I don't read any EAX calls in the log file. However, the reverb effect that is missing in this game, could be a bug of the game itself (therefore not resolvable by DSOAL) as reported on vogons by jonpol (creator of IndirectSound): https://www.vogons.org/viewtopic.php?f=8&t=40913&p=1028884#p1028884

"These are the EAX settings the game is requesting when I load that save game:

room = 0 roomHF = 0 roomRollOffFactor = 0 decayTime = 0 decayHFRatio = 0 reflections = 0 reflectionsDelay = 0 reverb = 0 reverbDelay = 0 environment = 569393924 environmentSize = 0 environmentDiffusion = 0 airAbsorptionHF = 0 flags = 0

There are two things to note: 1) Almost all of the values are zero (this would generally indicate that either the programmer cleared everything to zero and then never filled in anything or that the programmer never filled in anything at all but the default memory happened to be filled with zeros) and 2) The environment, the only non-zero value, is a huge number.

The "environment" is the default environment type that I mentioned in the previous post about the start of the game (where it was set to "psychotic"). There are only 26 environments, and so the only valid values are 0-25. This means that the call to set the EAX properties will return E_INVALIDARG, none of them will be set, and the previous values will stay active. Those previous values are from the menu (or loading screen), and have the volume set to the minimum so that no EAX reverb is audible. [Full disclosure: What I just described is how IndirectSound behaves, and I implemented that years ago. That was before my more rigorous approach to testing and documenting behavior with strange input and so I can't 100% guarantee that all of the other values would be ignored if the environment value were bad in Windows XP because I don't remember how I tested it. I can guarantee that the values that FarCry is requesting aren't the result of a carefully crafted sonic environment, though: It looks like a bug.)

It seems to me that DSOAL is behaving correctly. If you hear any reverb with ALchemy it seems like it is a bug with ALchemy accepting invalid values. Also, from what I can tell, none of the EAX calls that FarCry makes (at least the ones that the Steam version makes) really make sense. It would be interesting to know the history here, but I don't think you're missing anything great. My advice would be to play without reverb and be content"

mirh commented 2 years ago

I wouldn't so easily assume that all FC versions are the same. At least on the graphics side it was known to have quite the number of regressions. I would try the demo/rtm and patch 1.3 if I were you.

Kappa971 commented 2 years ago

I wouldn't so easily assume that all FC versions are the same. At least on the graphics side it was known to have quite the number of regressions. I would try the demo/rtm and patch 1.3 if I were you.

Reading the changelogs of the various patches, nothing is indicated about EAX. I think jonpol has already tried version 1.0 in his Windows XP machine and Far Cry sets the same EAX values.

Rather we need to find out which commit in OpenAL Soft 1.21.1 broke Serious Sam's reverb.

mirh commented 2 years ago

The application may be having the same (more or less proper) behaviour, it doesn't mean that the drivers of the day processed the commands the same. Also, yes, patches didn't mention anything (except perhaps a 5.1 option) but they were infamous to broke more than they fixed without the slightest hint (just like further crysis patches outright axing features tbh)

Kappa971 commented 2 years ago

Well I wouldn't say, the various patches have brought a lot of graphical improvements. Patch v1.4 (32bit) caused a fixable bug. If the developers didn't know what they were doing when they implemented EAX, there is no one who can fix this as no one knows what the game should have sounded like.

mirh commented 2 years ago

Well, for starters we do have at least a missing reverb lead.. (and according to the last link I posted on vogons, FC1 seemed to share at least some idiosyncrasy of duplicate buffers with SS2 and MDK2)

Kappa971 commented 2 years ago

Unfortunately this is beyond my knowledge so I can't help. I think however, the problem needs to be solved in Far Cry and not in DSOAL so maybe we should close this issue and discuss Far Cry elsewhere. What do you think about it?