Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

PsychoPy backend causes OpenSesame Hang-up

imnotamemberimnotamember Posts: 16
edited March 20 in OpenSesame

Hi all,
I recently had to reformat my Kubuntu system and reinstalled OpenSesame. It worked previously without issue using PsychoPy backend. Now with a fresh system install and new install of OpenSesame I cannot run an experiment using the PsychoPy backend.

For clarification, when I hit any of the run buttons (windowed, fullscreen, quickrun) OpenSesame grays out fields as normal when an experiment begins. But that is as far as it gets. Here is the output from the run (including the output following me killing the experiment process to return control to the main OpenSesame window).

Python 2.7.12

* Type "help()", "copyright()", "credits()" or "license()" for more information.
* Use the "print([msg])" function in inline_script items to print to this debug window.
* Inspect inline_script variables when an experiment is finished.


In [1]: Starting experiment as ExperimentProcess-3
openexp._canvas.psycho.init_display(): waitblanking = True
openexp._canvas.psycho.init_display(): monitor = testMonitor
openexp._canvas.psycho.init_display(): screen = 0

Python seems to have crashed. This should not happen. If Python crashes often, please report it on the OpenSesame forum.

item-stack: 
time: Mon Mar 20 15:37:25 2017

No window/full-screen comes on showing the stimuli. I've reinstalled various times with different versions of PsychoPy installed seperately and nothing changes this result. This is also just the initial 'welcome' experiment that OpenSesame defaults to when starting.

Thought I'd bring this up in case it is a new bug (I didn't see references to this anywhere on the forums or the rest of the internet).

Here is my system info list from within OpenSesame:

System

System: Linux-4.4.0-66-generic-x86_64-with-Ubuntu-16.04-xenial
Architecture: 64bit
Modules and packages

OpenSesame 3.1.6
Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
QProgEdit 4.0.9
datamatrix 0.4.4
qdatamatrix 0.1.13
pseudorandom 0.2.2
fileinspector 1.0.2
QNotifications 1.1.1
QOpenScienceFramework [not available]
opencv 2.4.9.1
expyriment [not available]
IPython 2.4.1
numpy 1.11.0
scipy 0.17.0
PIL/ PILLOW 1.1.7
psychopy 1.83.04
pygame 1.9.1release
pygaze 0.6.0a21
pyglet 1.1.4
PyQt 5.5.1
serial 3.0.1
markdown 2.6.6
bidi [not available]
yaml 3.11

Comments

  • sebastiaansebastiaan Posts: 2,667

    Hi,

    I would first check if PsychoPy works by itself (not from within OpenSesame), for example by running this example script:

    from psychopy import visual, core  # import some libraries from PsychoPy
    
    #create a window
    mywin = visual.Window([800,600], monitor="testMonitor", units="deg")
    
    #create some stimuli
    grating = visual.GratingStim(win=mywin, mask="circle", size=3, pos=[-4,0], sf=3)
    fixation = visual.GratingStim(win=mywin, size=0.5, pos=[0,0], sf=0, rgb=-1)
    
    #draw the stimuli and update the window
    grating.draw()
    fixation.draw()
    mywin.update()
    
    #pause, so you get a chance to see it!
    core.wait(5.0)
    

    This should show a simple grating and fixation square for 5 s. Does that work?

    Cheers,
    Sebastiaan

    Thanked by 1imnotamember

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Hi Sebastiaan,

    Thanks for the help! I ran your testing code both in the PsychoPy Coder and in a terminal within my python environment, and it works in both.

    As a side note, when I run this:

    ---
    API: 2
    OpenSesame: 3.1.6
    Platform: posix
    ---
    set width 1024
    set uniform_coordinates yes
    set title "New experiment"
    set subject_parity even
    set subject_nr 0
    set start experiment
    set sound_sample_size -16
    set sound_freq 48000
    set sound_channels 2
    set sound_buf_size 1024
    set sampler_backend legacy
    set round_decimals 2
    set mouse_backend psycho
    set keyboard_backend psycho
    set height 768
    set fullscreen no
    set form_clicks no
    set foreground white
    set font_underline no
    set font_size 18
    set font_italic no
    set font_family mono
    set font_bold no
    set disable_garbage_collection yes
    set description "The main experiment item"
    set coordinates uniform
    set compensation 0
    set color_backend psycho
    set clock_backend psycho
    set canvas_backend psycho
    set bidi no
    set background black
    
    define sequence experiment
        set flush_keyboard yes
        set description "Runs a number of items in sequence"
        run new_inline_script always
    
    define inline_script new_inline_script
        set description "Executes Python code"
        set _run "print 'testing in run phase'"
        set _prepare "print 'testing in prepare phase'"
    

    My output is:

    Python 2.7.12
    
    * Type "help()", "copyright()", "credits()" or "license()" for more information.
    * Use the "print([msg])" function in inline_script items to print to this debug window.
    * Inspect inline_script variables when an experiment is finished.
    
    
    In [1]: Starting experiment as ExperimentProcess-2
    

    Which makes me think the error is occurring very early in the set-up (usually it at least indicates some packages were loaded after the 'Starting experiment...' line).

    I just tried the same code by running OpenSesame in terminal with the debug and warning flags on and got this message numerous times, but I assume it isn't necessarily related since it's just a warning(?).

    ***startwarning***
      File "/usr/bin/opensesame", line 25, in <module>
        __main__.opensesame()
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/__main__.py", line 87, in opensesame
        sys.exit(app.exec_())
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/qtopensesame.py", line 1007, in run_quick
        self.run_experiment(fullscreen=False, quick=True)
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/qtopensesame.py", line 973, in run_experiment
        auto_response=self.experiment.auto_response)
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/runners/base_runner.py", line 256, in run
        ret_val = self.execute()
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/runners/multiprocess_runner.py", line 58, in execute
        self.exp_process.start()
      File "/usr/lib/python2.7/multiprocessing/process.py", line 130, in start
        self._popen = Popen(self)
      File "/usr/lib/python2.7/multiprocessing/forking.py", line 126, in __init__
        code = process_obj._bootstrap()
      File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
        self.run()
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/misc/process.py", line 128, in run
        subject_nr=self.subject_nr, logfile=self.logfile)
      File "/usr/lib/python2.7/dist-packages/libopensesame/experiment.py", line 140, in __init__
        item.item.__init__(self, name, self, string)
      File "/usr/lib/python2.7/dist-packages/libopensesame/item.py", line 67, in __init__
        self.from_string(string)
      File "/usr/lib/python2.7/dist-packages/libopensesame/experiment.py", line 345, in from_string
        self.items.new(item_type, item_name, def_str)
      File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 156, in new
        name = self.valid_name(_type, suggestion=name)
      File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 215, in valid_name
        while _name in self:
      File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 290, in __contains__
        name = cistr(name)
      File "/usr/lib/python2.7/dist-packages/libopensesame/cistr.py", line 39, in __init__
        str.__init__(self, s)
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/qtopensesame.py", line 343, in warn_with_traceback
        traceback.print_stack()
    
    /usr/lib/python2.7/dist-packages/libopensesame/cistr.py:39: DeprecationWarning: object.__init__() takes no parameters
      str.__init__(self, s)
    
    ***endwarning***
    

    Any help you can offer is greatly appreciated. I usually try to troubleshoot these things on my own but this is getting deeper into the OpenSesame core than I know at the moment. I thought you might have seen this in the past.

    Thanks,
    Josh

  • sebastiaansebastiaan Posts: 2,667

    Hi Josh,

    It took me a while, but I've seen this problem too now. On Ubuntu 16.10. On Ubuntu 16.04 or 17.04 things work fine for me. Are you running 16.10 as well?

    I don't think you'll be able to properly find the cause of this crash. It's a low-level crash somewhere, and it can be anything, really. I think you're best bet is to upgrade to 17.04, if you haven't done so already.

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Hi Sebastiaan,
    Great news, thanks for the update! I had a feeling it was something very close to the kernel. I'll update and repost if things are resolved then.

    Thanks again,
    Josh

Sign In or Register to comment.