1.21.1 Neoforge - jukeboxes won't play, ambient sounds cut out
Charleychar opened this issue ยท 39 comments
I saw that people in issues #233 and #234 were having more or less this exact same problem and that it was then fixed in a newer version. However, I have the most up-to-date version for neoforge 1.21.1 ( ver 6.0.5) and am still getting it. I also have the most up-to-date creative core version for neoforge 1.21.1 (ver 2.12.8):
Extra info that might be useful
- /playsound command sometimes won't play sounds from the mod, or in-game music
- the issue with jukeboxes not working happens even with just creative core on its own
Just tested, and the issue with the sounds restarting when unpaused is fixed, and it seemed like the ambience was working and the jukebox was playing discs, but after a few minutes all the ambient sounds cut out and the jukebox stopped working:
issue.still.there_sounds.stop.mp4
I cannot reproduce this issue. For me the newest version works just fine. Can you enable the command /ambient-debug and record a video of you reproducing the issue?
Sure, here it is (this was with 6.0.5 and 2.12.8):
ambient.sounds.cutting.out_discs.not.working.mp4
I fixed that sounds are played again once the game is unpaused, this might fix your issue. Can you test the newest version?
Can you use the command /cmdclientconfig and disable playSoundWithOffset? See if that fixes the issue?
Can you try out this version for a while and see if the issue still occurs? Even if the issue is "fixed" can you still send me the log file?
Still happening. It all works for a few minutes, then it gets to night and it struggles to play night ambience, and eventually all the ambient noise, as well as the jukebox, stops working.
6.0.7.issue.still.there.mp4
here's the log:
latest.log
I don't think so. I noticed this issue before I got the most up-to-date versions. The ones I had before were 6.0.4 (ambient sounds) and 2.12.5 (creative core)
Just tested with 6.0.4 and 2.12.5 and got the same issues - pausing and resuming caused ambient sounds to stop and then jukebox didn't work.
I can't see any more of those errors in the log. It ran totally fine.
This is so amazing well done man.
latest.log
Ok ... I think I finally found the reason why it crashes in the first place. The log was very helpful. Can you try out this version and see if it works?
https://www.dropbox.com/scl/fi/heyqmn8axvo1ayotyo1ey/AmbientSounds_NEOFORGE_v6.0.7_mc1.21.1.jar?rlkey=8hr58rydiowrsitswhe5wzvj9&st=j00ctkw3&dl=1
Really hope that finally fixes the issue ...
Just tested in the world with the rest of my mods. It lasted longer this time, but still crashed in the end. That error in the log I noticed before is still there.
Is there anything else I can be on the lookout for, either in the logs or in-game, that might help more?
here's the log:
latest.log
Ok ... a bit disappointing. Can you try out this version?
https://www.dropbox.com/scl/fi/heyqmn8axvo1ayotyo1ey/AmbientSounds_NEOFORGE_v6.0.7_mc1.21.1.jar?rlkey=8hr58rydiowrsitswhe5wzvj9&st=sn6j0szk&dl=1
At least I can see a correlation to when it fails. To give you a little more insight.
AmbientSounds skips a random amount of bytes to start the sound with offset. As the position of this jump is random the library first needs to find a working sequence therefore it scans for some time till no error occurs anymore. Seems like everything is fine when it scans 6 chunks ... and almost failed every time it scanned 4 chunks. So I set the limit up to scan at least 6 chunks ... but apparently things did not work out if it scans 8 chunks ... that's what I'm trying to fix with this version.
It seems to still be having an issue. Though now I think it's getting stuck at 6 chunks judging by where the errors are in the log, but you can probably make more sense of it than I can.
I'm sorry man I know the feeling of not being able to fix a bug. This one is definitely a boss-level bug so good luck.
Indeed that one is pretty annoying, but I'm overly happy to have you as my tester ... just worried that you get annoyed at some point.
It seems like it always works if the seeking runs into an issue once ... so I keep repeating the seek until an error occurs or after it searched for at least 32 chunks. We shall see how that one goes.
It's still cutting out in places and it eventually just cut out completely in the test I just did.
It seemed to work fine in the other world I was running with only ambient sounds and creative core, like I literally sat there for an hour with no issues. Is it possible that worldgen mods are causing an issue when it scans chunks?
here's the log:
latest.log
Ok there was something wrong with my equation.
Ok I think it's working properly now the sound didn't cut out. The error in the log is still there but only happens after 16, 18, or 32 chunks.
latest.log
That's awesome! Finally ... I would love to do one more test ... I set the limit of how many chunks to scan to something quite high. My worry is that if I don't set a limit there might be a rare case where things never run into an error because the skip was perfect.
It seems to be working fine now, but I'm not sure what changed. I waited quite a while - much longer than usual - to see if the sounds would stop or the jukebox would break before I disabled playSoundWithOffset, but everything was fine. I have disabled it now, I just don't know if it's making a difference. I'll let you know if it stops working again.
here's the log for that session:
2024-08-28-4.log
Alright. Just wanted to make sure this is the cause of the issue. I have done another change. Can you enable this option again and test this new version (including the log file)?
https://www.dropbox.com/scl/fi/heyqmn8axvo1ayotyo1ey/AmbientSounds_NEOFORGE_v6.0.7_mc1.21.1.jar?rlkey=8hr58rydiowrsitswhe5wzvj9&st=7ks051qi&dl=1
To explain you what is going on. AmbientSounds starts a sound at a random position, this is done to make the sounds more diverse (to hear different parts of the audio file every time). Somehow this causes a crash in the sound engine. I'm still not sure why and it only seems to affect certain computers. Would be very helpful if you can continue to test as I have no way to reproducing it myself.
Sorry for all the trouble. Thanks a lot for all the time you spent on this so far!
No worries I'm happy to help! Thanks so much for getting back to me so quickly. I'll have a go with that version.
Ok so the ambient noise is playing fine, but playSoundWithOffset might have something to do with the jukebox breaking at least:
playSoundWithOffset.bug.mp4
here's the log:
latest.log
Ok, all my attempts to catch the error did not succeed. Problem is that playing the sound with offset causes a crash of the sound engine in your case. For me it works just fine. I have absolutely no idea. I need to somehow collect more information. Can you use get this version and send me the log file once more?
https://www.dropbox.com/scl/fi/heyqmn8axvo1ayotyo1ey/AmbientSounds_NEOFORGE_v6.0.7_mc1.21.1.jar?rlkey=8hr58rydiowrsitswhe5wzvj9&st=0czn87uz&dl=1
For the tests this setting needs to be enabled.
Just tried with that version and I tried turning playSoundWithOffset off and on again a bunch of times and played music discs in-between and there were no issues. The setting being enabled/disabled didn't seem to make a difference.
here's the log:
latest.log
here's the log of another session I did where I left playSoundWithOffset enabled the whole time. Everything ran fine.
latest.log
Thanks for your tests. I still struggle to understand why the crash occurs in the first place. Seems like the random skip at the beginning goes through without any issues. So it might be a thread sync issue, which would be quite weird.
Can you try out this version?
https://www.dropbox.com/scl/fi/heyqmn8axvo1ayotyo1ey/AmbientSounds_NEOFORGE_v6.0.7_mc1.21.1.jar?rlkey=8hr58rydiowrsitswhe5wzvj9&st=ldw1zr3o&dl=1
I changed a little thing which makes it more inline with how vanilla plays the sounds.
This is very odd. Just tried with that version, and it was all working fine for a few minutes, then the issue came back - jukebox stopped working, night ambience wouldn't play when it got dark etc.
And then, it started working again. All I had done was turn playSoundWithOffset off and on again, but that could be a complete coincidence because it wasn't an immediate change.
night ambience not playing:
https://github.com/user-attachments/assets/67731a57-12ca-4e32-99a3-0bab3c217f7d
it seemingly fixes itself:
https://github.com/user-attachments/assets/a52a8347-9306-4991-9e00-04602ee91d5d
here's the log:
latest.log
Tested again. I waited for quite a while, but the sounds never stopped entirely. It did rain in-game and the swamp sounds struggled to play after it stopped, but other than that it ran fine.
I had a look at the log and noticed this error come up a few times:
hopefully that's useful in some way.
latest.log
Here we go again:
https://www.dropbox.com/scl/fi/heyqmn8axvo1ayotyo1ey/AmbientSounds_NEOFORGE_v6.0.7_mc1.21.1.jar?rlkey=8hr58rydiowrsitswhe5wzvj9&st=ldw1zr3o&dl=1
You do not need to test it long. Just load it in with playSoundWithOffset enabled. Let it run until sound engine crashes, then post the latest.log here.
I was just playing in a different world with the rest of my mods in, and the sounds cut out much sooner than in the last session with just ambient sounds and creative core. The /playsound command also stopped playing music.
here's the log:
latest.log
I'd love to help out!
I'm not much of a programmer as I only know a bit of C#, but I'm a pretty decent sound hunter I would say.
Yeah, you do not need to program. It's more about creating a concept how a village could sound like and what the sounds depend on. Finding good sounds is often the most time consuming part. Sounds have to be free to use.
Do you have some ideas of how a village should sound like (what should be in there)? Also I think villages in certain biomes should sound different.
NICE! Finally ... this was a long ride. Will try to release it soon. I cannot thank you enough for your effort. Sorry that it took so long. You have done me a huge favor. Is there anything you wish AmbientSounds would have? Cannot guarantee anything, but I feel like I owe you something.
I'm glad to have been helpful, and thanks so much for being so responsive! Don't worry about taking a long time, I've been stuck with bugs for weeks and weeks before, and I think it took a very reasonable amount of time for a bug like this.
As for suggestions, I can't think of much off the top of my head, but perhaps some ambience for villages? Like, faint chattering during the day, maybe a dog barking in the distance at night. Something like that might be cool, if it's not too difficult.
Thanks again!
New version is out which finally releases this issue. Thanks a lot for taking the time!
About the village ambience. I tried to implement it ... but it just does not work. I think it needs some extra care. I thought about individual sounds for a certain type of villager. For example have a sound for the farmer, the blacksmith, etc.
Problem is that I do not have the time to do this on my own. So if you have some free time and enjoy helping out, we could create an issue on github and brain storm what kind of sounds could be used to create a convincing village atmosphere for each village type (forest, desert, swamp, etc.). Let me know what you think!
Again thanks a lot for your help!