Sound Physics Remastered

Sound Physics Remastered

15M Downloads

Waterfall sound (from Effective) calculations causes lag spikes

egeesin opened this issue ยท 1 comments

commented

Bug description
It seems there's a performance issue with Effective and SPR. As far as I observed, there's falling water layer under the sea causes hundreds of calculations made by SPR and creates lag spikes with small periods if the waterfall sound source is in the simulation distance. But if waterfall itself exposed to air as intended, it doesn't lag.

In the upstream repository there's also similar issue. I tested same seed and location with SP v0.5.4 (vlad2305m) enabled and the graph is identical. There's a comparison in the screenshots section.

Steps to reproduce the issue

  1. Create a Creative world (Cheats On) with seed -3928481868936690376
  2. Execute /tp 251.8 66 -107
  3. Listen and observe waterfall sound source directly beneath. (If there's not sound, tinker with simulation distance and or try to break the sand blocks next to falling water.
  4. Alt+F3 to observe lag spikes.
    4.1 Go to SPR config and enable Performance logging.
    4.2 Check log.

Expected behavior
Calculating (or not calculating) waterfall sounds without causing lag spikes in the generated environments like mentioned above.

Log files
Summary:

...(thousands of same line)
[23:39:14] [Sound engine/INFO]: Total calculation time for sound ambience.waterfall: 0.0022 milliseconds
[23:39:14] [Sound engine/INFO]: Total calculation time for sound ambience.waterfall: 0.0021 milliseconds
[23:39:14] [Sound engine/INFO]: Total calculation time for sound ambience.waterfall: 0.0021 milliseconds
[23:39:14] [Sound engine/INFO]: Total calculation time for sound ambience.waterfall: 0.0021 milliseconds
...(thousands of same line)

latest.log

Versions

  • Minecraft 1.18.1
  • Fabric 0.12.12
  • SPR v1.18.1-1.0.4

Other mods

  • Cloth API 3.1.61
  • Cloth Config v6.1.50
  • Effective 1.1
  • Fabric API 0.46.2+1.18
  • Mod Menu 3.0,1

Extra
Temporary workarounds are adding "waterfall" to the regex blacklist like this: .*(rain|waterfall).*, muting ambient sounds completely in the vanilla settings or disabling SPR.

Screenshots (Optional)
2022-01-21_01 23 12
2022-01-21_01 23 26

if waterfall itself exposed to air as intended, it doesn't lag
2022-01-21_01 24 03
Same location and seed, different fork (vlad2305m)
2022-01-22_16 10 21

Related
Ladysnake/Effective#10
vlad2305m#39

commented

As they already said:
vlad2305m#39 (comment)

It is an issue by the mod spamming the sound. There is nothing that can be done on the sound physics side, except completely blacklisting the sound.