Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / App randomly shut down. Is it from memory leak?

Author
Message
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 29th Oct 2012 21:25
For some reasons, the app randomly shut down. Is this from memory leak or something else?
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 29th Oct 2012 22:46
On which operating system(s)? On which devices? Any crash reports? Which version of AppGameKit are you using?

2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 29th Oct 2012 23:36
It runs fine on window, but when using my android phone with 2.3 OS it'll shut down randomly. I'm using 1.076 AGK.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 29th Oct 2012 23:43 Edited at: 29th Oct 2012 23:43
If you could, providing some sensible code would help much. Unless you've got lots of it / want to protect it.

Follow me on twitter! @MotionStruct
Motion Struct blog
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 29th Oct 2012 23:55
Hm... I know the app didn't shut down when I didn't add any music.

Do you guys know if there's a bug with playMusic command? What's the best way to change music?
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 30th Oct 2012 00:13
Could it be that you missed something so you load the song many times and crashes the app?

How large is the song and wath format?

Do you loop the song?

Have you tested to make an ogg version of it and see if it helps.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 30th Oct 2012 00:22 Edited at: 30th Oct 2012 00:23
It appears it has something to do with play music commands. When I disable all codes related to play music, the app never shut down yet. I load two .mp3 music files (both are less than 15 seconds long) before the main loop.

Below is what I use to switch music, but not sure if it's the optimal way. What codes do you guys use to switch music?

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 30th Oct 2012 00:42
its very simple as you cant play more then one song at the time.
Try to stop any music playing before you start playing any new songs.

This is stated very clearly in the documentation

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 30th Oct 2012 01:11
That's what I did in the code.
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 30th Oct 2012 01:15
I had a similar issue with The Black Hole App. See the thread http://forum.thegamecreators.com/?m=forum_view&t=201091&b=41 where are contributions for AppGameKit testing team.
It seems that the problem is associated to Nexus 7 with Android 4.1.
I am afraid that stopping and starting music does not clear the issue. In my app the following piece of code does exactlu what you suggest:

So before playing the MP3 files associated to a given stage, the current music is stopped. According to doc, stopMusic() can be used even if no music is playing: in this case it returns 0.
Question: if Mr. 2D is using Nexus 7, we have hit the target 99%, otherwise additional info could be useful.
Hope it helps.
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 30th Oct 2012 02:00
I'm actually using Motorola Droid X 2.3 OS, but on my Galaxy Nexus 4.1 OS my app crashes way more often. I've decided to not release my app for android 4.0+ because AppGameKit is very buggy at this point.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Oct 2012 02:12
Hopefully I've fixed this for the next 108 beta, let me know if you still experience problems once it is released.
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 30th Oct 2012 02:46
I've did several testing and concluded that playMusic() has a memory leak in it.

If I disable all the playMusic() commands, it runs perfectly fine.

If I use playMusic(), over time the app on my android 2.3 phone will shut down on it's own. The playMusic() command works fine on Window because my laptop is more powerful than my android phone.

Solution: I will not use any music command, but sound effects only.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 30th Oct 2012 07:36 Edited at: 30th Oct 2012 07:48
Its probably only an issue on the android player.
I have found a few buggs while using agk that are specific to only the android player.

And paul confirmed that it will be fixed for the next release.

And android sandwich is an problem for alot of dev tools for android.

I dont know that much about jelly bean?

You could convert the tunes to wave until the music bugg is fixed.

Mp3 have the same size in memory if iam not wrong?

They are only compressed until you play them.

Edited....
I missed the part where you stopped the music.
My excuse is that i have an terrible coold and are sick

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Oct 2012 17:01
Quote: "I load two .mp3 music files"

You say that you load 2 files, but your code references 3 music ids. I'm betting that, assuming you actually do only load 2 files and they are #2 and #3, your game crashes every time game.stage gets set to 3.

Cheers,
Ancient Lady
AGK Community Tester
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 30th Oct 2012 19:43 Edited at: 30th Oct 2012 19:52
I wish that was the case, so I could fixed it. I actually type the codes here, but the actual code in my game only reference 2 music id.

I even tried to reference 1 music id only by deleting the previous one and load new music for the same id to see if it makes a difference.

Again, it runs fine on Window, but over time it'll crash on my android phone OS 2.3 using the .APK file.

Do you think the TGC developers can review my codes to see if it's truly related to PlayMusic Bug?

Have anyone created an app that involve multiple music files running on their android phone and run it for over 10 minutes without crashing?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Oct 2012 23:06
The specific bug that has been fixed is that when a music track comes to a end the music finished event was being handled on the wrong thread which could cause a crash.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 31st Oct 2012 19:44
I can also confirme that this bug dosent happen on all android devices.

I tested it on my dmtech 10 inch pad with android sandwich and it crashes the app after an mp3 sometimes ends.
Or simply stops playing when its supposed to loop.

But on my zte skate with android gingerbread so does the game run as it should with no crashes and loops the music as it should.

At a terrible frame rate after all my ultrabook enhancements but it runs

Android is terrible to get things to work on all kinds of specs and devices.

I noticed this as i tested my touch controls on my android devices until paul and the boys have them ready for the win player.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 1st Nov 2012 19:35
@Cliff Mellangard 3DEGS

Are you loading multiple music files on ginger bread without the crash? I know it runs fine with a single music file, but when I load 2 mp3 files (each are less than 20 seconds) after 5 minutes or so...it'll crash on gingerbread. It runs fine on window though.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 1st Nov 2012 20:13
Quote: "Are you loading multiple music files on ginger bread without the crash? I know it runs fine with a single music file, but when I load 2 mp3 files (each are less than 20 seconds) after 5 minutes or so...it'll crash on gingerbread. It runs fine on window though. "

Its my platformer game where i loop the songs until they are not neaded.
And no! i dont load multiple songs at the same time as you can only play one song at a time
It could be a problem if you loaded more then one song at a time also on droid it self?
I know that some older android versions had problems with playing even multiple sound files at the same time.
But this is an confirmed problem with the mp3 files on agk by paul j,and they have fixed it for the next update.

I only noticed this weird mix of crash and working on my android devices when testing my game on them.

I fade in and out music and loop them.
When i load an new tune so do i fade it out and stop it and then load the next music and plays it.

Its easier if you hear at my tube movie so do you hear wath i mean
My english is not that good always to explain it right.



Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 2nd Nov 2012 01:10
Cliff - that looks and sounds great!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 3rd Nov 2012 12:50
Quote: "Cliff - that looks and sounds great!"

Thanks jim
Its my ultrabook entry and i have its own thread in the showcase.
Dont want to hogg this thread

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 5th Nov 2012 20:29
I'm the one who got the error on Marco's The Black Hole.
I was using Nexus 7 w. jelly bean.

I'm posting here mainly to subscribe to this thread to see if/when things are fixed. I'm finally getting some time to develop two of the apps I've been planning so I'm paying more attention to what's happening with AppGameKit as I really believe in the product and would love to use it.

There are a lot of us here and I imagine between us there are many different devices. I wonder if it would be possible to create a group of folks who are dedicated testers for apps across devices. I'll post something on it in its own thread as to not hijack this one.

MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 7th Nov 2012 00:11
Ahah! I found my (complaining) customer ! The bug shall be fixed in the next release, maybe in the new beta.
Quote: "This should be fixed for the next version. The music finished event was handled on the wrong thread and could cause a crash."

Testing team is already operational. Check Ancient Lady and others people in this forum (kamac as far as I remember). I sent them the app to let them check. In fact they helped me to address the issue, so they could help you too.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th Nov 2012 00:57
@Marco
Great to hear! I look forward to the fixed app.I'm also happy to test if needed (please see my other thread http://forum.thegamecreators.com/?m=forum_view&t=201314&b=41)
I'm very interested in building support for developers on many levels (product design, play testing, marketing, etc.). These areas are where my skills are strong and they are weaker in coding which I will, as before, rely on the TGC community for help. I hope to give back all I can.

Login to post a reply

Server time is: 2024-05-07 19:16:40
Your offset time is: 2024-05-07 19:16:40