Page 1 of 3

11.1 app randomly crashes when looping an OGG file

Posted: Wed Jun 13, 2018 6:06 am
by molul
It has taken me a long time to catch this bug. I was having random crashes, and this morning, that home was silent, I noticed two consecutive crashes happening right when the ogg file I use for background music finished.

Also, before that, I noticed that sometimes the looping randomly starts with an ugly click sound. Not sure how to prepare a project to attach here to check the problem as it's really random (sometimes it happens a few times in a row and sometimes it doesn't happen for days), but I think I could ask if it has happened to anyone else, or if there's anything I should check on an OGG file that might be causing this.

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Thu Jun 14, 2018 6:01 am
by zorg
Is it only ogg files that do that to you? Do check whether its bitrate is larger than 320 kbps (ogg can go up to 450 iirc; not sure if thats an issue though)

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Sun Jun 17, 2018 9:10 am
by molul
I think it also happened when I tried mp3 (I switched back to ogg, because the looping event had a much more annoying beep sound).

The bitrate is 192kbps.

I'll test today with mp3 to make sure. Thanks!

EDIT
I keep getting random crashes when music loops. I'm using a mono 16bit ogg file now (it was 32bit stereo before). Should I use a different file type/settings?

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Sun Jun 17, 2018 10:51 am
by zorg
You can try to see if that narrows it down to a decoder issue, or something else; you are looping it with just setting the loop properity on the source object, right? Or are you doing more advanced shenanigans? :3

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Mon Jun 18, 2018 6:52 am
by molul
Hehehe. No, I'm just setting the loop property :)

I had to test with another song (and another program to encode it), but I totally forgot, sorry. I'll try a few things before coming back.

[EDIT]
It happened on several settings and formats, but I think I found a workaround: setting the audio source to static instead of stream. The "click" sound glitch when looping the song is gone, and so far I've had no random crashes (not 100% they're gone, but the lack of "click" sound might be a proof).

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Mon Jun 18, 2018 7:15 pm
by zorg
The lack of a click may only mean that the static version (which is guaranteed to always just store all samplepoints with a given sampling rate) can loop more seamlessly than ogg or mp3 files could, since at least the latter stores data not exactly in that way, so it might not be able to accomplish that.

Still, i do remember this being the solution for some people, so i'm glad it worked for you; still, sadly no idea why the streaming sources have issues like this.

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Sun Aug 12, 2018 10:46 am
by ivan
Same problem here. Just upgraded my game to 11.1 and now there are random glitches, squeaks and an occasional crash.
The game just shuts down, no error message or console log.
Any tips, other than using static sources?

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Sun Aug 12, 2018 11:08 pm
by DekuJuice
I released a demo recently and one of the testers also had the game crash without an error message. I assumed the problem was something to do with his system since nobody else reported the same issue and I couldn't recreate it myself, but this might be the cause of it. Looking into the code for streaming ogg files is probably a good start to figure out what's happening.

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Wed Aug 15, 2018 10:37 am
by ivan
Furthermore this issue seems to be more apparent when using several streamed sources.
Would be good to add this to the Love2D issue tracker.

Re: 11.1 app randomly crashes when looping an OGG file

Posted: Sat Dec 22, 2018 8:17 pm
by Jaston
Both issues happen to me as well. Crashes love2d and doesnt even leave an error. Using love2D 11.2.

My game loops a bunch of ogg and wav files. Static is needed or ilI hear pops.

Ok I figured out more. The more streaming sources you make and play at the same time the faster it crashes :).
You can take the example I made and make it play 30 of those looping sounds and it will crash in a min or less :).