Jerky app - help!

Hi,

I develop an app about 2 years ago with Corona and it runs fine on my iPhone 4.

I’ve just made a little update to it, basically just used the widget library for some switches in the options but now when I build and install on my phone it’s really jerky.

Everything is jerky, sort of stuttering - any ideas why?!

Its even jerking changing ‘scenes’ using the director class.

Its unusable now!  

No assets were changed.   So why does code that  has not changed ie. the other scenes run jerkily?!   Weird!

HELP!!!

Here is my build setting

settings = 

{

iphone =

        {

                    

                plist=

                {

UIStatusBarHidden = true,

                                                UIApplicationExitsOnSuspend = true,                                 UIPrerenderedIcon = true,

                        CFBundleIconFile = “Icon.png”,

                              CFBundleIconFiles = {

                            “Icon.png” , 

                            “Icon@2x.png” , 

                            “Icon-72.png” , 

                            “Icon-Small-50.png” , 

                            “Icon-Small.png” , 

                            “Icon-Small@2x.png”

                        },

                },

        },

    orientation = 

    {

        default = “portrait”,

        supported = 

        {

        “portrait”,

        },

                    

    }

    

}

    

Here is the config 

if string.sub(system.getInfo(“model”),1,4) == “iPad” then

    application = 

    {

        content =

        {

            width = 360,

            height = 480,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

elseif string.sub(system.getInfo(“model”),1,2) == “iP” and display.pixelHeight > 960 then

    application = 

    {

        content =

        {

            width = 320,

            height = 568,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

elseif string.sub(system.getInfo(“model”),1,2) == “iP” then

    application = 

    {

        content =

        {

            width = 320,

            height = 480,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

elseif display.pixelHeight / display.pixelWidth > 1.72 then

    application = 

    {

        content =

        {

            width = 320,

            height = 570,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

    }

else

    application = 

    {

        content =

        {

            width = 320,

            height = 512,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

end

Hi @dweezil,

This may be hard to pin down. When was the last “smooth” version built, and using which build of Corona? Which version of Director is in there? “Jerky” can be the result of various things… but most often, maxing out texture memory is a cause of that (however, you indicate that no assets were changed). Anyway, we can try to help figure this out, but no guarantees it will be easy. :slight_smile:

Brent

Hi, first off let me say THANK YOU for helping me.  It’s appreciated.

In the simulator when I switch from scene 1 to 2 (main menu to the ‘about’ scene) I do…

system.getInfo(“textureMemoryUsed”)/1000000

And it reports 10 meg.   It that too much!?

The last smooth version was built about 1 month ago.    I’m using the latest version of Corona, 2013.1135 (2013.6.3)

The director is 1.1 but not changed since day 1.

I appreciate a lot has changed over the years but I’m sure I was using a recentish version of Corona with the last ‘smooth’ version of my app.    I wonder, I’m not setting a fixed FPS anywhere, has that changed in Corona ?

Hi @dweezil,

As a test, can you try building with Build #1076? It’s possible that was the same one you built with a month ago, but perhaps you were using a version before that.

The public release archive is located here:

https://developer.coronalabs.com/downloads/archive

Take care,

Brent

Tested 1076, same problem, jerky/stuttering.    Tried the build before that, same problem.

Tried removing the large background textures, still no good. 

Tried building for iPhone only, still no good.

So 10 mb texture memory isn’t too much?

Used the FPS code ( http://developer.coronalabs.com/code/output-fps-and-texture-memory-usage-your-app )

and the app is pretty much consistently running at 30 FPS but its still jerky!

Its even kind of jerky in the simulator (current and 1076), it’s a bit like a double buffering type issue. 

I don’t think it’s the version of Corona as other apps seem to run fine.

[UPDATE]

Put FPS = 60 into the build.settings and config.lua and used director 1.4 and all is fine.

Then I put FPS = 30 back in both and went back to director 1.1 and its still fine!

WTF!!!???

Very odd! So, if you omit the “fps” setting entirely, it’s jerky? But if you add it back in (30 or 60) it’s better? On both 1076 and 1135? If so, I’ll have to bring that up to the engineers and see if they know what’s happening.

Brent

No thats quite it.   Without it the menu seems OK but the physics are a bit jerky.  Sticking 60 in seems to make the physics smoother

Here is my build setting

settings = 

{

iphone =

        {

                    

                plist=

                {

UIStatusBarHidden = true,

                                                UIApplicationExitsOnSuspend = true,                                 UIPrerenderedIcon = true,

                        CFBundleIconFile = “Icon.png”,

                              CFBundleIconFiles = {

                            “Icon.png” , 

                            “Icon@2x.png” , 

                            “Icon-72.png” , 

                            “Icon-Small-50.png” , 

                            “Icon-Small.png” , 

                            “Icon-Small@2x.png”

                        },

                },

        },

    orientation = 

    {

        default = “portrait”,

        supported = 

        {

        “portrait”,

        },

                    

    }

    

}

    

Here is the config 

if string.sub(system.getInfo(“model”),1,4) == “iPad” then

    application = 

    {

        content =

        {

            width = 360,

            height = 480,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

elseif string.sub(system.getInfo(“model”),1,2) == “iP” and display.pixelHeight > 960 then

    application = 

    {

        content =

        {

            width = 320,

            height = 568,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

elseif string.sub(system.getInfo(“model”),1,2) == “iP” then

    application = 

    {

        content =

        {

            width = 320,

            height = 480,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

elseif display.pixelHeight / display.pixelWidth > 1.72 then

    application = 

    {

        content =

        {

            width = 320,

            height = 570,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

    }

else

    application = 

    {

        content =

        {

            width = 320,

            height = 512,

            scale = “letterBox”,

            xAlign = “center”,

            yAlign = “center”,

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

            },

        },

        notification = 

        {

            iphone = {

                types = {

                    “badge”, “sound”, “alert”

                }

            }

        }

    }

end

Hi @dweezil,

This may be hard to pin down. When was the last “smooth” version built, and using which build of Corona? Which version of Director is in there? “Jerky” can be the result of various things… but most often, maxing out texture memory is a cause of that (however, you indicate that no assets were changed). Anyway, we can try to help figure this out, but no guarantees it will be easy. :slight_smile:

Brent

Hi, first off let me say THANK YOU for helping me.  It’s appreciated.

In the simulator when I switch from scene 1 to 2 (main menu to the ‘about’ scene) I do…

system.getInfo(“textureMemoryUsed”)/1000000

And it reports 10 meg.   It that too much!?

The last smooth version was built about 1 month ago.    I’m using the latest version of Corona, 2013.1135 (2013.6.3)

The director is 1.1 but not changed since day 1.

I appreciate a lot has changed over the years but I’m sure I was using a recentish version of Corona with the last ‘smooth’ version of my app.    I wonder, I’m not setting a fixed FPS anywhere, has that changed in Corona ?

Hi @dweezil,

As a test, can you try building with Build #1076? It’s possible that was the same one you built with a month ago, but perhaps you were using a version before that.

The public release archive is located here:

https://developer.coronalabs.com/downloads/archive

Take care,

Brent

Tested 1076, same problem, jerky/stuttering.    Tried the build before that, same problem.

Tried removing the large background textures, still no good. 

Tried building for iPhone only, still no good.

So 10 mb texture memory isn’t too much?

Used the FPS code ( http://developer.coronalabs.com/code/output-fps-and-texture-memory-usage-your-app )

and the app is pretty much consistently running at 30 FPS but its still jerky!

Its even kind of jerky in the simulator (current and 1076), it’s a bit like a double buffering type issue. 

I don’t think it’s the version of Corona as other apps seem to run fine.

[UPDATE]

Put FPS = 60 into the build.settings and config.lua and used director 1.4 and all is fine.

Then I put FPS = 30 back in both and went back to director 1.1 and its still fine!

WTF!!!???

Very odd! So, if you omit the “fps” setting entirely, it’s jerky? But if you add it back in (30 or 60) it’s better? On both 1076 and 1135? If so, I’ll have to bring that up to the engineers and see if they know what’s happening.

Brent

No thats quite it.   Without it the menu seems OK but the physics are a bit jerky.  Sticking 60 in seems to make the physics smoother