Mirsario / TerrariaOverhaul

A large mod for Terraria that focuses on increasing overall enjoyment of the game.
https://mirsar.io/Projects/TerrariaOverhaul
MIT License
188 stars 50 forks source link

Audio filtering may crash the game on uncommon audio configurations #185

Open KertIlm01 opened 1 year ago

KertIlm01 commented 1 year ago

Version Latest 1.4-stable

OS Windows

Platform Steam

This bug affects Gameplay as a Player

Description Hey,

I need some help with solving game crash. We have been playing with friend (I am hosting) for few days and we were playing yesterday also. Today when I started map the game crashes.

Crash happens when I start map and the game closes without any error popup and I also can not find any issues in the logs (Maybe I just do not know what to look for). Windows 10 tmodloader: 2022.9.47.47 Terraria: 1.4.3.6 overhaul 5.0.0.27(BETA 12C)

I have tried also crating new character and new map but even then the game crashes.

Overhaul is the only mod downloaded and enabled. When I disable this mod I am able to start new game with new character(Have not tried starting old map)

Only useful log I was able to find are below: Launch. log Windows Version 10.0 Quick Edit Disabled Verifying .NET.... Logging to C:/Program Files (x86)/Steam/steamapps/common/tModLoader/tModLoader-Logs/Launch.log Verifying installation directory... Fixing .NET SDL PATH issues mv: can't rename 'C:/Program Files (x86)/Steam/steamapps/common/tModLoader/Libraries/Steamworks.NET': Permission denied 'C:/Program Files (x86)/Steam/steamapps/common/tModLoader/Libraries/Steamworks.NET' -> 'C:/Program Files (x86)/Steam/steamapps/common/tModLoader/Libraries/steamworks.net/Steamworks.NET' Success! Parsing .NET version requirements from runtimeconfig.json Success! Checking for old .NET versions to remove from folder Cleanup Complete Checking dotnet install... Dotnet should be present in "C:/Program Files (x86)/Steam/steamapps/common/tModLoader/dotnet/6.0.0" Loaded Custom Arguments: Launched Using Local Dotnet server.log client.log Launch.log

KertIlm01 commented 1 year ago

FIGURED IT OUT.

The issue was my headphones. Cheked again the logs and saw fatal error in Natives.log at FAudio.FAudioVoice_SetEffectParameters

I played around a little with sound setting and uninstalled and reinstalled multiple times but nothing helped. Finally I realized that the only difference is that I am using different bluetooth headphones today. Disconnected then and like magic everything started working. The headphones I was using Bose QuietComfort Earbuds II

Mirsario commented 1 year ago

This is a really old problem, thanks for making a ticket for this, I forgot to. The following is a bot tag with workarounds from Overhaul's Discord:

There is currently a problem within Terraria Overhaul caused by FNA's FAudio that may result in an immediate crash to desktop when entering a world with an uncommon audio configuration. There is two workarounds.

Workaround 1: • Open Control Panel -> Sound, Playback tab; • Right click your default audio device, head over to its Properties ; • In the Advanced tab, set Default Format to 16 bit, 48000hz (DVD Quality), or closest available.

Workaround 2: • In Overhaul's config file, under the Ambience category, set EnableAudioFiltering to false; • Start or restart the game.


I've recently found exactly what triggers the issue, and it's these utterly sad hardcoded limitations in FAudio:

image image

Instead of PR'ing improvements to FAudio, however, I'm looking into the possibility of shifting burdens of handling reverberation to something like SteamAudio instead -- FAudio does have APIs for implementing custom filters.