Framerate drops are a huge problem on the Galaxy S4

I did this:

local physics = require( "physics" ) physics.start() -- display ball image local ball = display.newImage( "Icon.png" ) ball.x = 145; ball.y = 200 -- add physics to the ball physics.addBody ( ball, { friction=0.5, bounce=2 } ) local prevTime = system.getTimer() local fps = display.newText( "30", 30, 47, nil, 24 ) fps:setFillColor( 1 ) fps.prevTime = prevTime local function enterFrame( event ) local curTime = event.time local dt = curTime - prevTime prevTime = curTime if ( (curTime - fps.prevTime ) \> 100 ) then -- limit how often fps updates fps.text = string.format( '%.2f', 1000 / dt ) end end Runtime:addEventListener( "enterFrame", enterFrame )

And I’m getting normal 50-60 fps results.

Rob

Rob, 

I copied your code above pasted into a blank main.lua. I put the the main.lua, icon.png, build settings, and config.lua into a folder and ran it in the simullator.  My result is still 50 - 100…

Thanks

Can we see your config.lua and build.settings?

Rob

Let me test it on Windows.

Rob

Config:

application = {
    content = {
        width = 320,
        height = 480,
        scale = “letterBox”,
        fps = 60,
        
        --[[
        imageSuffix = {
            ["@2x"] = 2,
        }
        --]]
    },

    --[[
    – Push notifications

    notification =
    {
        iphone =
        {
            types =
            {
                “badge”, “sound”, “alert”, “newsstand”
            }
        }
    }
    --]]    
}
 

Build:

– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

settings = {
    
    orientation = {
        default = “portrait”,
        supported = { “portrait”, }
    },
    
    iphone = {
        plist = {
            UIStatusBarHidden = false,
            UIPrerenderedIcon = true, – set to false for “shine” overlay
            --UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

            --[[
            – iOS app URL schemes:
            CFBundleURLTypes =
            {
                {
                    CFBundleURLSchemes =
                    {
                        “fbXXXXXXXXXXXXXX”, – example scheme for facebook
                        “coronasdkapp”, – example second scheme
                    }
                }
            }
            --]]
        }
    },
    
    --[[
    – Android permissions

    androidPermissions = {
          “android.permission.INTERNET”,
      },

    ]]–
}
 

Thanks again

Just adding to talk.  I just tested this on my Windows machine and both 30 and 60 FPS are close to their respective values (slight deviations of less than 1 FPS).

I ran with the latest build: 2015.2646 (and 2015.2644 before I updated).

Questions:

  • What version of Corona are  you running?
  • What video card are you running?
  • Have you checked that your driver is up-to-date?
  • If you run task manager, how does your CPU usage and memory usage look?
  • Got any background processes (Virus scanners, other heavy hitters?) or is your machine idle during the tests?
  • How much memory and what CPU + Freq?  (Probably not the issue, but checking anyways)

Some of these questions are just me throwing stuff at the wall, hoping something sticks.

Hi roaminggamer,

I have tested this on 2 seperate Windows 7 64bit computers.

What version of Corona are  you running?

Tested on v2014.2511 and 2015.2642 on both machines

What video card are you running?

1st PC MSI Nvidia GTX 760  2nd PC AMD Radeon HD 5450

Have you checked that your driver is up-to-date?

Both are up to date and not on beta

If you run task manager, how does your CPU usage and memory usage look?

Both machines run at minimal (5 - 7 %) CPU Usage and 20 - 28 % physical memory.

Got any background processes (Virus scanners, other heavy hitters?) or is your machine idle during the tests?

happens if Virus scanners are enabled or disabled

How much memory and what CPU + Freq?  (Probably not the issue, but checking anyways)

1st PC

Intel Core i5 3.3GHz

8Gb DDR3 1600

2nd PC

Intel Core i3 3.30GHz

12Gb DDR3 1333

Thanks!

Well I think we are chasing a red herring here.  What we need to be determining is why the framerate is dropping on the S4.   We are in the middle of testing all our samples right now and no one is reporting  performance problems on the S4 that I am aware of. 

Lets get back to focusing on the S4 issues.  What happens if you build SpriteTiles for your S4?

Rob

Sorry the the side-track there.   :wacko:   I thought maybe this was being seen in the simulator and on the device.  

Cheers,

Ed

Ed,

It is being seen in the simulator as well.  The interesting thing is that today when I was getting ready to build the sprit tiles project the jump from 50 to 100 has stopped in the simulator on my home PC which is where I noticed it last night.  However, it is still spazzing out every few seconds.  Really high and low frame rates then just smooths out to 60 plus or minus a few.  I will be interested to see what it does on my work computer tomorrow. 

Anyway, I have the sprite tiles built at 30 and 60 fps but I do not have my phone with me.  I will update the thread when I have the results.

Thanks again!

Rob

The SpriteTiles at 30fps is pretty stable… at 60fps it is also pretty stable exept for around every 5 seconds it has a bit of a jump and drop. 

Evidently the simulator still has issues with this when going to 60fps, but knowing the simulator has this issue vs hardware makes me feel a little better moving forward. 

To top things off I reinstalled the game on the S4 without changing any of my code and it is a lot more stable. Confusing…  but I guess that comes with the territory.

Thanks again