Error message related to memory?

830 views
Skip to first unread message

Jazz

unread,
Jan 14, 2013, 2:26:47 AM1/14/13
to psychop...@googlegroups.com

Hi, I would like to ask help in order to fix a problem in my experiment. I am running an experiment with 278 short sound files.

Each file is about 50 KB. When listeners hear each file, they also see a person's picture on a MAC screen. There are five photos

involved in this task. Each photo is about 300KB or so. The listeners decide whether they heard a real or nonsense word by

pressing keys. What is happening is that Psychopy stops after 140 trials and showing the following message.


########## Running: /Users/jazz/Documents/Experiment 2/EX2_lastrun.py ##########

python(509,0xa00eb540) malloc: *** mmap(size=268435456) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Fatal Python error: (pygame parachute) Bus Error

I questioned my machine's memory capacity. My MAC has 8GB RAM, and I doubt if the memory size is the matter. 

As long as I track down the past discussion, there was a similar topic by Lukasz Piwek on October 23, 2012. But this

was not helpful to solve my situation. So I looked into some basic potential causes. First, I checked all stimuli names

in EXCEL files, and they were OK. I also check the names of the sound files. They match with the names in the EXCEL

files. Then, I investigated when the message occurs. It occurs after 140 trials. On the 140th trial, a sound file is played

first. A picture then shows up on the screen a couple seconds later. Psychopy moves on to the next trial, but it does not play

a sound file or show a picture. Finally, it stops working.

A funny thing is that I have a similar experiment. I designed this before the current experiment. It has 200 short sound files

and a picture. The sizes of the sound files and the picture are similar to the present experiment. When I run this experiment,

Psychopy does not have any problems. One thing I notice is that fixation duration on screen is accurate in the experiment.

But the fixation duration in the ongoing experiment is inaccurate; it takes longer for Psychopy to move from a fixation screen

to stimuli display. If memory is an issue, I would imagine that both experiments would have inaccuracy in the fixation duration.

Then, this memory related issue may be specifically for the ongoing experiment. I would like to receive any ideas in order to

solve the problem. I attached my experiment file to this message. Thank you for reading my message.

P.S.

I run Psychopy 1.75.01 on Mac OS X 10.6.8, MacBook Pro. Processor is 2.2GHz Intel Core i7. Memory is 8GB 1333MHz DDR3.


Jazz

unread,
Jan 14, 2013, 2:30:41 AM1/14/13
to psychop...@googlegroups.com
Here is my experiment file which was developed using builder mode.

Cheers

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.75.01), Mon Jan 14 20:28:20 2013
If you publish work using this script please cite the relevant PsychoPy publications
  Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8-13.
  Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2:10. doi: 10.3389/neuro.11.010.2008
"""

from __future__ import division  # so that 1/3=0.333 instead of 1/3=0
from psychopy import visual, core, data, event, logging, gui, sound
from psychopy.constants import *  # things like STARTED, FINISHED
import numpy as np  # whole numpy lib is available, prepend 'np.'
from numpy import sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray
from numpy.random import random, randint, normal, shuffle
import os  # handy system and path functions

# Store info about the experiment session
expName = 'None'  # from the Builder filename that created this script
expInfo = {'participant':'', 'session':'001'}
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)
if dlg.OK == False: core.quit()  # user pressed cancel
expInfo['date'] = data.getDateStr()  # add a simple timestamp
expInfo['expName'] = expName

# Setup files for saving
if not os.path.isdir('data'):
    os.makedirs('data')  # if this fails (e.g. permissions) we will get error
filename = 'data' + os.path.sep + '%s_%s' %(expInfo['participant'], expInfo['date'])
logFile = logging.LogFile(filename+'.log', level=logging.EXP)
logging.console.setLevel(logging.WARNING)  # this outputs to the screen, not a file

# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
    extraInfo=expInfo, runtimeInfo=None,
    originPath=None,
    savePickle=True, saveWideText=True,
    dataFileName=filename)

# Setup the Window
win = visual.Window(size=(1440, 900), fullscr=True, screen=0, allowGUI=False, allowStencil=False,
    monitor='testMonitor', color=[0,0,0], colorSpace='rgb')

# Initialize components for Routine "welcome"
welcomeClock = core.Clock()
welcome_text = visual.TextStim(win=win, ori=0, name='welcome_text',
    text=u'            \xbf\xbf\xbf WORD or PSEUDO WORD ???\nThank you for participating in this study! I am happy to have you here. Today you have two tasks in this experiment.\n\n1) You will hear words and determine whether you heard real or nonsense words.\n\n2) You will hear nonsense words and identify what you hear.\n\nPlease press SPACEBAR to proceed.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "instruction01"
instruction01Clock = core.Clock()
instruction01_text = visual.TextStim(win=win, ori=0, name='instruction01_text',
    text='INSTRUCTION\nLet\'s move onto the first task. You will hear words spoken by a person in the picture on your PC screen.\n\nPress "YES" if the word is a real word.\nPress "NO" if the word is a nonsense word.\n\nYou will have three practices before your experiment starts. Please try to respond as fast as possible.\n\nPress SPACEBAR to proceed.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "ready"
readyClock = core.Clock()
ready_text = visual.TextStim(win=win, ori=0, name='ready_text',
    text='READY?',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "fixation"
fixationClock = core.Clock()
fixation_text = visual.TextStim(win=win, ori=0, name='fixation_text',
    text='++',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "practice"
practiceClock = core.Clock()
practice_sound = sound.Sound('A')
practice_sound.setVolume(1)
practice_image = visual.ImageStim(win=win, name='practice_image',
    image='sin', mask=None,
    ori=0, pos=[0, 0], size=[1.5, 1.5],
    color=[1,1,1], colorSpace='rgb', opacity=1,
    texRes=128, interpolate=True, depth=-1.0)

# Initialize components for Routine "break01"
break01Clock = core.Clock()
break01text = visual.TextStim(win=win, ori=0, name='break01text',
    text='Great! Now you know what to do in this task. If you have any questions, call your assistant now. Otherwise, press SPACEBAR to proceed.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "ready"
readyClock = core.Clock()
ready_text = visual.TextStim(win=win, ori=0, name='ready_text',
    text='READY?',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "fixation"
fixationClock = core.Clock()
fixation_text = visual.TextStim(win=win, ori=0, name='fixation_text',
    text='++',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "trial"
trialClock = core.Clock()
trial01_sound = sound.Sound('A')
trial01_sound.setVolume(1)
trial01_image = visual.ImageStim(win=win, name='trial01_image',
    image='sin', mask=None,
    ori=0, pos=[0, 0], size=[1.5, 1.5],
    color=[1,1,1], colorSpace='rgb', opacity=1,
    texRes=128, interpolate=True, depth=-1.0)

# Initialize components for Routine "minibreak"
minibreakClock = core.Clock()
mini_text = visual.TextStim(win=win, ori=0, name='mini_text',
    text='You have been doing great job! Keep going! Press SPACEBAR to resume your task.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "fixation"
fixationClock = core.Clock()
fixation_text = visual.TextStim(win=win, ori=0, name='fixation_text',
    text='++',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "trial02"
trial02Clock = core.Clock()
trial02_sound = sound.Sound('A')
trial02_sound.setVolume(1)
trial_02image = visual.ImageStim(win=win, name='trial_02image',
    image='sin', mask=None,
    ori=0, pos=[0, 0], size=[1.5, 1.5],
    color=[1,1,1], colorSpace='rgb', opacity=1,
    texRes=128, interpolate=True, depth=-1.0)

# Initialize components for Routine "break02"
break02Clock = core.Clock()
break02_text = visual.TextStim(win=win, ori=0, name='break02_text',
    text='Awesome! You just finished your first task. Before you move onto the next task, would you please call your assistant now?',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "welcomeback"
welcomebackClock = core.Clock()
welcoemback_text = visual.TextStim(win=win, ori=0, name='welcoemback_text',
    text='Welcome back! Now you are set for the next task.\n\nWhenever you are ready, press SPACEBAR to proceed.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "instruction02"
instruction02Clock = core.Clock()
instruction02_text = visual.TextStim(win=win, ori=0, name='instruction02_text',
    text='INSTRUCTION\nYou will hear nonsense words, and determine if they contain S or SH sounds.\n\nPress "S" when you heard an S sound (e.g., see).\nPress "SH" when you heard an SH sound (e.g., she)\n\nWhen you are ready, press SPACEBAR to proceed.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "ready"
readyClock = core.Clock()
ready_text = visual.TextStim(win=win, ori=0, name='ready_text',
    text='READY?',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "fixation"
fixationClock = core.Clock()
fixation_text = visual.TextStim(win=win, ori=0, name='fixation_text',
    text='++',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=None,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Initialize components for Routine "catergorization"
catergorizationClock = core.Clock()
cat_sound = sound.Sound('A')
cat_sound.setVolume(1)
cat_image = visual.ImageStim(win=win, name='cat_image',
    image='sin', mask=None,
    ori=0, pos=[0, 0], size=[1.5, 1.5],
    color=[1,1,1], colorSpace='rgb', opacity=1,
    texRes=128, interpolate=True, depth=-1.0)

# Initialize components for Routine "thankyou"
thankyouClock = core.Clock()
thanks_text = visual.TextStim(win=win, ori=0, name='thanks_text',
    text='Well done! Thank you very much for participating in this experiment! Much appreciation for your help. Please call your assistant now.',
    font='Arial',
    pos=[0, 0], height=0.1, wrapWidth=1.5,
    color='white', colorSpace='rgb', opacity=1,
    depth=0.0)

# Create some handy timers
globalClock = core.Clock()  # to track the time since experiment started
routineTimer = core.CountdownTimer()  # to track time remaining of each (non-slip) routine 

#------Prepare to start Routine"welcome"-------
t = 0
welcomeClock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
welcome_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
welcome_key.status = NOT_STARTED
# keep track of which components have finished
welcomeComponents = []
welcomeComponents.append(welcome_text)
welcomeComponents.append(welcome_key)
for thisComponent in welcomeComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "welcome"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = welcomeClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *welcome_text* updates
    if t >= 0.0 and welcome_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        welcome_text.tStart = t  # underestimates by a little under one frame
        welcome_text.frameNStart = frameN  # exact frame index
        welcome_text.setAutoDraw(True)
    
    # *welcome_key* updates
    if t >= 0.0 and welcome_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        welcome_key.tStart = t  # underestimates by a little under one frame
        welcome_key.frameNStart = frameN  # exact frame index
        welcome_key.status = STARTED
        # keyboard checking is just starting
        welcome_key.clock.reset()  # now t=0
        event.clearEvents()
    if welcome_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            welcome_key.keys = theseKeys[-1]  # just the last key pressed
            welcome_key.rt = welcome_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in welcomeComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "welcome"-------
for thisComponent in welcomeComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

#------Prepare to start Routine"instruction01"-------
t = 0
instruction01Clock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
instruction01_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
instruction01_key.status = NOT_STARTED
# keep track of which components have finished
instruction01Components = []
instruction01Components.append(instruction01_text)
instruction01Components.append(instruction01_key)
for thisComponent in instruction01Components:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "instruction01"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = instruction01Clock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *instruction01_text* updates
    if t >= 0.0 and instruction01_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        instruction01_text.tStart = t  # underestimates by a little under one frame
        instruction01_text.frameNStart = frameN  # exact frame index
        instruction01_text.setAutoDraw(True)
    
    # *instruction01_key* updates
    if t >= 0.0 and instruction01_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        instruction01_key.tStart = t  # underestimates by a little under one frame
        instruction01_key.frameNStart = frameN  # exact frame index
        instruction01_key.status = STARTED
        # keyboard checking is just starting
        instruction01_key.clock.reset()  # now t=0
        event.clearEvents()
    if instruction01_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            instruction01_key.keys = theseKeys[-1]  # just the last key pressed
            instruction01_key.rt = instruction01_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in instruction01Components:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "instruction01"-------
for thisComponent in instruction01Components:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

#------Prepare to start Routine"ready"-------
t = 0
readyClock.reset()  # clock 
frameN = -1
routineTimer.add(2.000000)
# update component parameters for each repeat
# keep track of which components have finished
readyComponents = []
readyComponents.append(ready_text)
for thisComponent in readyComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "ready"-------
continueRoutine = True
while continueRoutine and routineTimer.getTime() > 0:
    # get current time
    t = readyClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *ready_text* updates
    if t >= 0.0 and ready_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        ready_text.tStart = t  # underestimates by a little under one frame
        ready_text.frameNStart = frameN  # exact frame index
        ready_text.setAutoDraw(True)
    elif ready_text.status == STARTED and t >= (0.0 + 2.0):
        ready_text.setAutoDraw(False)
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in readyComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "ready"-------
for thisComponent in readyComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

# set up handler to look after randomisation of conditions etc
practice_loop = data.TrialHandler(nReps=1, method='random', 
    extraInfo=expInfo, originPath=None,
    trialList=data.importConditions('practice.xlsx'),
    seed=None, name='practice_loop')
thisExp.addLoop(practice_loop)  # add the loop to the experiment
thisPractice_loop = practice_loop.trialList[0]  # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb=thisPractice_loop.rgb)
if thisPractice_loop != None:
    for paramName in thisPractice_loop.keys():
        exec(paramName + '= thisPractice_loop.' + paramName)

for thisPractice_loop in practice_loop:
    currentLoop = practice_loop
    # abbreviate parameter names if possible (e.g. rgb = thisPractice_loop.rgb)
    if thisPractice_loop != None:
        for paramName in thisPractice_loop.keys():
            exec(paramName + '= thisPractice_loop.' + paramName)
    
    #------Prepare to start Routine"fixation"-------
    t = 0
    fixationClock.reset()  # clock 
    frameN = -1
    routineTimer.add(0.500000)
    # update component parameters for each repeat
    # keep track of which components have finished
    fixationComponents = []
    fixationComponents.append(fixation_text)
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "fixation"-------
    continueRoutine = True
    while continueRoutine and routineTimer.getTime() > 0:
        # get current time
        t = fixationClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        
        # *fixation_text* updates
        if t >= 0.0 and fixation_text.status == NOT_STARTED:
            # keep track of start time/frame for later
            fixation_text.tStart = t  # underestimates by a little under one frame
            fixation_text.frameNStart = frameN  # exact frame index
            fixation_text.setAutoDraw(True)
        elif fixation_text.status == STARTED and t >= (0.0 + 0.5):
            fixation_text.setAutoDraw(False)
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in fixationComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "fixation"-------
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    
    #------Prepare to start Routine"practice"-------
    t = 0
    practiceClock.reset()  # clock 
    frameN = -1
    # update component parameters for each repeat
    practice_sound.setSound(sound01)
    practice_image.setImage(picture01)
    practice_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
    practice_key.status = NOT_STARTED
    # keep track of which components have finished
    practiceComponents = []
    practiceComponents.append(practice_sound)
    practiceComponents.append(practice_image)
    practiceComponents.append(practice_key)
    for thisComponent in practiceComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "practice"-------
    continueRoutine = True
    while continueRoutine:
        # get current time
        t = practiceClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        # start/stop practice_sound
        if t >= 0.2 and practice_sound.status == NOT_STARTED:
            # keep track of start time/frame for later
            practice_sound.tStart = t  # underestimates by a little under one frame
            practice_sound.frameNStart = frameN  # exact frame index
            practice_sound.play()  # start the sound (it finishes automatically)
        
        # *practice_image* updates
        if t >= 0.2 and practice_image.status == NOT_STARTED:
            # keep track of start time/frame for later
            practice_image.tStart = t  # underestimates by a little under one frame
            practice_image.frameNStart = frameN  # exact frame index
            practice_image.setAutoDraw(True)
        
        # *practice_key* updates
        if t >= 0.2 and practice_key.status == NOT_STARTED:
            # keep track of start time/frame for later
            practice_key.tStart = t  # underestimates by a little under one frame
            practice_key.frameNStart = frameN  # exact frame index
            practice_key.status = STARTED
            # keyboard checking is just starting
            practice_key.clock.reset()  # now t=0
            event.clearEvents()
        if practice_key.status == STARTED:  # only update if being drawn
            theseKeys = event.getKeys(keyList=['z', 'm'])
            if len(theseKeys) > 0:  # at least one key was pressed
                practice_key.keys = theseKeys[-1]  # just the last key pressed
                practice_key.rt = practice_key.clock.getTime()
                # abort routine on response
                continueRoutine = False
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in practiceComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "practice"-------
    for thisComponent in practiceComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    # check responses
    if len(practice_key.keys) == 0:  # No response was made
       practice_key.keys=None
    # store data for practice_loop (TrialHandler)
    practice_loop.addData('practice_key.keys',practice_key.keys)
    if practice_key.keys != None:  # we had a response
        practice_loop.addData('practice_key.rt', practice_key.rt)
    thisExp.nextEntry()
    
# completed 1 repeats of 'practice_loop'


#------Prepare to start Routine"break01"-------
t = 0
break01Clock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
break01key = event.BuilderKeyResponse()  # create an object of type KeyResponse
break01key.status = NOT_STARTED
# keep track of which components have finished
break01Components = []
break01Components.append(break01text)
break01Components.append(break01key)
for thisComponent in break01Components:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "break01"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = break01Clock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *break01text* updates
    if t >= 0.0 and break01text.status == NOT_STARTED:
        # keep track of start time/frame for later
        break01text.tStart = t  # underestimates by a little under one frame
        break01text.frameNStart = frameN  # exact frame index
        break01text.setAutoDraw(True)
    
    # *break01key* updates
    if t >= 0.0 and break01key.status == NOT_STARTED:
        # keep track of start time/frame for later
        break01key.tStart = t  # underestimates by a little under one frame
        break01key.frameNStart = frameN  # exact frame index
        break01key.status = STARTED
        # keyboard checking is just starting
        break01key.clock.reset()  # now t=0
        event.clearEvents()
    if break01key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            break01key.keys = theseKeys[-1]  # just the last key pressed
            break01key.rt = break01key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in break01Components:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "break01"-------
for thisComponent in break01Components:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

#------Prepare to start Routine"ready"-------
t = 0
readyClock.reset()  # clock 
frameN = -1
routineTimer.add(2.000000)
# update component parameters for each repeat
# keep track of which components have finished
readyComponents = []
readyComponents.append(ready_text)
for thisComponent in readyComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "ready"-------
continueRoutine = True
while continueRoutine and routineTimer.getTime() > 0:
    # get current time
    t = readyClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *ready_text* updates
    if t >= 0.0 and ready_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        ready_text.tStart = t  # underestimates by a little under one frame
        ready_text.frameNStart = frameN  # exact frame index
        ready_text.setAutoDraw(True)
    elif ready_text.status == STARTED and t >= (0.0 + 2.0):
        ready_text.setAutoDraw(False)
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in readyComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "ready"-------
for thisComponent in readyComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

# set up handler to look after randomisation of conditions etc
trial01_loop = data.TrialHandler(nReps=1, method='random', 
    extraInfo=expInfo, originPath=None,
    trialList=data.importConditions('S-short01.xlsx'),
    seed=None, name='trial01_loop')
thisExp.addLoop(trial01_loop)  # add the loop to the experiment
thisTrial01_loop = trial01_loop.trialList[0]  # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb=thisTrial01_loop.rgb)
if thisTrial01_loop != None:
    for paramName in thisTrial01_loop.keys():
        exec(paramName + '= thisTrial01_loop.' + paramName)

for thisTrial01_loop in trial01_loop:
    currentLoop = trial01_loop
    # abbreviate parameter names if possible (e.g. rgb = thisTrial01_loop.rgb)
    if thisTrial01_loop != None:
        for paramName in thisTrial01_loop.keys():
            exec(paramName + '= thisTrial01_loop.' + paramName)
    
    #------Prepare to start Routine"fixation"-------
    t = 0
    fixationClock.reset()  # clock 
    frameN = -1
    routineTimer.add(0.500000)
    # update component parameters for each repeat
    # keep track of which components have finished
    fixationComponents = []
    fixationComponents.append(fixation_text)
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "fixation"-------
    continueRoutine = True
    while continueRoutine and routineTimer.getTime() > 0:
        # get current time
        t = fixationClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        
        # *fixation_text* updates
        if t >= 0.0 and fixation_text.status == NOT_STARTED:
            # keep track of start time/frame for later
            fixation_text.tStart = t  # underestimates by a little under one frame
            fixation_text.frameNStart = frameN  # exact frame index
            fixation_text.setAutoDraw(True)
        elif fixation_text.status == STARTED and t >= (0.0 + 0.5):
            fixation_text.setAutoDraw(False)
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in fixationComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "fixation"-------
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    
    #------Prepare to start Routine"trial"-------
    t = 0
    trialClock.reset()  # clock 
    frameN = -1
    # update component parameters for each repeat
    trial01_sound.setSound(sound01)
    trial01_image.setImage(picture01)
    trial01_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
    trial01_key.status = NOT_STARTED
    # keep track of which components have finished
    trialComponents = []
    trialComponents.append(trial01_sound)
    trialComponents.append(trial01_image)
    trialComponents.append(trial01_key)
    for thisComponent in trialComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "trial"-------
    continueRoutine = True
    while continueRoutine:
        # get current time
        t = trialClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        # start/stop trial01_sound
        if t >= 0.0 and trial01_sound.status == NOT_STARTED:
            # keep track of start time/frame for later
            trial01_sound.tStart = t  # underestimates by a little under one frame
            trial01_sound.frameNStart = frameN  # exact frame index
            trial01_sound.play()  # start the sound (it finishes automatically)
        
        # *trial01_image* updates
        if t >= 0.0 and trial01_image.status == NOT_STARTED:
            # keep track of start time/frame for later
            trial01_image.tStart = t  # underestimates by a little under one frame
            trial01_image.frameNStart = frameN  # exact frame index
            trial01_image.setAutoDraw(True)
        
        # *trial01_key* updates
        if t >= 0.0 and trial01_key.status == NOT_STARTED:
            # keep track of start time/frame for later
            trial01_key.tStart = t  # underestimates by a little under one frame
            trial01_key.frameNStart = frameN  # exact frame index
            trial01_key.status = STARTED
            # keyboard checking is just starting
            trial01_key.clock.reset()  # now t=0
            event.clearEvents()
        if trial01_key.status == STARTED:  # only update if being drawn
            theseKeys = event.getKeys(keyList=['z', 'm'])
            if len(theseKeys) > 0:  # at least one key was pressed
                trial01_key.keys = theseKeys[-1]  # just the last key pressed
                trial01_key.rt = trial01_key.clock.getTime()
                # abort routine on response
                continueRoutine = False
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in trialComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "trial"-------
    for thisComponent in trialComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    # check responses
    if len(trial01_key.keys) == 0:  # No response was made
       trial01_key.keys=None
    # store data for trial01_loop (TrialHandler)
    trial01_loop.addData('trial01_key.keys',trial01_key.keys)
    if trial01_key.keys != None:  # we had a response
        trial01_loop.addData('trial01_key.rt', trial01_key.rt)
    thisExp.nextEntry()
    
# completed 1 repeats of 'trial01_loop'


#------Prepare to start Routine"minibreak"-------
t = 0
minibreakClock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
mini_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
mini_key.status = NOT_STARTED
# keep track of which components have finished
minibreakComponents = []
minibreakComponents.append(mini_text)
minibreakComponents.append(mini_key)
for thisComponent in minibreakComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "minibreak"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = minibreakClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *mini_text* updates
    if t >= 0.0 and mini_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        mini_text.tStart = t  # underestimates by a little under one frame
        mini_text.frameNStart = frameN  # exact frame index
        mini_text.setAutoDraw(True)
    
    # *mini_key* updates
    if t >= 0.0 and mini_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        mini_key.tStart = t  # underestimates by a little under one frame
        mini_key.frameNStart = frameN  # exact frame index
        mini_key.status = STARTED
        # keyboard checking is just starting
        mini_key.clock.reset()  # now t=0
        event.clearEvents()
    if mini_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            mini_key.keys = theseKeys[-1]  # just the last key pressed
            mini_key.rt = mini_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in minibreakComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "minibreak"-------
for thisComponent in minibreakComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

# set up handler to look after randomisation of conditions etc
trial02_loop = data.TrialHandler(nReps=1, method='random', 
    extraInfo=expInfo, originPath=None,
    trialList=data.importConditions('S-short02.xlsx'),
    seed=None, name='trial02_loop')
thisExp.addLoop(trial02_loop)  # add the loop to the experiment
thisTrial02_loop = trial02_loop.trialList[0]  # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb=thisTrial02_loop.rgb)
if thisTrial02_loop != None:
    for paramName in thisTrial02_loop.keys():
        exec(paramName + '= thisTrial02_loop.' + paramName)

for thisTrial02_loop in trial02_loop:
    currentLoop = trial02_loop
    # abbreviate parameter names if possible (e.g. rgb = thisTrial02_loop.rgb)
    if thisTrial02_loop != None:
        for paramName in thisTrial02_loop.keys():
            exec(paramName + '= thisTrial02_loop.' + paramName)
    
    #------Prepare to start Routine"fixation"-------
    t = 0
    fixationClock.reset()  # clock 
    frameN = -1
    routineTimer.add(0.500000)
    # update component parameters for each repeat
    # keep track of which components have finished
    fixationComponents = []
    fixationComponents.append(fixation_text)
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "fixation"-------
    continueRoutine = True
    while continueRoutine and routineTimer.getTime() > 0:
        # get current time
        t = fixationClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        
        # *fixation_text* updates
        if t >= 0.0 and fixation_text.status == NOT_STARTED:
            # keep track of start time/frame for later
            fixation_text.tStart = t  # underestimates by a little under one frame
            fixation_text.frameNStart = frameN  # exact frame index
            fixation_text.setAutoDraw(True)
        elif fixation_text.status == STARTED and t >= (0.0 + 0.5):
            fixation_text.setAutoDraw(False)
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in fixationComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "fixation"-------
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    
    #------Prepare to start Routine"trial02"-------
    t = 0
    trial02Clock.reset()  # clock 
    frameN = -1
    # update component parameters for each repeat
    trial02_sound.setSound(sound01)
    trial_02image.setImage(picture01)
    trial02_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
    trial02_key.status = NOT_STARTED
    # keep track of which components have finished
    trial02Components = []
    trial02Components.append(trial02_sound)
    trial02Components.append(trial_02image)
    trial02Components.append(trial02_key)
    for thisComponent in trial02Components:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "trial02"-------
    continueRoutine = True
    while continueRoutine:
        # get current time
        t = trial02Clock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        # start/stop trial02_sound
        if t >= 0.0 and trial02_sound.status == NOT_STARTED:
            # keep track of start time/frame for later
            trial02_sound.tStart = t  # underestimates by a little under one frame
            trial02_sound.frameNStart = frameN  # exact frame index
            trial02_sound.play()  # start the sound (it finishes automatically)
        
        # *trial_02image* updates
        if t >= 0.0 and trial_02image.status == NOT_STARTED:
            # keep track of start time/frame for later
            trial_02image.tStart = t  # underestimates by a little under one frame
            trial_02image.frameNStart = frameN  # exact frame index
            trial_02image.setAutoDraw(True)
        
        # *trial02_key* updates
        if t >= 0.0 and trial02_key.status == NOT_STARTED:
            # keep track of start time/frame for later
            trial02_key.tStart = t  # underestimates by a little under one frame
            trial02_key.frameNStart = frameN  # exact frame index
            trial02_key.status = STARTED
            # keyboard checking is just starting
            trial02_key.clock.reset()  # now t=0
            event.clearEvents()
        if trial02_key.status == STARTED:  # only update if being drawn
            theseKeys = event.getKeys(keyList=['z', 'm'])
            if len(theseKeys) > 0:  # at least one key was pressed
                trial02_key.keys = theseKeys[-1]  # just the last key pressed
                trial02_key.rt = trial02_key.clock.getTime()
                # abort routine on response
                continueRoutine = False
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in trial02Components:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "trial02"-------
    for thisComponent in trial02Components:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    # check responses
    if len(trial02_key.keys) == 0:  # No response was made
       trial02_key.keys=None
    # store data for trial02_loop (TrialHandler)
    trial02_loop.addData('trial02_key.keys',trial02_key.keys)
    if trial02_key.keys != None:  # we had a response
        trial02_loop.addData('trial02_key.rt', trial02_key.rt)
    thisExp.nextEntry()
    
# completed 1 repeats of 'trial02_loop'


#------Prepare to start Routine"break02"-------
t = 0
break02Clock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
break02_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
break02_key.status = NOT_STARTED
# keep track of which components have finished
break02Components = []
break02Components.append(break02_text)
break02Components.append(break02_key)
for thisComponent in break02Components:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "break02"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = break02Clock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *break02_text* updates
    if t >= 0.0 and break02_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        break02_text.tStart = t  # underestimates by a little under one frame
        break02_text.frameNStart = frameN  # exact frame index
        break02_text.setAutoDraw(True)
    
    # *break02_key* updates
    if t >= 0.0 and break02_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        break02_key.tStart = t  # underestimates by a little under one frame
        break02_key.frameNStart = frameN  # exact frame index
        break02_key.status = STARTED
        # keyboard checking is just starting
        break02_key.clock.reset()  # now t=0
        event.clearEvents()
    if break02_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            break02_key.keys = theseKeys[-1]  # just the last key pressed
            break02_key.rt = break02_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in break02Components:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "break02"-------
for thisComponent in break02Components:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

#------Prepare to start Routine"welcomeback"-------
t = 0
welcomebackClock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
welcomeback_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
welcomeback_key.status = NOT_STARTED
# keep track of which components have finished
welcomebackComponents = []
welcomebackComponents.append(welcoemback_text)
welcomebackComponents.append(welcomeback_key)
for thisComponent in welcomebackComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "welcomeback"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = welcomebackClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *welcoemback_text* updates
    if t >= 0.0 and welcoemback_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        welcoemback_text.tStart = t  # underestimates by a little under one frame
        welcoemback_text.frameNStart = frameN  # exact frame index
        welcoemback_text.setAutoDraw(True)
    
    # *welcomeback_key* updates
    if t >= 0.0 and welcomeback_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        welcomeback_key.tStart = t  # underestimates by a little under one frame
        welcomeback_key.frameNStart = frameN  # exact frame index
        welcomeback_key.status = STARTED
        # keyboard checking is just starting
        welcomeback_key.clock.reset()  # now t=0
        event.clearEvents()
    if welcomeback_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            welcomeback_key.keys = theseKeys[-1]  # just the last key pressed
            welcomeback_key.rt = welcomeback_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in welcomebackComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "welcomeback"-------
for thisComponent in welcomebackComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

#------Prepare to start Routine"instruction02"-------
t = 0
instruction02Clock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
instruction02_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
instruction02_key.status = NOT_STARTED
# keep track of which components have finished
instruction02Components = []
instruction02Components.append(instruction02_text)
instruction02Components.append(instruction02_key)
for thisComponent in instruction02Components:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "instruction02"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = instruction02Clock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *instruction02_text* updates
    if t >= 0.0 and instruction02_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        instruction02_text.tStart = t  # underestimates by a little under one frame
        instruction02_text.frameNStart = frameN  # exact frame index
        instruction02_text.setAutoDraw(True)
    
    # *instruction02_key* updates
    if t >= 0.0 and instruction02_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        instruction02_key.tStart = t  # underestimates by a little under one frame
        instruction02_key.frameNStart = frameN  # exact frame index
        instruction02_key.status = STARTED
        # keyboard checking is just starting
        instruction02_key.clock.reset()  # now t=0
        event.clearEvents()
    if instruction02_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['space'])
        if len(theseKeys) > 0:  # at least one key was pressed
            instruction02_key.keys = theseKeys[-1]  # just the last key pressed
            instruction02_key.rt = instruction02_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in instruction02Components:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "instruction02"-------
for thisComponent in instruction02Components:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

#------Prepare to start Routine"ready"-------
t = 0
readyClock.reset()  # clock 
frameN = -1
routineTimer.add(2.000000)
# update component parameters for each repeat
# keep track of which components have finished
readyComponents = []
readyComponents.append(ready_text)
for thisComponent in readyComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "ready"-------
continueRoutine = True
while continueRoutine and routineTimer.getTime() > 0:
    # get current time
    t = readyClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *ready_text* updates
    if t >= 0.0 and ready_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        ready_text.tStart = t  # underestimates by a little under one frame
        ready_text.frameNStart = frameN  # exact frame index
        ready_text.setAutoDraw(True)
    elif ready_text.status == STARTED and t >= (0.0 + 2.0):
        ready_text.setAutoDraw(False)
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in readyComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "ready"-------
for thisComponent in readyComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

# set up handler to look after randomisation of conditions etc
cat_loop = data.TrialHandler(nReps=5, method='random', 
    extraInfo=expInfo, originPath=None,
    trialList=data.importConditions('STHW categorization.xlsx'),
    seed=None, name='cat_loop')
thisExp.addLoop(cat_loop)  # add the loop to the experiment
thisCat_loop = cat_loop.trialList[0]  # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb=thisCat_loop.rgb)
if thisCat_loop != None:
    for paramName in thisCat_loop.keys():
        exec(paramName + '= thisCat_loop.' + paramName)

for thisCat_loop in cat_loop:
    currentLoop = cat_loop
    # abbreviate parameter names if possible (e.g. rgb = thisCat_loop.rgb)
    if thisCat_loop != None:
        for paramName in thisCat_loop.keys():
            exec(paramName + '= thisCat_loop.' + paramName)
    
    #------Prepare to start Routine"fixation"-------
    t = 0
    fixationClock.reset()  # clock 
    frameN = -1
    routineTimer.add(0.500000)
    # update component parameters for each repeat
    # keep track of which components have finished
    fixationComponents = []
    fixationComponents.append(fixation_text)
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "fixation"-------
    continueRoutine = True
    while continueRoutine and routineTimer.getTime() > 0:
        # get current time
        t = fixationClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        
        # *fixation_text* updates
        if t >= 0.0 and fixation_text.status == NOT_STARTED:
            # keep track of start time/frame for later
            fixation_text.tStart = t  # underestimates by a little under one frame
            fixation_text.frameNStart = frameN  # exact frame index
            fixation_text.setAutoDraw(True)
        elif fixation_text.status == STARTED and t >= (0.0 + 0.5):
            fixation_text.setAutoDraw(False)
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in fixationComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "fixation"-------
    for thisComponent in fixationComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    
    #------Prepare to start Routine"catergorization"-------
    t = 0
    catergorizationClock.reset()  # clock 
    frameN = -1
    # update component parameters for each repeat
    cat_sound.setSound(sound01)
    cat_image.setImage(picture01)
    cat_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
    cat_key.status = NOT_STARTED
    # keep track of which components have finished
    catergorizationComponents = []
    catergorizationComponents.append(cat_sound)
    catergorizationComponents.append(cat_image)
    catergorizationComponents.append(cat_key)
    for thisComponent in catergorizationComponents:
        if hasattr(thisComponent, 'status'):
            thisComponent.status = NOT_STARTED
    
    #-------Start Routine "catergorization"-------
    continueRoutine = True
    while continueRoutine:
        # get current time
        t = catergorizationClock.getTime()
        frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
        # update/draw components on each frame
        # start/stop cat_sound
        if t >= 0.2 and cat_sound.status == NOT_STARTED:
            # keep track of start time/frame for later
            cat_sound.tStart = t  # underestimates by a little under one frame
            cat_sound.frameNStart = frameN  # exact frame index
            cat_sound.play()  # start the sound (it finishes automatically)
        
        # *cat_image* updates
        if t >= 0.2 and cat_image.status == NOT_STARTED:
            # keep track of start time/frame for later
            cat_image.tStart = t  # underestimates by a little under one frame
            cat_image.frameNStart = frameN  # exact frame index
            cat_image.setAutoDraw(True)
        
        # *cat_key* updates
        if t >= 0.2 and cat_key.status == NOT_STARTED:
            # keep track of start time/frame for later
            cat_key.tStart = t  # underestimates by a little under one frame
            cat_key.frameNStart = frameN  # exact frame index
            cat_key.status = STARTED
            # keyboard checking is just starting
            cat_key.clock.reset()  # now t=0
            event.clearEvents()
        if cat_key.status == STARTED:  # only update if being drawn
            theseKeys = event.getKeys(keyList=['z', 'm'])
            if len(theseKeys) > 0:  # at least one key was pressed
                cat_key.keys = theseKeys[-1]  # just the last key pressed
                cat_key.rt = cat_key.clock.getTime()
                # abort routine on response
                continueRoutine = False
        
        # check if all components have finished
        if not continueRoutine:  # a component has requested that we end
            routineTimer.reset()  # this is the new t0 for non-slip Routines
            break
        continueRoutine = False  # will revert to True if at least one component still running
        for thisComponent in catergorizationComponents:
            if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
                continueRoutine = True
                break  # at least one component has not yet finished
        
        # check for quit (the [Esc] key)
        if event.getKeys(["escape"]):
            core.quit()
        
        # refresh the screen
        if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
            win.flip()
    
    #-------Ending Routine "catergorization"-------
    for thisComponent in catergorizationComponents:
        if hasattr(thisComponent, "setAutoDraw"):
            thisComponent.setAutoDraw(False)
    # check responses
    if len(cat_key.keys) == 0:  # No response was made
       cat_key.keys=None
    # store data for cat_loop (TrialHandler)
    cat_loop.addData('cat_key.keys',cat_key.keys)
    if cat_key.keys != None:  # we had a response
        cat_loop.addData('cat_key.rt', cat_key.rt)
    thisExp.nextEntry()
    
# completed 5 repeats of 'cat_loop'


#------Prepare to start Routine"thankyou"-------
t = 0
thankyouClock.reset()  # clock 
frameN = -1
# update component parameters for each repeat
thanks_key = event.BuilderKeyResponse()  # create an object of type KeyResponse
thanks_key.status = NOT_STARTED
# keep track of which components have finished
thankyouComponents = []
thankyouComponents.append(thanks_text)
thankyouComponents.append(thanks_key)
for thisComponent in thankyouComponents:
    if hasattr(thisComponent, 'status'):
        thisComponent.status = NOT_STARTED

#-------Start Routine "thankyou"-------
continueRoutine = True
while continueRoutine:
    # get current time
    t = thankyouClock.getTime()
    frameN = frameN + 1  # number of completed frames (so 0 is the first frame)
    # update/draw components on each frame
    
    # *thanks_text* updates
    if t >= 0.0 and thanks_text.status == NOT_STARTED:
        # keep track of start time/frame for later
        thanks_text.tStart = t  # underestimates by a little under one frame
        thanks_text.frameNStart = frameN  # exact frame index
        thanks_text.setAutoDraw(True)
    
    # *thanks_key* updates
    if t >= 0.0 and thanks_key.status == NOT_STARTED:
        # keep track of start time/frame for later
        thanks_key.tStart = t  # underestimates by a little under one frame
        thanks_key.frameNStart = frameN  # exact frame index
        thanks_key.status = STARTED
        # keyboard checking is just starting
        thanks_key.clock.reset()  # now t=0
        event.clearEvents()
    if thanks_key.status == STARTED:  # only update if being drawn
        theseKeys = event.getKeys(keyList=['e'])
        if len(theseKeys) > 0:  # at least one key was pressed
            thanks_key.keys = theseKeys[-1]  # just the last key pressed
            thanks_key.rt = thanks_key.clock.getTime()
            # abort routine on response
            continueRoutine = False
    
    # check if all components have finished
    if not continueRoutine:  # a component has requested that we end
        routineTimer.reset()  # this is the new t0 for non-slip Routines
        break
    continueRoutine = False  # will revert to True if at least one component still running
    for thisComponent in thankyouComponents:
        if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
            continueRoutine = True
            break  # at least one component has not yet finished
    
    # check for quit (the [Esc] key)
    if event.getKeys(["escape"]):
        core.quit()
    
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

#-------Ending Routine "thankyou"-------
for thisComponent in thankyouComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

# Shutting down:
win.close()
core.quit()

Jonathan Peirce

unread,
Jan 14, 2013, 4:01:51 AM1/14/13
to psychop...@googlegroups.com
The critical issue for images is how large they are in pixels, not how much space they consume on the disk. When saved to disk most images are compressed to varying degrees (which is why jpg images consume less space than bmp images of the same size). To be rendered onto the screen they have to be converted into 3 values (RGB) for each pixel which takes more space than your jpg image. Your computer memory is very very unlikely to be the problem, but the graphics card memory might be running out.

How large are your images in pixels (and how large do you *need* them to be)?

Jon
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/LjmcXVubXIEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

Jazz

unread,
Jan 14, 2013, 8:33:48 AM1/14/13
to psychop...@googlegroups.com
Hi Jim, thank you very much for your reply. I just removed visual information (i.e., pictures) and ran
the experiment. The results were significant; Psychopy was playing sound files with accurate fixation
duration. Given this, I can believe that picture size is causing the problem. I checked a picture and
looked into the dimension information. For this specific photo, it was 2136 × 1424 (mm). When I used
Photo shop, pixel was set at 600, I think. I believe this is the cause you suspect? What I want is a clear picture
which fit in a 15 inch screen. Do you think photos with 300 will do? If not, what would be suitable resolution?

Jeremy Gray

unread,
Jan 14, 2013, 8:40:13 AM1/14/13
to psychop...@googlegroups.com
you'll just have to try several sizes in order to find out what is acceptable image resolution for you. there will be tradeoffs, and only you know what is important to you.

--Jeremy


--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/LdoooE1pD7kJ.

Jonathan Peirce

unread,
Jan 14, 2013, 10:03:22 AM1/14/13
to psychop...@googlegroups.com
You could find out the resolution of the screen from the windows control
panel. It's likely to be something like 1280x1024 or 1920x1080. That
would be the absolute maximum sensible size (because anything bigger is
being shrunk to that anyway) but probably you can get away with
something quite a bit smaller. I would try rescaling to 800x600 and see
how that looks.

Jon
> --
> You received this message because you are subscribed to the Google
> Groups "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to
> psychopy-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/psychopy-users/-/LdoooE1pD7kJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

David McFarlane

unread,
Jan 14, 2013, 4:00:56 PM1/14/13
to psychop...@googlegroups.com
Could someone help make sure I read this
correctly? "Jazz" says the photo was "2136 x
1424 (mm)" -- i.e., about 2 x 1.4 meters! And
does "pixel was set at 600" mean 600 pixels per
inch? That would make a picture of 1,281,600 x
854,400 pixels, totaling over 1 Gpixel (yes,
that's gigapixels)! And a 15" monitor with 1920
x 1080 resolution still provides less than 150
dpi, so 300 dpi would still be overkill (about 5160 x 2900).

Thanks,
-- David McFarlane


At 1/14/2013 10:03 AM Monday, Jonathan Peirce wrote:
>You could find out the resolution of the screen
>from the windows control panel. It's likely to
>be something like 1280x1024 or 1920x1080. That
>would be the absolute maximum sensible size
>(because anything bigger is being shrunk to that
>anyway) but probably you can get away with
>something quite a bit smaller. I would try
>rescaling to 800x600 and see how that looks.
>
>Jon
>
>On 14/01/2013 13:33, Jazz wrote:
>>Hi Jim, thank you very much for your reply. I
>>just removed visual information (i.e., pictures) and ran
>>the experiment. The results were significant;
>>Psychopy was playing sound files with accurate fixation
>>duration. Given this, I can believe that
>>picture size is causing the problem. I checked a picture and
>>looked into the dimension information. For this
>>specific photo, it was 2136 × 1424 (mm). When I used

Jazz

unread,
Jan 14, 2013, 8:00:03 PM1/14/13
to psychop...@googlegroups.com
Hi David, I checked my photos with Windows today. "2136 x 1424" was in pixel, not mm.
I am sorry that I made you confused. Now my experiment is working fine.

Can I ask one more question? If pictures are large, Psychopy will make them
shrunk. Does it change the size of photos in certain way? I initially created photos with
800 x 600.When Psychopy displayed the photos, they appeared on the screen pretty small.
I do not think Psychopy displayed the photos with the original size.

Thank you very much for all support so far.

Michael MacAskill

unread,
Jan 14, 2013, 8:20:43 PM1/14/13
to psychop...@googlegroups.com
Unless you explicitly scale the images (using the "size" parameter), PsychoPy will display images at their actual size, where 1 pixel in the image = 1 pixel on the screen. So if your screen has a size of 800 x 600, then your image would fill it entirely. If the screen is 1024 x 768, then it will fill most of the screen but have a blank border around it, and so on for larger screen dimensions.

We can't help much unless we know:

(1) What the pixel dimensions of your screen are (find out from the control panel in Windows or System Preferences in OS X)?

(2) What exactly "appeared on the screen pretty small" means.

(2) Have you specified anything in the "size" parameter of your image stimuli?

Regards,

Mike

Jonathan Peirce

unread,
Jan 15, 2013, 10:12:13 AM1/15/13
to psychop...@googlegroups.com
That error has been reported here and did seem to be due to an encoding/decoding problem with one (or more) of the movies rather than anything to do with the volume of material being loaded:
https://groups.google.com/forum/?fromgroups=#!topic/psychopy-users/KYT5wJcuOv0

You might see if it's always the same movie(s) that cause the crash when it occurs, but I suspect switching to the other format is the way to go.

Jon

On 15/01/2013 14:51, hoy...@gmail.com wrote:
Hi all,

I was actually about to post this same error, except in my case, the memory problem occurs during a video. The video will freeze, and after several seconds with the script still running despite the frozen screen, it will crash. As noted, this error is very vexing because it is so inconsistent and hard to debug. There are two videos in the script, and it will crash at different points during either video or simply run through with no problem. See below for the relevant code and the error message.

I'm surprised to see this problem with simpler audio/picture. My videos are 1280x720 (.avi) and 3 minutes long with no audio, but the script plays the video at (700,500). Do you think this resampling to a smaller window is causing trouble? I haven't tested that, but the error occurs on various monitors [1024x768 projector in the scanner; 1920x1200 Samsung Synch Master Display (linked) and 1440x900 (native screen)] and is being run on a 2009 Macbook Pro (Specs: NVIDIA GeForce 9400M 256 MB graphics card, 3.06 GHz Intel Core 2 Duo, 8 GB (RAM) 1067 MHz DDR3). 

The error message seems to indicate a problem potentially even underneath Python with a memory leak in the implementation in C. Interestingly, my latest attempt at troubleshooting was to try the same movies converted to .mov files instead of .avi to avoid the Python script "avbin.py" that is part of the error, and I have yet to produce a crash using the .mov files, even though they're roughly the same size (~121 MB instead of 127 MB for .avi). I'm not convinced it's fixed though, because I've only been testing with .mov for a day and originally thought the paradigm was good-to-go until the video first crashed while a subject was in the scanner.

Any thoughts? Thanks for your help!! Also, thanks for providing these PsychoPy tools and such great support!



THE CODE (from Coder):
"""
#earlier initialization
movie1_Filename='../multimedia/FishTank_3min_1.1.mov';
movie1_Duration=180;
movie1=visual.MovieStim(win,filename=movie1_Filename, size=(700,500));

#later on after other stuff like n-back and printed math problems...
Instr_Video_S.draw();Instr_Rest_Window.draw();Instr_Video_Image.draw();win.flip();
win.logOnFlip('TASK [VIDEO (A)]: Instructions FRAME TIME = %s' %(win.lastFrameT),logging.DATA);
t=0;
Elapsed_Time=Elapsed_Time+Instr_Duration;
while t<Elapsed_Time:
    t=clock.getTime();
textNum3.draw();win.flip();core.wait(textNum_dur);textNum2.draw();win.flip();core.wait(textNum_dur);
textNum1.draw();win.flip();core.wait(textNum_dur);textNum0.draw();win.flip();core.wait(textNum_dur);

Elapsed_Time=Elapsed_Time+(textNum_dur*4)+movie1_Duration;
t=0;
win.flip();win.logOnFlip('TASK [VIDEO (A)]: Video ' + movie1_Filename + ' Starts FRAME TIME = %s' %(win.lastFrameT),logging.DATA);
while t<Elapsed_Time:
    movie1.draw();
    win.update();
    for key in event.getKeys(keyList=['escape','q'], timeStamped=False):
        if key in ['escape','q']:                                                                       #could also be if key != [] or something to that effect
            win.close();
            core.quit();
    t=clock.getTime();
movie1.stop();
win.flip();
win.logOnFlip('TASK [VIDEO (A)]: Video ' + movie1_Filename + ' Ends FRAME TIME = %s' %(win.lastFrameT),logging.DATA);
win.logOnFlip('Keys Pressed during Video (A) = %s' %(event.getKeys(keyList=[LeftKey, RightKey], timeStamped=clock)),logging.DATA);win.flip();
"""


THE ERROR:
"""
python(34154,0xaca6e2c0) malloc: *** mmap(size=2764800) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Traceback (most recent call last):
  File "/Users/hoycw/Documents/PsychoPy_Demos/Combined_Task/code/training2.1Pilot_R1_TR1.5.py", line 216, in <module>
    win.update();
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/psychopy/visual.py", line 525, in update
    self.flip(clearBuffer=True)#clearBuffer was the original behaviour for win.update()
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/psychopy/visual.py", line 443, in flip
    pyglet.media.dispatch_events()#for sounds to be processed
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/__init__.py", line 1404, in dispatch_events
    player.dispatch_events()
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/__init__.py", line 934, in dispatch_events
    self._fill_audio()
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/__init__.py", line 712, in _fill_audio
    for audio_data, audio_format in self._get_audio_data(write_size):
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/__init__.py", line 747, in _get_audio_data
    audio_data = source._get_audio_data(bytes)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/avbin.py", line 355, in _get_audio_data
    packet = self._get_packet_for_stream(self._audio_stream_index)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/avbin.py", line 321, in _get_packet_for_stream
    buffered_image = self._decode_video_packet(self._packet)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/pyglet/media/avbin.py", line 393, in _decode_video_packet
    buffer = (ctypes.c_uint8 * (pitch * height))()
MemoryError
"""
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/EqtFg2V_pWIJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Colin Hoy

unread,
Jan 15, 2013, 11:16:33 AM1/15/13
to psychop...@googlegroups.com
Thanks for the quick reply Jon, suppose I should've searched the message board more thoroughly.

Any of 6 movies will crash (there are 3 runs of the same code with 2 movies each, but each run has a different 2 movies), but all of them are 3 min chunks trimmed from the same longer movie in the same way. It seems like that problem was never fully resolved, but did we ever find out what file types or encoding/decoding he was using, either the ones that worked or those that didn't? If not, are you aware of any advantages of certain movie type over others?

The one other small difference is that my videos crash in different places, and the crashes are inconsistent, which is still a bit puzzling... I agree it shouldn't be the amount of material loaded, but I guess I'll stick with my switch to .mov work around until it fails me.

Thanks again,
Colin Hoy
Reply all
Reply to author
Forward
0 new messages