Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Android runtime error

edited February 2014 in OpenSesame

Hi Sebastiaan,

unfortunately the opensesame programme on the tablet (still Nexus 10) sometimes crashes giving me an "android runtime error". In the feedback it says, caused by "ANR Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.)."

Do you have any idea what that means and how I can resolve that?

Best,
Anne

Comments

  • edited 11:39PM

    Hi Anne,

    I'm not familiar with this error, but I think it might be related to Android's lifecycle management. Do you have an extensive inline_script that runs uninterrupted for some time? If so, perhaps Android decides that the app has become unresponsive and kills it. I would try repeatedly checking in with Android (for example at the end of each while loop) , like so:

    if android:
        if android.check_pause():
            android.wait_for_resume()
    

    To do this, you need to import the android module at the beginning of your script:

    try:
        import android
    except ImportError:
        android = None
    


    Cheers!
    Sebastiaan

  • edited 11:39PM

    Hi Sebastiaan,

    thanks, I added these lines and first thought it would work - however, it still crashes but gives another error message (crash, nativ crash). There is a huge event log list that I don't understand. I can't save it anywhere but only send it (to google?). Do you get the crash report then? Would be perfect if you could have a look at it. I'll have participants very soon and unfortunately the program on my tablet doesn't seem to run reliably.

    Anne

  • edited February 2014

    Not sure if that helps...

    image

    image

    image

  • edited 11:39PM

    Hi Anne,

    If you send it to Google I can indeed see the event log in my Google Play developer account. However, it doesn't tell me much. It's a segmentation fault triggered in the low-level libraries of the Linux OS (Android = Linux). It's not a Python stacktrace that you get when there is a bug in OpenSesame itself (or in the experiment), which are quite informative and therefore relatively easy to debug. Here it is. Please also share it with @dschreij, maybe he can shine a light on it.

    It also seems that this error is specific to your device or experiment, because the only error reports in my dev account seem to come from you. A Nexus 10 manta running Android 4.4, right?

    It will be tricky to debug this, but let's give it a go:

    • You have been working on this experiment for a while, right? Did you experience these crashes from the beginning or did they suddenly start occurring. If the latter, when did this happen?
    • When do the crashes occur? Are they totally random, or is there some pattern or a particular 'risk moment' during the trial?
    • The error log mentions something about sound playback. Do you do something special with sound playback?

    Cheers,
    Sebastiaan

  • edited 11:39PM

    Hi Sebastiaan,

    thanks a lot, I might have found the cause of the crashes with the help of your questions. Thought back, the crashes occured from the beginning on - however, only occasionally. Meaning, the programme didn't crash for some participants, but did for others.
    The crashes always appeared in the part of the experiment, where sounds (=search instructions) are played in the run script. In the "crash trial", it always crashes before the search display is shown.

    ....
    self.fixdot.show()
    self.sleep(1000)
    self.instructions.show()
    exp.items['color'].run()
    exp.items['orientation'].run()
    self.sleep(1000)
    
    from openexp.mouse import mouse
    my_mouse = mouse(exp)
    my_mouse.set_visible()
    
    target_loc_x = exp.get("target_loc_x")
    target_loc_y = exp.get("target_loc_y)
    
    finger_on_start_square = False
    ##while loop: search display is only shown after pps have finger on grey bar at the bottom of the display
    while not finger_on_start_square:
        self.sleep(1000)
        pos = my_mouse.get_pos()[0]
        pressed = my_mouse.get_pressed()[0] 
        if pressed and pos[0] > xc-barwidth/2 and pos[0] < xc+barwidth/2 and pos[1] > exp.height - barheight:
            finger_on_start_square = True   
        if android:
            if android.check_pause():
                android.wait_for_resume()
    RT_start = exp.canvas_conj.show()
    ...
    

    I removed the sounds (they are not essential for the patients I'm testing now) and it has been working fine for a few hundred trials now.

    Best,
    Anne

    PS: yes, Nexus 10 Android 4.4

  • edited 11:39PM

    Did it also occur before you updated to 4.4? Might have something to do with that, because when we tested it we never(?) had these crashes.

    Good luck over there!

    Buy Me A Coffee

  • edited 11:39PM

    I had a few crashes before the update to 4.4, but they could have been related to the android's lifecycle management that Sebastiaan mentioned. I don't remember what the crash reports said. Daniel, when we tested we always just did a few trials. However, in most cases (also after I added the code for repeatedly checking in with Android in each while-loop), I found the programme crashing between trial 30-100 (just coincidence?).

  • edited 11:39PM

    I have no idea. I've never worked with android before your project, so I sadly have too little knowledge about this subject.

    Buy Me A Coffee

Sign In or Register to comment.