Dynamic Surroundings

Dynamic Surroundings

51M Downloads

[1.12.2] Duplicated sounds (Jukebox)

LiskoSlayer63 opened this issue ยท 14 comments

commented

Everytime when I try to play music through the vanilla jukebox or some other music sources, the music plays duplicated. I mean that it starts playing it twice and it sounds terrible, like you opened two tabs on youtube at the same time.

Dynamic Surroundings version: 3.4.7.2, 3.4.8.5, 3.4.9.0, 3.4.9.1, 3.4.9.2 (Yeah, I really tested them all..)
Forge version: 14.23.1.2586
Minecraft version: 1.12.2

commented

Can you attach your client log? Also, is this modpack available online somewhere?

commented

I did some research and seems that it conflicts with MrCrayfish's Furniture Mod (v4.1.5). Both of these mods works fine when they're alone, but together they duplicate the sounds.

Client log: latest.log

commented

Ah. Good old Crayfish. I will take a look.

commented

I see Crayfish has his mods hidden behind adfly. It's going to be a while - adfly is a stain on the internet.

commented

Can you just use his CurseForge page or GitHub source page?

commented

Cool! I can use that. Adfly is a haven for malware. Also found this on his issue page on curse: https://minecraft.curseforge.com/projects/mrcrayfish-furniture-mod/issues/39

EDIT: and this: https://minecraft.curseforge.com/projects/mrcrayfish-furniture-mod/issues/36

commented

Yeah. Looks to be a bug in CFM. I can see multiple sound requests coming into the sound manager via the WorldClient. Not sure what it is thinking.

commented

I don't use a decompiler, I just cloned his GitHub repository to my pc and look at it. Stil lcan't figure aout what is causing it.

commented

@OreCruncher I think I found where the duplicating happens. CFM makes another copy of RenderGlobal to the Mirror and then calls setWorldAndLoadRenderers((WorldClient) event.getWorld()); when world loads. If I change it to use the same RenderGlobal without making another one, then the music plays like it should.

I assume that there's another RenderGlobal just because there's config option to disable clouds on the mirror. It works fine when using only one renderer, but you cannot disable the clouds.

commented

That matches up from what I recall of the call stacks I looked at. I think Crayfish needs to take a look at that.

commented

Yeah, I hotfixed it for myself by just doing this to the another renderer:

@Override
public void playRecord(SoundEvent soundIn, BlockPos pos) {}

@Override
public void playSoundToAllNearExcept(EntityPlayer player, SoundEvent soundIn, SoundCategory category, double x, double y, double z, float volume, float pitch) {}

@Override
public void broadcastSound(int soundID, BlockPos pos, int data) {}

@Override
public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) {}
commented

I would have understood this better if it would happen only with his "Stereo", but it also happens with the vanilla Jukebox. I'm looking at his source code and all I can find is simply worldIn.playRecord(pos, records.get(tileEntityStereo.count).getSound()); in his onBlockActivated.

commented

Yeah - its difficult looking at it via a decompiler. My suspicion is that it has something to do with world listeners and that there may be multiples of them registered client side. I didn't dig into it to find the bug in CFM, just enough to make sure it wasn't me. :) I can see the sounds coming in via a world listener and down into my sound manager replacement code. Nothing else in between.

commented

Makes sense. I'm going to close this issue out since it belongs on the CFM side. Let me know if you come across any other strangeness.