Log in

View Full Version : [TEC] BRAKING DISCOVERY !!! 2 CHANNEL SOUND FX CAUSE 100% CTD!!!


Bartholomew Roberts
08-05-23, 02:50 AM
It all begins as I was patching KSDII ctd bug of zooming in a group of sailors in SubPen. I thought it lacks the sound effect binding to the model.
https://www.subsim.com/radioroom/showthread.php?p=2878034#post2878034

https://img1.imgtp.com/2023/08/01/YxOkosW7.jpg

I found the model in Harbor_kit.dat with effort.

https://img1.imgtp.com/2023/08/01/BJYUBrWR.jpg

I delete the model, still ctd.

I delete the whole sub, still ctd.

Then I found a virtual node called SpeechKaleun in proximity.

https://img1.imgtp.com/2023/08/05/6ly0oEWq.jpg

I delete the node, solve the problem.

And that's not the end of it.

Why? Because I saw exact the same node in DW's file and that dose not cause CTD. So the problem is not the node itself, but something connecting to it.

So I opened the Harbor_kit.dsd and saw the node is connecting to KaleunSpeech.wav in Sound folder

https://img1.imgtp.com/2023/08/05/U3ArRFjx.jpg

Thus it must be the wav file causing the whole thing. I took a file called Fanfara_01.wav as a target for comparison since this is a 100% workable file I know. I made a mod rename the file to KaleunSpeech.wav and hear the music.

At first I thought of bit rate, Fanfara_01 has 300k/s while KaleunSpeech has over 1.6M/s, I downgrade the wav still CTD.

Then I guess it was the priority conflict as new sound are all classed as 128 so I changed it, still CTD.

I came to a stall, I played the two sounds file side by side thinking all the other possibilities.

Suddenly I had an idea, I opened the properties of both file and saw the difference.

The Fanfara_01.wav has 1 channel, the KaleunSpeech.wav is 2 channeled.

I convert the file to 1 channel and problem solved!

But, wait a moment, remember I said DW has the same node and sound file. If my logic is correct then why no ctd there?

I opened the properties of KaleunSpeech.wav in DW and guess what? It has only one channel ! Perfect.


Here is the conclusion.

Two channeled sound could be ambient background for interior, or could be binding directly to 3D object (whether it works still unclear), for radio ( I heard you could not save while playing it so better made 1 channel)

But in most cases, sound fx is binding to a virtual node as a point in the model or scene. If you use sound file with two channel in such places, you get 100% ctd within the max range of sound effect. Guess there could be no 2 channel from a single point so the game engine can not handle it.

That explains a lot of mysterious ctd like nearing port or under airstrike, siren and speech sound are 2 channel for some mods, and ctd connecting to enemy destroyer, Destroyer_hyd for some mods is 2 channel. Convert the file to one channel this problem could easily be fixed.

Now I can save and load near port without ctd.

Strongly suggest all modder check their sound fx files to make sure they are all 1 channel!

vickers03
08-05-23, 05:16 AM
thanks for the info and good work:up:

fitzcarraldo
08-05-23, 07:24 AM
Good work! :Kaleun_Applaud:

Fitzcarraldo :Kaleun_Salute:

propbeanie
08-05-23, 05:23 PM
Good detective work. Those audio problems can be extremely tough to track down. CapnScurvy used to say "when in doubt, emulate Stock". That especially applies to the wav sound files. When adding a new file, find a similar existing use file, and copy it's bit-depth, resolution and channel count, and in the SH.sdl file, set it up as the similar existing set-up is there in the Stock game. Some sounds should not be over five seconds long. Some should not be over 15 seconds long, and others (mostly the "amb" sounds) can be quite long. If you are replacing a sound in an existing mod, it is best to copy the settings used for the file off of a similar use in the Stock game, just in case the original modder did not... :roll: :arrgh!: