mojira.dev

Jeroen van S

Assigned

No issues.

Reported

No issues.

Comments

I managed to inject the fix into the actual sound system now, it should now work for pretty much any minecraft release because the soundsystem code is not obfuscated and doesn't change every release. I tested it for 1.4.2 and 1.4.3pre at least. As usual, copy the contents into minecraft.jar and remove META-INF.

From the looks of it this is the same problem as MC-560. I've posted a fix in the forms of a mod in that bug report, as well as a description for Mojang about how to fix it. Maybe someone can verify that it's caused by the same bug by installing it?

After lots of messing around with this bug in MCP I eventually fixed it somewhat, although it is more than a workaround than a fix. I've attached the class files for 1.4.2 for those who are just as annoyed about this bug as I am. Install just like any mod: put .class files in minecraft.jar using 7zip or similar and remove the META-INF folder.

For Mojang:

The lag is caused by sndSystem.setListenerPosition in SoundManager.setListener when a lot of sounds go out of range at the same time; it is in fact not limited to the splashing sound, that one just gets played obscenely often in farms so it is most noticible with that sound. I couldn't check beyond SoundManager.setListener because MCP does not decompile paulscode (the actual sound system), but I assume it has something to do with sounds running at zero or negative volume or it trying to flush the buffer for a sound while trying to stop it or something.

The fix/workaround in the associated class files is as follows:

  • Maintain a hash map of all running sounds with their associated position (the actual sound system probably does this already but due to aforementioned reasons I could not access these classes easily).

  • Loop over them in setListener just before calling sndSystem.setListenerPosition.

  • Call sndSystem.stop for all sounds which are about to go out of range and remove them from the hash map.

P.S. I have never used this bug reporting system before, if I'm doing something wrong or am not supposed to upload the fix like this I do sincerely apologize.