×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    126

    Accelerometer sensors lag

    I have a game using the accelerometer sensor to control an item's movement. The game itself is very short - up to 2 minutes, so the known memory leak in the sensors API is irrelevant.
    First game works great. When the game ends, the user has to input his/her name in a text field. When the text field is in focus, all timers/callbacks are stopped, and the accelerometer data seems to be accumulated in some sort of an internal buffer (maybe it related to the memory leak issue which we are all waiting for a solution!). I know that because when I choose "Replay", there is an annoying lag between the device's movement and the item's.

    If the user is quick to enter it's name, it's a non issue - the sensor readings are not accumulated.
    But if it takes time, or if the device is an N97 (and therefore the text input field is in focus longer), the lag appears. This is, BTW, the answer to a previous post I wrote in the past (http://discussion.forum.nokia.com/fo...d.php?t=196486) about N97 performance issue.

    So - I'm looking for a creative way to solve it, either to empty somehow this buffer, or to limit the time the text field is in focus (specifically on N97), or anything that could solve this problem. I can't release this game before I solve this problem (at least not for N97), and it is a shame!

    Any idea will help,
    Thanks,

    Ranco
    MobilityCraft.com

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Accelerometer sensors lag

    I'm looking for a creative way to solve it, either to empty somehow this buffer, or to limit the time the text field is in focus (specifically on N97), or anything that could solve this problem.
    According to my observation, Once the text field is selected than it cannot listen to any callbacks as u mentioned.But if the text field got a focus only , then it can be changed but it is not of use because by clicking or pressing a text field we mean selecting a text field (not only focusing). The two things which MAY help u avoiding this situation :
    1- Create ur own text field with a custom keyboard and a dynamic text field , than just limit it by time.
    2- Try to unload the accelerometer service using UnloadService, once there is no use of accelerometer.

    Best Regards,
    SajiSoft

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    126

    Re: Accelerometer sensors lag

    Quote Originally Posted by sajisoft View Post
    According to my observation, Once the text field is selected than it cannot listen to any callbacks as u mentioned.But if the text field got a focus only , then it can be changed but it is not of use because by clicking or pressing a text field we mean selecting a text field (not only focusing). The two things which MAY help u avoiding this situation :
    1- Create ur own text field with a custom keyboard and a dynamic text field , than just limit it by time.
    2- Try to unload the accelerometer service using UnloadService, once there is no use of accelerometer.

    Best Regards,
    SajiSoft
    Well, I thought of the first solution and decided it is too complicated because I wish to maintain multi-lingual support and too lazy to write that.
    Second solution - I found and implemented that earlier today and it works fine on my 5800 (I even know that the function call returns "true"), but surprisingly, although sensor service is unloaded when game is not active, there is still a delay starting on the third game. I think I'm give up on the N97 - something is rotten there!
    Thanks for your reply,

    Ranco

  4. #4
    Registered User
    Join Date
    Jan 2007
    Location
    bucharest
    Posts
    222

    Re: Accelerometer sensors lag

    I also reply to: http://discussion.forum.nokia.com/fo...d.php?t=196486

    try make a widget!
    http://m.shpe.ro
    http://work.shpe.ro
    http://purchase.shpe.ro/iPics

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    126

    Re: Accelerometer sensors lag

    Quote Originally Posted by shpe11 View Post
    I also reply to: http://discussion.forum.nokia.com/fo...d.php?t=196486

    try make a widget!
    Yes, I remember. Already been there - sorry, but that's not too good recommendation. Widgets are SO SLOW, the game is not responsive in all aspects, not just sensors. To me it seems a definite N97 bug that can't be handled. Give up on this device.
    Thanks,
    Ranco

Similar Threads

  1. Accessing accelerometer data gradually increases CPU load
    By Larry101 in forum Mobile Java General
    Replies: 2
    Last Post: 2010-09-09, 21:35
  2. Stroke-rate meter using accelerometer?
    By jwshale in forum Symbian
    Replies: 0
    Last Post: 2009-12-14, 21:00
  3. sending accelerometer data to java app
    By Larry101 in forum Symbian
    Replies: 5
    Last Post: 2009-11-02, 09:49
  4. Nokia N95 sensors
    By hwit in forum General Development Questions
    Replies: 2
    Last Post: 2009-07-16, 11:26
  5. Finding accelerometer update frequency
    By phishboh in forum Symbian
    Replies: 1
    Last Post: 2008-02-19, 15:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×