kcat / dsoal

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

Colin McRae Rally 04: sound bugs with latest version #69

Open francescoaracu opened 1 year ago

francescoaracu commented 1 year ago

As I said in the title, trying to play this game with EAX on leads to some bugs in sound playing. Notably:

Attaching logs for easing troubleshooting purposes. CMR04_logs.zip

kcat commented 1 year ago

Try using a newer DSOAL (found in the Actions tab). That log seems to be using an older version before it started using OpenAL's EAX extensions.

francescoaracu commented 1 year ago

Used the newer DSOAL version and also the latest OpenAL Soft (from its repo Actions tab), but it's the same strange behavior...

Attaching logs. CMR04_logs_updated.zip

kcat commented 1 year ago

A couple things I notice. The game uses deferred buffers, and at some point, runs out of hardware sources, which causes some Play calls to fail since it can't get a source. It seems to ignore the failure and set some EAX properties (which in turn causes an OpenAL error since it tries to set a source property without a valid source).

I'm not sure how much of this is normal behavior for the game, though. Perhaps DSOAL needs to more readily return sources for stopped/paused buffers (that would cause the buffer's EAX state to be lost, but maybe that's proper behavior for non-playing deferred buffers).

Are you able to make a recording of the game where the audio problem starts?

francescoaracu commented 1 year ago

Are you able to make a recording of the game where the audio problem starts?

I will try to do it today.

Anyway, could you think that the hardware sources problem could be (at least) mitigated with a modified alsoft.ini? I don't have the file in the game .exe's folder.

kcat commented 1 year ago

Anyway, could you think that the hardware sources problem could be (at least) mitigated with a modified alsoft.ini?

No, there's a fixed limit of 128 "hardware" sources since some games don't like more than that and won't recognize hardware acceleration if there's more.

francescoaracu commented 1 year ago

I re-tried to play the game with this release of DSOAL and OpenAL Soft and the problems are still there. alsoft.ini is placed in my %appdata% folder, with default settings. I also noticed that missing sounds are there even with Environmental Effects disabled in-game.

Video proof is here; other than missing notes by the copilot, even some sounds (e.g. when crashing) seems missing. Timestamps of the missing sounds are in the description.

francescoaracu commented 1 year ago

I was just wondering if trying an older version worked and... it works! I used r422 from here and all sounds seemed to be here. A little notation: copilot volume seems mixed down, with engine sound on the contrary boosted a bit. Reverb is working correctly set to 0 in alsoft.ini. I also put 1024 in sources switch.

kcat commented 1 year ago

It's probably due to the earlier version having a larger number of emulated hardware buffers (up to 256, instead of 128), so it doesn't run out like in the recent versions. I don't think that's a true fix, it just manages to work around the issue.

I think a more proper fix may be to remove the source from deferred hardware buffers after they finish playing. Or allow "stealing" sources from deferred hardware buffers as-needed.

francescoaracu commented 1 year ago

Tried latest release from ThreeDeeJay's fork but the problem is still there. Don't have any logs unfortunately.