Framerate drops after a few minutes in Mac

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
AaronWizard
Citizen
Posts: 68
Joined: Sun Nov 06, 2011 2:45 pm
Location: Canada

Re: Framerate drops after a few minutes in Mac

Post by AaronWizard » Sat Jun 02, 2012 3:39 am

On your suggestion, I've attached versions of my game (one .love file, one Mac app) with an FPS meter in the caption. I can confirm that it hovers around 60 FPS during normal gameplay. When it freezes the FPS meter drops to zero, if it manages to update at all.
Attachments
WarpRun.zip
Mac app
(5.63 MiB) Downloaded 43 times
WarpRun.love
(1.28 MiB) Downloaded 53 times

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Framerate drops after a few minutes in Mac

Post by coffee » Sat Jun 02, 2012 6:57 am

AaronWizard wrote:On your suggestion, I've attached versions of my game (one .love file, one Mac app) with an FPS meter in the caption. I can confirm that it hovers around 60 FPS during normal gameplay. When it freezes the FPS meter drops to zero, if it manages to update at all.
I have good and bad news for you. For the first time i got that freezing slowdown. During gameplay I had all keys and I was heading/searching warp to second structure. Started to freeze in a totally random situation. The good of this is that I have some guess now of what's going on. For me It looks like a sound problem. I had other sound problems long ago with another game, Ellohir zombie's game (viewtopic.php?f=5&t=3940) that would almost lock after a while if sound on. I reclaimed but that sound problem never was fixed and only with sound off would be playable. Try to play it (it's a 0.7) game and see if same problems happens to you.

Force quitting and reading what log crash manager wants to send to apple I have the feeling that audio part of love there is too big (looping?)

So, I think could end be several things like:
- Some bad audio sample specifically badly eaten by osx
- your code or the audio manager lib isn't dealing well with some situation (in osx)
- Love/audio osx frameworks could have some issue.

User avatar
AaronWizard
Citizen
Posts: 68
Joined: Sun Nov 06, 2011 2:45 pm
Location: Canada

Re: Framerate drops after a few minutes in Mac

Post by AaronWizard » Sat Jun 02, 2012 5:10 pm

Aw man, now I have to debug my sound system again.

Did anyone figure out the problem with the zombie game? It seems after reading the thread that all that anyone came up with was a setting to turn the sound off completely.

All my sounds are .ogg files, all exported from Audacity. All 16-bit PCM and 44100Hz. All but one were stero, and I've since changed the single mono sound to stero to match.

And now to explain how my sound manager works, in case someone notices something wrong.

My SoundManager (sound_manager.lua) is meant to handle sounds and sound attenuation (couldn't figure out OpenAL). It keeps a table of SoundData objects indexed by file name, which are used to create Source objects whenever I want to play a particular sound. Used up Source objects are also kept around in a table indexed by file name so that they can be reused instead of creating a new Source object to play a certain sound again.

So if I want to play "bot_attack.ogg", it first checks if there's already a Source object for that file in the used-up Source pool. The existing Source is removed from the pool and replayed if such a Source exists. If a new Source has to be made, it creates one from the SoundData object for that file, creating it if necessary.

When a Source is finished playing (it has stopped) it is added to the used-up Source pool.

Source objects are actually wrapped in a sound table to contain some other information. This includes position, so that way I can do sound attenuation in a simpler manner than OpenAL. A sound may also be specified as "unclearable" and as "persistent".

The SoundManager has a clear function that manually stops and removes all active sounds, which I use when changing the scene. Unclearable sounds are ignored by the clear function, and are only removed when they finish playing naturally.

Persistent sounds get to stay in the SoundManager table of active sounds even when they're stopped, though they still get removed with the clear function. This is used for looping sounds that I stop and start manually, namely the walking sounds and the sound that the green cubes make when they're sparkling.

I also have a pair of streaming sounds I create an manage outside of SoundManager that I use for the background ambience.

User avatar
Lafolie
Inner party member
Posts: 804
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Framerate drops after a few minutes in Mac

Post by Lafolie » Sat Jun 02, 2012 6:31 pm

I managed to clear a whole stage without it freezing. I've tested it several times and the only time it crashed was when I started a new game in fullscreen. It crashed before I could move the player and I had to cmd-optn-esc to get out of it.

I love the 'starburst' mystery box weapon by the way! Though you may want to tweak the sound volumes when using it, it is somewhat abrupt.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.

User avatar
conroy
Prole
Posts: 46
Joined: Thu May 24, 2012 3:33 pm

Re: Framerate drops after a few minutes in Mac

Post by conroy » Thu Nov 08, 2012 10:59 am

I can say with confidence that this issue is almost resolved. I've tested a version of 0.8.1 that uses OpenAL Soft on OS X and it works wonders. I was getting crashes in a few minutes on my game. With the new version, I couldn't make the game crash.

Hopefully, OpenAL soft will land in master soon. I'm eagerly awaiting a 0.8.1 release.

User avatar
Lafolie
Inner party member
Posts: 804
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Framerate drops after a few minutes in Mac

Post by Lafolie » Mon Nov 12, 2012 7:42 pm

Those errors you quoted from the console are a consequence of something in the Löve binaries. They have nothing to do with your project (and I can't wait for them to be gone!).
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 10 guests