B Info Other Optimization Announcement: Sound and your Mods

Users who are viewing this thread

xenoargh

Grandmaster Knight
I've been testing what's been causing so much lag, frustrating lockups, and other problems in Warband under DirectX 9, especially when playing mods like mine.  This has been a constant complaint by players of most of the big mods forever, and solutions haven't shown up in terms of engine patches. 

As some of you know, I'm a bit of a performance nut; I've done all sorts of things to try and make Blood and Steel perform as well as possible.  My mod was one of the first Warband mods to make LODs for practically everything, for example, and lately I've been doing shader optimizations and other fun tricks.

While all of that improved people's framerates, it didn't stop people, including myself, from having horrible problems with seemingly-random lockups that would halt the game state. 

After many tests, I am fairly confident that I've pinpointed the problem and have found a solution.  It turned out that problem isn't graphics at all; HERR_BUFFER_LOCK errors were a symptom of CPU lock states happening, not the result of running out of VRAM. 

The real lockup issue appears to be sounds.  In particular, the sound format. 

I found this out after doing several tests with sounds off.  This pretty much solved my problems with lockups and lag, which I found intriguing.  Since I didn't want to play Warband without audio, I looked at this issue further, and found that Warband supports multiple audio formats, like a lot of modern engines that are using various sound loader systems.  It also became apparent that the early engine builds were developed to use WAV, and that OGG support was added much later.

So I tried something simple; I converted all of the OGG files (including all of the Taleworlds sounds) to 16-bit 22kHz mono WAV (note that there are a few Taleworlds sounds that are WAV- leave them exactly as they are), then changed all of the Module System code to point to the WAV files instead of the OGG files.

The results have been extraordinary; thus far, I haven't had a single HERR_BUFFER_LOCK error.  Period.  Considering that I had this problem to the extent that I was very lucky if Warband didn't completely lock up during every battle (it was so bad that I was used to hitting ALT-ENTER at least once a battle, and sometimes even that didn't work) this is amazing, and may resolve a lot of players' problems with your mods.

In short, please try this out, especially if you're a modder whose hardware has also had trouble with Warband.  I think you will find, like I have, that this resolves a great number of issues.
 

Fierce Headmaster

Hi! My name is Skippy.
Count
M&BWB
HA! I was trying to solve that lately. Thanks a lot!

Kept thinking it had something to do with the number of troops until I had the lockup in a 1vs20 battle. Then I had no clue. Gotta change those sounds now.

(just to be sure, the lockups you had are those who keep exchanging between the current frame and the previous 3-4, huh?)
 

xenoargh

Grandmaster Knight
the lockups you had are those who keep exchanging between the current frame and the previous 3-4, huh?
Exactly.  This also makes the arrival of new troops much smoother, in terms of CPU delays; I've seen 50+ troops spawn with just a tiny hiccup, whereas previously it took nearly a second before framerates settled down.

I've reported this as a bug in the tracker, but since we have no idea whether Warband bugs will ever get patched now that WFaS is available, I thought I'd share.

Oh, and testing indicates that music files can remain OGG; they're supposed to be in a streaming format, and changing them to WAV probably isn't a good idea.
 

xenoargh

Grandmaster Knight
It's almost certainly hardware-specific.  I, like most people nowadays, am using onboard audio.  It's been a constant problem for me since I bought Warband, and it's taken quite a bit of testing to finally pin it down.
 
Very interesting. Thanks for sharing. I guess I should convert the sounds for 1257 as well then and see how it goes.
 

xenoargh

Grandmaster Knight
Yeah, just give it a shot, especially if (like me) you're having problems playing your own creation.  In my case, it's been a silver bullet; I'd like to hear what other people's results are  :smile:
 

xenoargh

Grandmaster Knight
Not without a great deal more experimentation. 

I'd guess that OGG, WAV 22kHz 16-bit mono, WAV 44kHz 16-bit mono, and WAV 11kHz 8-bit mono are all supported, since those types are all present.  I don't see any stereo formats, but you really don't need stereo for SFX or dialog.  I don't know for sure about any of it except for 22kHz 16-bit mono, which I picked because it's a dead-standard format and the quality's fine for SFX.
 

xenoargh

Grandmaster Knight
Haven't the foggiest; I don't know anything about the old engine, honestly, so IDK when OGG support was added.  My guess is yes, it may help, but most of the people having this issue are, like me, people who want to play the game in DirectX 9+, which is where this problem seems to become acute.
 

Cruger

Nice! I have sometimes experienced it before, and didn't get what the hell was going on.

I will definetly try this out.
 

xenoargh

Grandmaster Knight
Glad this appears to be helpful.  I have yet to have a crash since I did this, and I've been in and out of tests for hours now... I think it may actually work.  Now I just need to scoot a release out the door and see what it does to the end-users  :twisted:
 

theAthenian

xenoargh said:
I've been testing what's been causing so much lag, frustrating lockups, and other problems in Warband under DirectX 9, especially when playing mods like mine.  This has been a constant complaint by players of most of the big mods forever, and solutions haven't shown up in terms of engine patches. 

As some of you know, I'm a bit of a performance nut; I've done all sorts of things to try and make Blood and Steel perform as well as possible.  My mod was one of the first Warband mods to make LODs for practically everything, for example, and lately I've been doing shader optimizations and other fun tricks.

While all of that improved people's framerates, it didn't stop people, including myself, from having horrible problems with seemingly-random lockups that would halt the game state. 

After many tests, I am fairly confident that I've pinpointed the problem and have found a solution.  It turned out that problem isn't graphics at all; HERR_BUFFER_LOCK errors were a symptom of CPU lock states happening, not the result of running out of VRAM. 

The real lockup issue appears to be sounds.  In particular, the sound format. 

I found this out after doing several tests with sounds off.  This pretty much solved my problems with lockups and lag, which I found intriguing.  Since I didn't want to play Warband without audio, I looked at this issue further, and found that Warband supports multiple audio formats, like a lot of modern engines that are using various sound loader systems.  It also became apparent that the early engine builds were developed to use WAV, and that OGG support was added much later.

So I tried something simple; I converted all of the OGG files (including all of the Taleworlds sounds) to 16-bit 22kHz mono WAV (note that there are a few Taleworlds sounds that are WAV- leave them exactly as they are), then changed all of the Module System code to point to the WAV files instead of the OGG files.

The results have been extraordinary; thus far, I haven't had a single HERR_BUFFER_LOCK error.  Period.  Considering that I had this problem to the extent that I was very lucky if Warband didn't completely lock up during every battle (it was so bad that I was used to hitting ALT-ENTER at least once a battle, and sometimes even that didn't work) this is amazing, and may resolve a lot of players' problems with your mods.

In short, please try this out, especially if you're a modder whose hardware has also had trouble with Warband.  I think you will find, like I have, that this resolves a great number of issues.


Care to share your files please? I am so bored to do all of this converting xD

You saved us from quite some trouble too like the difficulty of finding a decent ogg player. I hate this format.
 

lord_olafson

We didnt try converting the files thats a interesting idea, i guess that could be quite usefull. Thx.
 

Adorno

Bedroom Assassin
Archduke
WBNWM&BVC
ithilienranger said:
I haven't ever encountered that error. Could my X-Fi card help avoid it?
I also have Creative X-Fi and have never encountered a HERR_BUFFER_LOCK error.
 

xenoargh

Grandmaster Knight
Yeah, my guess is that this problem is confined to certain chipsets.  I would be surprised if anybody with add-on sound for gaming are having this issue; my guess is that it's hitting a limit of the onboard chipset drivers, like maybe it's having to do some bass-ackwards approach to OGG to work at all, and eats a lot of memory and CPU, causing a lock.  I really shouldn't even speculate; whatever it is, it's stumped everybody for quite some time now.
 

Swyter

Grandmaster Knight
M&BWBWF&S
I suspect it has something to do with live decompression on CPU while Mount&Blade works under a single thread mask.
So, in specially stressed moments (in case of the lack of optimization of this game, that means always). That's somehow a problem.  :smile:

Edit. Look here:
3dguru.com said:
Why should I get a soundcard when my Motherboard has onboard sound?

I would say onboard sound is basically a marketing tactic used by motherboard manufacturers to sell an all-in-one solution. These soundchips undoubtedly have come along way since the first onboards, and would be fine for a basic office or home PC, but they still do not stand up to a quality add-in PCI card for many reasons.

Onboard sound chips need to use CPU cycles to process sound. This robs your sytem of performance. If your sound chip has EAX which alot of them do these days the issue is compounded usually degrading your performance somewhere in the area of 5-15 FPS in games. This is usually the reported number of FPS that users report getting when then install a PCI sound solution. This is not the worst issue though.

Thnx for sharing. The only problem I foresee is the disk space of uncompressed WAV format.
Four or five times bigger than traditional compressed audio like OGG Vorbis or MPG Layer 3. You know.
 
Top Bottom