Tesuji Games is nearing the release of its first "mobile toy" for the Android platform. Since the primary development phone around here is the Motorola Droid, I was excited to see Verizon begin rolling out the upgrade to Android 2.1 this week. Although I haven't yet received the upgrade, a friend has, and the results were...well, disappointing. Oh, I have no problem with the new features - they seem to work fine. And the live wallpapers? Very nice. My problem is with the performance of my application, which sees its framerate cut virtually in half when run on a Droid with 2.1.
Here is a video I made of two Droids running a test app I wrote to demonstrate the issue. (No, this isn't the eagerly anticipated debut release from Tesuji Games :-)
So what's going on? Both phones have virtually no other apps running (just what's necessary for the operating system to function). The test application is doing about as little as it possibly can do, at least from a game perspective. There is a loop that draws a black background bitmap, then the moving dot, and finally the text to display the frame rate statistics. Most games have a lot more work to do for each frame than this, so it would seem that the best frame rate one would consistently be able to achieve on a 2.1 Droid is 30 FPS. In case you are new to game design, that's not a particularly impressive number. 60 FPS is the accepted standard for smooth game play.
I did some digging with the Android debugging tools and found that there is indeed a difference in the CPU usage profile between the two phones. The process for the test app is called "org.lagtest". Check out these awesome pie charts (click for larger versions):
Droid with 2.0.1:

Droid with 2.1:

It looks as if on 2.0.1 the application is given more CPU to work with, and the "Idle" slice is smaller. (Why does Idle need so much time?) Still, the charts don't seem to explain the drastic difference in frame rate.
Just for grins, I snagged my wife's HTC Droid Eris with Android 1.5 to test on, much to her chagrin (At least she wasn't in the middle of composing an email):

Note that the Eris, which is significantly slower CPU than the Droid was still achieving 59 FPS consistently while running other apps such as email and weather, etc.
Anyway, if you want to check this out for yourself you can get the source code (as an Eclipse project ZIP) for the test application here.
If you just want to run the test on your phone, you can download the APK here.
If anyone has suggestions for a way around this, I'm all ears.
Thanks for doing this, Phil.
ReplyDeleteSo, you've misread this a bit. Idle doesn't "need time," per se. Idle is the amount of time that the CPU had nothing else to do. That probably means that your application was blocking on graphics I/O would be my guess.
ReplyDeleteI suspect that the scheduler issue I posted about here just got worse:
ReplyDeletehttp://groups.google.com/group/android-developers/browse_thread/thread/6f8e55045653f01d#
My data suggests that it is things blocking for two frames on the double buffering that kills the performance.
However, *why* the scheduler soaks up >16ms about 10% of the time is completely unknown.
Running the Cyanogen port (based on 2.1 code, with aosp patches) gives avg 58, min 30, max 62 after five minutes running.
ReplyDelete@Andrew: Your test program uses OpenGL, which I'm happy to say, did not appear to get worse in the 2.1 Droid update. I did an OpenGL version of Phil's test program and it averages nearly 60fps even with the update. However I did still experience the occasional outliers that you mention in your posting.
ReplyDeleteRunning ESE53 (Bugless Beast .9, Android 2.1) I am sitting at avg 57. Min=25, max=67. Will see what happens when he releases the ESE81 update.
ReplyDeleteThis is interesting as I noticed a little more lag then I would normally receive when playing Gameboid today. I'm not sure if this is related (not a programmer/developer), but interesting.
ReplyDeleteMine looked good, and maxed at 66 fps.
ReplyDeleteI get around 42 fps avg with the new 2.1, a lot better than your video. But, it's pretty wild and varies between high-50s (and I think even 60+) and down in the 20s, so I wouldn't exactly call it "good".
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI downloaded the test to my phone, and I'm getting interesting results. I'm running AdamZ's Smoked Glass v6.0 ROM, which is based on the ERE53 2.1 firmware. His kernal allows overclocking up to 1.1 Ghz. I usually run my phone at 800 Mhz, and, when I ran this test at that processor speed, I got excellent results...the display stayed consistently at 60 fps, with a min of 27 and a max of 68.
ReplyDeleteThen, I clocked my cpu down to 600 Mhz (close as I could get to the stock 550), re-ran the test, and immediately saw what this post is talking about. The display was consistently below 40 fps, with frequent momentary spikes to 60. The average was 37 fps.
The part I'm unable to test is the un-upgraded phone (I've no desire to remove the ROM I'm running...it's smooth as silk and completely reliable). These results certainly are disappointing...hopefully Google / Moto will get a fix out for this soon. In the meantime, hopefully this will encourage more Droid users to learn more about their phones so that they can get the most out of them by rooting and installing one of the excellent alternative ROMs that are out there.
I downloaded and installed your test app and used it before and after the 2.1 update. Average before the update was 51 fps, and after is 39, on Moto Droid. Lucky for me I don't game much on it.
ReplyDeleteI just got my update this morning and I had read this post when it was first up. I was not looking forward to the lag. I was playing a couple games on 2.1 that I played a lot on 2.0.1 and they ran like crap. Well not crap, but there was a substantial amount of lag. Tested using your app and I've maxed at 67, and am averaging 41. Now mine is completely different than your vid, though, because i am constantly above 40 and a lot of the time in 50. Its not TOO bad, but there is a difference.
ReplyDelete2.1 is a lot slower for emulators, nesoid, snesoid, gearoid, c64 all ran without frameskip on 2.0.1 and on 2.1update1 they all stutter like crazy. back to 2.0.1 for me :)
ReplyDeleteThanks for posting this. I upgraded to 2.1 this morning and ran your test program. Mine is running at 30fps for a short burst then 60fps. and its constantly (very quickly) switching back and forth between the two. I have noticed some slow down running other apps with 2.1
ReplyDeleteAny idea if the NexusOne has the same issue? Is this issue specific to the Droid 2.1 update, or is it common to 2.1 in general?
ReplyDeleteI am having the same problem around 38-40 fps i really want them to fix this problem because its extreamly annoying when its pretty much the first thing you see when use the phone
ReplyDelete@Peter: This problem (at least currently) seems to be limited to the Motorola Droid with Android 2.1-update1. All tests show the Nexus One getting an average of near 60 fps.
ReplyDeleteMy friend has a Nexus one, running 2.1. It does not have the issue with the low frame-rate. I tested my program side by side on the G1 (1.6) Droid (2.1) and Nexus One (2.1), the results make me want to cry - Both the G1 and Nexus One run at 60fps, the droid is crawling at 30~60 uneven speed. They screwed up something, that's sure.
ReplyDeleteThanks for marking out the differences...sometimes it gets so long to read the changed features that some are unable to do it.Reading such reviews help.
ReplyDeleteXbox hard drive
Nice blog you have here...I wonder if you like online games then you must like car games...you can play car games at this site Car Games. Also, you can play more game sites at Bike Games, Online Games, Kissing Games , Driving Games, Truck Games, Dress Up Games, Games for Girls, Addicting Games and Girl Games.
ReplyDeletecheck out some cool online Free Games including; car games, racing games / parking games, parking games / car parking games, / parking games, driving games, bike games / bmx games / dirt bike games, motorbike games, and car parking games / car games / parking games.
ReplyDeleteDO YOU WANNA PLAY AND DOWNLOAD LATEST VERSION GAMES IN ONLINE AND GET PAID FOR HIGH RATINGS,SO GO AHEAD click here
ReplyDeleteFOR MORE DETAILS AND OPEN FLOODGATES TO YOUR ONLINE INCOME.
ALL THE BEST
THANKQ.
That is very disappointing indeed...when you wait for something to launch in the market and eagerly with a lot of expectations and after that if it is a disappointment you feel horrible.
ReplyDeleteSidekick lx
game development company
ReplyDeletegames development companies
ReplyDeletedress up games
ReplyDeletehttp://www.gazzyboy.com
ReplyDeleteonline games
ReplyDeleteescape games
room escape games
Nice article, Thanks.
ReplyDeleteCar Games
Thank you, nice post
ReplyDeleteGirl Games
Car Games
Dora Games
Tower Defence
Hi My Favorite Sites
ReplyDeleteBaby Games
War Games
Football Games
Sports Games
Hi My Favorite Sites
ReplyDeleteBaby Games
War Games
Football Games
Sports Games
http://knowledgebase-games.blogspot.com/
ReplyDeletebraingames
ReplyDeletevery nice post
ReplyDeleteCar Game
Play Cartoon Games
BMX Bike Games
Racing Games
Driving Game
Play Bike Games
Motor Games
Car Parking Games
Hi My Favorite Sites
ReplyDeleteDress Up Games
Girl Games
Girls Games
Girls Games
Doll Games
Makeover Games
Bratz Games
Best Car Games Site
ReplyDeleteCar Games
great page.
ReplyDeletecar games
bike games
racing games
shooting games
cooking games
nice post.
ReplyDeletecar games, dirt bike games, racing games.
Play Free Games
ReplyDeleteOnline Racing Games Online Driving Games 4x4 Truck Games
Comments are appreciated related to this post, If you're a fan of online Flash games and want to share your views feel free to comment. If you've got another more interesting free..flash games
ReplyDeleteI love your blog. This is a cool site and I wanted to post a little note to tell you, good job! Best wishes!!!
ReplyDeleteOnline games multiplayer
World newspapers are spreading rapidly among the people. Not only the newspaper, also all world online television is helpful for its live view of news and games or programs.There’s no doubt that all world newspaper is so much helpful for the people, who needs to get updates of all the incidents happening around the world. They can also find all world online magazines list and all world online radio list in this website. No matter what option you choose, it’snot difficult when you have the lists and the media on your hand. So it’s clear that now there’s no option to wait and lose your times when we can manage to be aware of any incident happens around the world. To get more information visit@ allworldnewpapers.com
ReplyDelete