I think I fixed Diablo II audio causing stuttering

Discuss Median XL!
Lunia
Skeleton
2 | 9
Hello,

as you all know Diablo II (especially MXL) can stutter like crazy if you have the game's audio enabled.
The parameter "-ns" resolves this issue entirely, however I really wanted to have audio so I tried to look for a solution.

After fruitlessly trying a couple of DirectSound wrappers and all of their settings I decided to take a look at the Sounds.txt and bingo.

When you change all the values in the "Stream" column from 0 to 1 on every sound in the Sounds.txt and put it back into the MXL MPQ the stutters are completely gone.

Before:
Image

After:
Image

I was able to replicate it consistently. The stutters are simply gone entirely. I assume this also works for vanilla D2 and Path of Diablo etc. by modifying their respective MPQ files as well.

Here's a link to a modified MXL.mpq (2.2.8) file if you want to test it yourself. Make sure you back yours up first and start the game through Game.exe and not the MXL Launcher since it'll just replace it again. I'm guessing you also don't wanna go into the online multiplayer with a modified MPQ file.

Hopefully this works for everyone and can be implemented into the next update natively if it does.
User avatar
whist
Team Member
634 | 557
Legendary Popularity Badge
Has a thread with over 250.000 views
Legendary Love Badge
Earned over 500 cookies
Legendary Contribution Badge
Median XL Team Member
Interesting. What is this graph you display in both screenshots, and how is it calculated? We'll look into testing this out in the current ongoing beta and possibly implement it in the upcoming patch, thanks for sharing.
Lunia
Skeleton
2 | 9
whist wrote:Interesting. What is this graph you display in both screenshots, and how is it calculated? We'll look into testing this out in the current ongoing beta and possibly implement it in the upcoming patch, thanks for sharing.


It's the FPS graph overlay from MSI Afterburner, had to use Glide with the D2DX wrapper to get that working since it's easier to visualize the stuttering that way.

Here are two quick videos to compare:

Before: https://streamable.com/wma0yk
After: https://streamable.com/3qao9m

However I've found a side-effect from this change which is also audible in the video. It seems the ambient (or something else?) sound starts to become really high-pitched and persistent. You can especially hear it once the Corrupted Abbey zone pop-up appears in the 2nd video, there's a high-pitched undertone the entire video that ramps up once I enter the Corrupted Abbey. I'm guessing some sounds aren't very cooperative with the "Stream" setting.

EDIT: The ringing sound does appear to be ambient related as it changes pitch based on the zone I'm in, here's an example: https://streamable.com/c7ggi9

UPDATE: Yep it's the ambient sounds not reacting well to the stream setting, I got the ringing to stop by changing the stream column on line 54 to 206 (some of the ambient ones) back to 0.

Now it's stutter + ringing free as seen here: https://streamable.com/cau7xe
I guess you need to be somewhat selective in which sounds are streamed and which aren't.
impsy
Imp
5 | 1
Common Supporter Badge
Donated 1 time
Lunia come back please I need an updated fix :( - lag is quite miserable with sound on as necro and I am unable to compile the files properly myself