Friday, April 2, 2010

2-D Graphics Slowdown After Motorola Droid 2.1 Update

UPDATE: I have logged a bug in the Android database at Google Code. It's been assigned to a developer for inspection. If you'd like to follow the status of the bug, go here and vote for it by "starring" it.

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.

46 comments:

  1. So, 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.

    ReplyDelete
  2. I suspect that the scheduler issue I posted about here just got worse:
    http://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.

    ReplyDelete
  3. Running the Cyanogen port (based on 2.1 code, with aosp patches) gives avg 58, min 30, max 62 after five minutes running.

    ReplyDelete
  4. @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.

    ReplyDelete
  5. Running 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.

    ReplyDelete
  6. This 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.

    ReplyDelete
  7. Mine looked good, and maxed at 66 fps.

    ReplyDelete
  8. I 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".

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. I 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.

    Then, 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.

    ReplyDelete
  11. I 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.

    ReplyDelete
  12. 2.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 :)

    ReplyDelete
  13. Thanks 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

    ReplyDelete
  14. Any 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?

    ReplyDelete
  15. I 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
  16. @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.

    ReplyDelete
  17. My 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.

    ReplyDelete
  18. Thanks 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.

    Xbox hard drive

    ReplyDelete
  19. DO YOU WANNA PLAY AND DOWNLOAD LATEST VERSION GAMES IN ONLINE AND GET PAID FOR HIGH RATINGS,SO GO AHEAD click here
    FOR MORE DETAILS AND OPEN FLOODGATES TO YOUR ONLINE INCOME.

    ALL THE BEST
    THANKQ.

    ReplyDelete
  20. 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.
    Sidekick lx

    ReplyDelete
  21. 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

    ReplyDelete
  22. 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
  23. Whether you are hard core gamer or just want a little more out of the experience,you owe it to yourself to seriously consider one of these top gaming headsets to upgrade your gaming audio to "High-Def"! Why do so many gamers play in high definition or plasma video while using crummy headsets or even T.V. speakers? http://63.250.38.187/Murahqq/

    ReplyDelete
  24. Online games gives you an ultimate gaming experience with a realistic environment, superb graphics and sound clarity. They are absolutely relaxing and are popular among people of all ages. Daftar Jurusqq

    ReplyDelete
  25. Users that choose to play games that are offered online are playing over a link in their web browser or through online communities. People that own a computer that operates Microsoft Windows may have a number of games programmed into their software system including backgammon, checkers, solitaire, chess, minds, and many more. Depending on the installation and options selected during configuring windows these components or gaming modules may be installed for all users to load up and play a few of the games online. 슬롯사이트

    ReplyDelete
  26. While there are tons of games out there that are graphically rich and meant to take advantage of your computers hardware to render realistic characters, environment and special effects, not a lot of us have the money to spend on gaming rigs to even be able to play these games. Fortunately though, there are also games that have been developed that you can play within your browser, making use of flash which doesn't need quite as much video processing power for you to play. 샌즈카지노

    ReplyDelete
  27. While many mainstream developers have been releasing a lot of graphically rich and intense games for the PC and various other platforms, many of them require your hardware to meet certain requirements and almost all of them can eat a huge chunk out of your wallet. Of course if you are looking for a way to kill time and have fun while doing it, there are still many free games that are being released by smaller developers. 메이저 토토사이트

    ReplyDelete
  28. There is nothing to beat the popularity of video games, with newer versions appearing quite frequently. Because of the never-ending demands for such products, the industry offering them has no option but to keep pace by producing additional varieties to replace the older editions. Much to the benefit of gamers, the market is flooded with an extremely large variety of games and the dynamic gaming industry has undergone many technological developments. سایت شرط بندی تتل بت

    ReplyDelete
  29. In this contemporary world, it has become liable to access each and everything with modern technologies; therefore, gaming peripherals are the best gaming devices which comfort the gamers who love to play the ideal games with easy and accessible device to play their skills. Similarly I would like to enhance my gaming skills with the best gaming devices in the future as well. However, there are innumerable gaming devices but some of the most colossal of them I have spotlighted below which can enhance the best gaming skills in the 2018 without any atoms of doubt. بازی انفجار آنلاین

    ReplyDelete
  30. In this contemporary world, it has become liable to access each and everything with modern technologies; therefore, gaming peripherals are the best gaming devices which comfort the gamers who love to play the ideal games with easy and accessible device to play their skills. Similarly I would like to enhance my gaming skills with the best gaming devices in the future as well. However, there are innumerable gaming devices but some of the most colossal of them I have spotlighted below which can enhance the best gaming skills in the 2018 without any atoms of doubt. بازی انفجار

    ReplyDelete
  31. Perhaps the most effortless approaches to get land leads is by buying them. There are organizations whose sole intention is to discover individuals who need to purchase or sell a property. They at that point offer this data to individuals who are eager to pay for it. So in the event that you are a realtor searching for land leads and either don't have the opportunity to locate your own, or basically don't have any desire to, at that point this might be a decent choice for you.



    https://www.paris-gestion-immobilier.com/role-gestionnaire-locatif-immobilier/

    ReplyDelete
  32. Hi! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your articles. Can you recommend any other blogs/websites/forums that go over the same subjects? Thanks!
    https://sm9268778.wixsite.com/hyatt55

    ReplyDelete
  33. Having played all the other Uncharted games, Rossco writes an article about his love of the series while awaiting the arrival of the 4th game. He talks about how Uncharted and Naughty Dog raised the standards of what to expect of an action adventure title, looking over the characters and the experience of playing Uncharted and other games by those Naughty Dog's, such as The Last of Us and Jak & Daxter. 188betapp

    ReplyDelete
  34. Players Association (RLPA) and has gotten affirmations that various global players and mentors are happy with the security plans set up.온라인카지노

    ReplyDelete
  35. While Moscow tries to airbrush history, it offers a future of misery to the residents it falsely claims to have liberated.

    ReplyDelete