Hello everyone again !
I'm working on a platformer game and recently changed how music works. Currently the method is a bit overkill for what I need as right now I'm not using any specific looping points for anything but I have it in place since I plan to use that once I write better music for it. The problem I'm running into now is extremely unusual: after about 5-10 minutes of playing the game randomly stops playing music and some sound effects at random. This seems like I've got a memory leak somewhere but I can't track down where, and task manager doesn't seem to be indicating a high enough memory usage for that, so I'm at a loss as to what to do. I've attached the version of the game this is an issue with, just jump into any level (you can type "colours" on the main menu and click "ulock" to force all levels to be unlocked) and play for a while, switch screens a bunch to speed up the process. I've tried isolating this problem and I have no idea what's causing it, so if anyone has some insight that would be great.
Sound and music cut out after a while for no apparent reason.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Sound and music cut out after a while for no apparent reason.
Last edited by DTmg on Fri Oct 25, 2024 7:37 am, edited 1 time in total.
Re: Sound and music cut out after a while for no apparent reason.
Hi, I'm on my phone so I couldn't try your demo.
The only time I got this kind of mysterious bug where it would fail at random points each time I ran my program, it ended up being because of interactions between garbage collection and the FFI.
The solution was to store all FFI objects into a table -- into either the indices or keys, it doesn't matter. This prevented any of those objects from being collected while the code used them or used other objects created using them.
But in my case the program would actually crash, not just misbehave.
The only time I got this kind of mysterious bug where it would fail at random points each time I ran my program, it ended up being because of interactions between garbage collection and the FFI.
The solution was to store all FFI objects into a table -- into either the indices or keys, it doesn't matter. This prevented any of those objects from being collected while the code used them or used other objects created using them.
But in my case the program would actually crash, not just misbehave.
Re: Sound and music cut out after a while for no apparent reason.
Yeah I've had issues with FFI before, but I'm not using any FFI for my game here (mainly to keep cross platform easy)
- BrotSagtMist
- Party member
- Posts: 657
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Sound and music cut out after a while for no apparent reason.
Nice game, not the stuff i like to play tho.
I seem to be unable to trigger any bugs. Where yourself able to trigger it on more than just your own box?
I seem to be unable to trigger any bugs. Where yourself able to trigger it on more than just your own box?
obey
Re: Sound and music cut out after a while for no apparent reason.
I've gotten it to trigger on one other machine so far, so not a lot of variety, but this wasn't happening before at all when I was just playing the sound directly.
Re: Sound and music cut out after a while for no apparent reason.
Wow, this is really well made, great work.
I thought it was going to be just a standalone test to find the bug, not a full playable demo.
I managed to play this long/far:
I ran it with Love 11.4 on my notebook from 2015, it's Windows 8.1 x64, hard disk drive.
No problems with music, sound or other things, everything played fine.
I thought it was going to be just a standalone test to find the bug, not a full playable demo.
I managed to play this long/far:
I ran it with Love 11.4 on my notebook from 2015, it's Windows 8.1 x64, hard disk drive.
No problems with music, sound or other things, everything played fine.
Re: Sound and music cut out after a while for no apparent reason.
Dang it might just be me then, I don't know. It happened most often while I was using the level editor, so I'm not sure if that's connected in any way, but thanks for testing it anyway, worried I might have to rewrite the music system now...
Re: Sound and music cut out after a while for no apparent reason.
I'm not sure what was causing it but after changing a seemingly unrelated part of the code it magically stopped? So, consider this solved I guess, still have no idea what has caused it.
Re: Sound and music cut out after a while for no apparent reason.
I played the first handful of levels and then left the game running for half an hour.
The music still played.
(Linux Mint on an older Thinkpad with love 11.4)
The music still played.
(Linux Mint on an older Thinkpad with love 11.4)
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests