**REPORTED** Music slider shoves itself back to 0%?

From a dev-side, this is a very difficult fix to work on, because none of us can reproduce it, and it doesn't generally produce error logs. We believe we are aware of the cause and have an experimental fix which will arrive in the next hotfix (which does not have a current release date).
It doesn't produce error logs because the errors are explicitly ignored in the game's code. Instead of crashing with an error message, the game sets the volume to 0.

If you can't reproduce the problem, you can make a diagnostic build that reports audio errors and allow people experiencing the error to test it and report the crash messages. Everywhere audio errors are ignored and volume is set to zero would either be removed or explicitly report the error.

Error suppression should not be required because audio errors should not happen unless something is broken.
 
If you are one of those "lucky" people who can reliably reproduce the bug, you can try using the patch I made to diagnose the issue.

If the included files are in the same folder as the Terraria.exe (1.4.1.1 steam windows only) you can run patch.bat to produce Terraria_AudioCrash.exe

If you run Terraria_AudioCrash.exe from the Terraria folder (you need to open steam first) when the audio system fails the game should hopefully crash with a useful error message. The patch fixes nothing, it just tries to make sure you get a useful error message when something goes wrong. If you do get some useful information be sure to report it here.

Sadly I can't say for certain the patch works because my audio has worked perfectly everytime I tested the patch.

Edit: I have received a useful bug report, so there is no longer any need to test using this patch.
 

Attachments

  • AudioCrash.zip
    1.9 MB · Views: 289
Last edited:
It doesn't produce error logs because the errors are explicitly ignored in the game's code. Instead of crashing with an error message, the game sets the volume to 0.

If you can't reproduce the problem, you can make a diagnostic build that reports audio errors and allow people experiencing the error to test it and report the crash messages. Everywhere audio errors are ignored and volume is set to zero would either be removed or explicitly report the error.

Error suppression should not be required because audio errors should not happen unless something is broken.

Not denying that. Rather, its an issue that changing the error diagnostics would have to wait until the next hotfix, which means then an ACTUAL fix would have to wait until the following hotfix after that as well. Since hotfix timing is usually not dictated by any single bug, this would be a longer wait than if we attempt a fix in the short term.

However, I am relaying a lot of your info to Yoraiz0r, so if any of it comes in handy, he'll have it available. Thanks. :)
 
[QUOTE = "Leinfors, postagem: 2149635, membro: 43"]
Não estou ciente de uma correção específica do lado do usuário para esse problema.

Do lado do desenvolvedor, essa é uma correção muito difícil de trabalhar, porque nenhum de nós pode reproduzi-la e, geralmente, ela não produz logs de erros. Acreditamos estar cientes da causa e ter uma correção experimental que chegará no próximo hotfix (que não tem uma data de lançamento atual).

Suspeita-se que a causa é que certos PCs não conseguem carregar corretamente todos os arquivos de música quando o jogo está iniciando (devido a uma combinação de quantas músicas adicionamos no 1.4, algumas alterações de back-end que fizemos no carregamento de música, e uma correção na qualidade do arquivo de música que aumentou o tamanho dos arquivos de música em 1.4.1).

Por que alguns PCs podem lidar com isso e outros não, não temos certeza, mas causa uma "falha de música" que impede a música de funcionar pelo resto da sessão de jogo. Ou essa é nossa teoria operacional atual, de qualquer maneira.

Saberemos melhor assim que pudermos lançar a correção para ele, mas ainda não estamos preparados para fazer isso.
[/CITAR]

Coloco todas as minhas esperanças em você, enquanto toco ao som do bom e velho heavy metal
 
If you are one of those "lucky" people who can reliably reproduce the bug, you can try using the patch I made to diagnose the issue.

If the included files are in the same folder as the Terraria.exe (1.4.1.1 steam windows only) you can run patch.bat to produce Terraria_AudioCrash.exe

If you run Terraria_AudioCrash.exe from the Terraria folder (you need to open steam first) when the audio system fails the game should hopefully crash with a useful error message. The patch fixes nothing, it just tries to make sure you get a useful error message when something goes wrong. If you do get some useful information be sure to report it here.

Sadly I can't say for certain the patch works because my audio has worked perfectly everytime I tested the patch.

I follow these steps and the game gave me this crash message:

mew.jpg
 
I follow these steps and the game gave me this crash message: ...
Thanks for making my hack useful.

The game uses way more memory during loading than it does during the actual game and sometimes ends up running out while trying to load the file that contains music. "Wave Bank.xwb" is a very large file that contains the entirety of the game's music and makes up roughly half of the game's size on disk. It is unsurprising that the game would crash while attempting to load it entirely into memory all at once. Terraria is a 32bit application, so it can crash even if you have more memory physically available in your computer.

Stardew valley also uses the same audio system and has at times suffered from this exact issue.

The random nature of this bug could mean this problem may decrease in occurance instead of being completely fixed if aggressive actions to reduce peak memory usage are not taken.

If someone is desperate for a fix, I could try to make a patch, but what a hack can do is limited and unreliable compared to an official fix that you probably won't have to wait long for.
 
Thanks for making my hack useful.

The game uses way more memory during loading than it does during the actual game and sometimes ends up running out while trying to load the file that contains music. "Wave Bank.xwb" is a very large file that contains the entirety of the game's music and makes up roughly half of the game's size on disk. It is unsurprising that the game would crash while attempting to load it entirely into memory all at once. Terraria is a 32bit application, so it can crash even if you have more memory physically available in your computer.

Stardew valley also uses the same audio system and has at times suffered from this exact issue.

The random nature of this bug could mean this problem may decrease in occurance instead of being completely fixed if aggressive actions to reduce peak memory usage are not taken.

If someone is desperate for a fix, I could try to make a patch, but what a hack can do is limited and unreliable compared to an official fix that you probably won't have to wait long for.

Well, im desperate for it but i really miss the in game music, so it would be really cool if you do that and of course i can test it if you do that.
 
Well, im desperate for it but i really miss the in game music, so it would be really cool if you do that and of course i can test it if you do that.
Okay, I made an attempted fix for you. This fix won't stop trying to load the music until successful. If this does not work, I can try a more invasive hack that recreates the entire audio system after every loading failure.

Edit: Not too optimistic about this fix, probably won't help unless your audio issues are rare.
Edit: Removed download for this fix, since the other fix works much better.
 
Last edited:
Okay, I made an attempted fix for you. This fix won't stop trying to load the music until successful. If this does not work, I can try a more invasive hack that recreates the entire audio system after every loading failure.

Well, the game stays on black screen for like 10 minutes and it seems to crash withouth a message (in my case, dunno if somebody already test it)
 
Well, the game stays on black screen for like 10 minutes and it seems to crash withouth a message (in my case, dunno if somebody already test it)
I'll take a look and see if I can prepare a more aggressive fix. Are you using a 32bit operating system?
 
Yup, its a pretty old pc
I tried reordering the loading of game assets to hopefully give the sound a better chance of getting loaded. Don't wait too long for the game to load, since it will retry forever on a failure.

Install Instructions:
Extract the provided zip file into a folder. Copy Terraria.exe (Steam Windows 1.4.1.1) into that folder. Run patch.bat. Copy Terraria_AudioLoadReorder.exe into the Terraria Folder. Make sure steam is open. Run Terraria_AudioCrash.exe from the Terraria folder.

Edit: added instructions
 

Attachments

  • audioloadreorder.zip
    1.9 MB · Views: 806
Last edited:
I tried reordering the loading of game assets to hopefully give the sound a better chance of getting loaded. Don't wait too long for the game to load, since it will retry forever on a failure.

Okay, now its working normally, if i find any issue or any song not working ill tell u, thanks a lot ^^
 
Same problem on GOG version.
Tried to delete config file. Tried to reinstall the game. No positive result.
PS: Windows XP, 32bit.
 
I tried reordering the loading of game assets to hopefully give the sound a better chance of getting loaded. Don't wait too long for the game to load, since it will retry forever on a failure.
How would you go about patching the game? I can't seem to find anything online, and I really want to be able to listen to the game's music when playing. Thanks in advance.
 
Same problem on GOG version.
Tried to delete config file. Tried to reinstall the game. No positive result.
PS: Windows XP, 32bit.
I don't have GOG version, but anyone with moderate technical skills can patch it, so you or someone else can make a patch.
How would you go about patching the game? I can't seem to find anything online, and I really want to be able to listen to the game's music when playing. Thanks in advance.
Decompillation tools for c#, the language that Terraria uses, are extremely good and not too difficult to use. If you want to recreate the patches I made you only need to download dnSpy. It can modify the game and create a new exe. If you want to redistribute your modified exe you will want to make a patch because it is probably illegal to redistribute the full game executable without permission from Relogic. (I use flips to create bps patches for redistribution.) If you have the GoG version and are able to make good progress on patching the exe but still need a little help, you can PM me and I might be able to help a bit. It would be best to nominate someone with basic programming experience who can do it without any help.

The first modification I made that probably helps the steam version to work is in Main.LoadContent_Deferred(). I moved "AssetInitializer.LoadAssetsWhileInInitialBlackScreen();" down from the top of the function, to after all music loading code. The second modification is in Main.LoadMusic_InSteps() I reordered soundbank and wavebank loading so the wavebank is loading first. The end result of these changes is that lots of graphics and audio files used to load before before loading "Wave Bank.xwb" but they will now load after it. That file is oversized so it has a better chance of loading earlier in the loading process when there is less memory usage and memory fragmentation.
in Main.LoadContent_Deferred()
Original: (the ... is a section left out to keep this post smaller)
Code:
            yield return null;
            AssetInitializer.LoadAssetsWhileInInitialBlackScreen();
            yield return null;
            bool doneLoadingMusic = false;
            IEnumerator musicLoadProcedure = this.LoadMusic_InSteps();
            while (!doneLoadingMusic)
            {
                ...
            }
            this._musicLoaded = true;
            Main.splashTimer.Start();
Changed:
Code:
            yield return null;
            bool doneLoadingMusic = false;
            IEnumerator musicLoadProcedure = this.LoadMusic_InSteps();
            while (!doneLoadingMusic)
            {
                ...
            }
            this._musicLoaded = true;
            AssetInitializer.LoadAssetsWhileInInitialBlackScreen();
            Main.splashTimer.Start();
in Main.LoadMusic_InSteps()
Original:
Code:
            Main.soundBank = new SoundBank(Main.engine, "Content\\Sound Bank.xsb");
            Main.waveBank = new WaveBank(Main.engine, "Content\\Wave Bank.xwb");
Changed:
Code:
            Main.waveBank = new WaveBank(Main.engine, "Content\\Wave Bank.xwb");
            Main.soundBank = new SoundBank(Main.engine, "Content\\Sound Bank.xsb");
This is definitely not a proper fix and hopefully not the only changes Relogic will make to fix it. There will always be a risk of crashing as long as "Wave Bank.xwb" continues to be a very large file and is fully loaded into memory. Switching to streaming audio or splitting the audio into many small files might be a better solution. Both of those changes are also possible via a patch, but I don't want to waste effort or resort to modifying game content files for something that will be fixed in an official patch soon.
 
Last edited:
Back
Top Bottom