Howdy, Stranger!

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

Supported by

[open] Experiment interrupted on Android tablet

edited September 2015 in OpenSesame

Hi!

Some versions of my experiment work fine, while some are suddenly terminated right before the last trials. I get the following text in the debug file:

Traceback (most recent call last):
  File "opensesame/main.py", line 116, in main
  File "opensesame/libopensesame/experiment.py", line 347, in run
  File "opensesame/libopensesame/sequence.py", line 47, in run
  File "opensesame/libopensesame/loop.py", line 140, in run
  File "opensesame/libopensesame/sequence.py", line 47, in run
  File "opensesame/libopensesame/inline_script.py", line 176, in run
osexception: 
Error while executing inline script

phase: run
item: ______inline_script
line: 66
exception message: Failed to load sample in sampler "___Trost": [Errno 24] Too many open files: '/data/data/nl.cogsci.opensesame/files/tmpI6NUFQ.opensesame_pool/Trost.wav'
exception type: osexception

For one of the experiments it helped to clear all other experiments from the tab, but for others this didn't solve the problem. Any suggestions on what I could do to fix this?

Cheers, Heidi

Comments

  • edited 12:19PM

    Hi Heidi,

    It looks like you're playing back sound files through an inline_script. Is that correct? I'm guessing that you just keep opening new files, without closing the old ones, and that this eventually results in the 'too many open files' error. But I cannot say for sure without more details. Could you provide some more info, including the actual script?

    Cheers,
    Sebastiaan

  • edited September 2015

    Hi Sebastiaan!

    I'm playing the sound files through the loop and sequence items, and when the initial response is wrong, the same task is repeated with the following inline script:

    if self.get('correct') == 0:
        exp.items["Parent1Parent2_Seq"].prepare()
        exp.items["Parent1Parent2_Seq"].run()
    

    So then it might be that the reason the experiment sometimes does work properly actually has to do with how many errors a participant has made (if only the files opened through the inline script are left open)? Do you need further information about the experiment? We discussed the inline script here in case it helps: http://forum.cogsci.nl/index.php?p=/discussion/1509/solved-random-presentation-of-pictures-and-words-in-an-experiment#Item_6

    Cheers,

    Heidi

  • edited 12:19PM

    Hi Heidi,

    So you play the sound with a regular sampler item, but use an inline_script to repeat the whole sequence when an error occurs. Right? If so, that seems like a valid approach.

    So then it might be that the reason the experiment sometimes does work properly actually has to do with how many errors a participant has made (if only the files opened through the inline script are left open)?

    I agree; something like that seems to be going on.

    Do you need further information about the experiment?

    This sounds like a bug in pygame or, on Android, pgs4a (pygame subset for Android), which is what OpenSesame uses for sound playback. To get to the bottom of this, it would be useful if you could do some tests to find out:

    • Whether you can indeed reliably trigger the error by making lots of mistakes.
    • If so, whether this happens only on Android, or also on a normal computer.

    Cheers,
    Sebastiaan

  • edited 12:19PM

    Hi!

    Yes exactly so, I play the sound with a regular sampler item, but use an inline_script to repeat the whole sequence when an error occurs.

    On a normal PC there are no problems at all, and I can finish the experiment with a very large number of errors and it has never crashed. I did the following tests on the tab:

    1. When I answered all items correctly, the experiment finished properly.

    2. When I made lots of mistakes during the first 4 loops, the experiment crashed after I had answered the first item of the last loop correctly. So it seems that for some reason, regardless the amount of errors, the experiment never crashes before the last loop. Also, I got the same error information in the debug file, stating that there are too many open files to open the next sampler item (even if it wasn't run by the inline script).

    3. When I made no mistakes during the first 4 loops, the experiment crashed after 13 errors in the last loop (which is much less than the combined number of errors I made in the first loops in test 2 above). I'm wondering if there is something wrong with specifically the last loop..

    Here are versions of the experiment for PC and tab, the only difference between these two ought to be the response items (keyboard vs touch):

    https://drive.google.com/folderview?id=0B9oPDmV1spDvfkpvZnhRa0JkYXRFeXdoRUQ5VEE2UlVPc1pCd0ZzWi1nVFhsRVVFT3F3ejA&usp=sharing

    Cheers,

    Heidi

  • edited 12:19PM

    And one more thing, the touch version works with mouseclicks on PC without any problems!

Sign In or Register to comment.