Hi psychopy community,
Getting my feet wet with psychopy and have run into an error when trying to create a visual.MovieStim3 object.
Potentially useful information about my setup:
- Using psychopy standalone version 1.90.2, python 3
- Running on Windows 10 laptop
- Dual monitor setup, second monitor UHD
The problem:
I am unable to create a movie object. I’ve tried with all 3 MovieStim classes and they all produce the same error of the SetDeviceGammaRamp failing. This is regardless of which monitor I display to. It seems to be a problem of windll.gdi32.SetDeviceGammaRamp(…) in visual.backends.gamma failing.
Since the comments say this doesn’t always work the first time on Windows machines, I tried increasing the number of time setGammaRamp tries this function with same results.
I’m not sure if it’s relevant, but psychopy also warns me about the full screen size I request being different from the monitor’s size, although this value is taken directly from the monitor display and matches in the windows control panel. And complains about not being able to measure a consistent frame rate.
Minimal (Non)Working Example that generates error:
import psychopy
psychopy.useVersion('latest')
from psychopy import monitors, visual
expMonitor = monitors.Monitor('subjectMonitor')
SCREEN_SIZE = (3840,2160)
window2use = visual.Window(
SCREEN_SIZE, fullscr=True, screen=0,
allowGUI=False, allowStencil=False,
monitor=expMonitor, color=[0,0,0], colorSpace='rgb')
movieFullPath = r'C:\Users\Megan\Documents\socEvalTask\socialEvaluationTask\psychopyPilot\videos\negative_female_05_05_05.mp4'
thisMovie = visual.MovieStim3(win=window2use, name='testmovie',
noAudio = False, filename = movieFullPath)
win.close()
core.quit()
Warnings and Stack Trace:
##### Running: C:\Users\Megan\Documents\socEvalTask\socialEvaluationTask\psychopyPilot\MWE3.py #####
1.3201 WARNING Monitor specification not found. Creating a temporary one...
1.3218 WARNING User requested fullscreen with size [3840 2160], but screen is actually [2560, 1440]. Using actual size
5.0339 WARNING Couldn't measure a consistent frame rate.
- Is your graphics card set to sync to vertical blank?
- Are you running other processes on your computer?
5.0387 WARNING avbin.dll failed to load. Try importing psychopy.visual as the first library (before anything that uses scipy) or use a differentmovie backend (e.g. moviepy).
Traceback (most recent call last):
File "C:\Users\Megan\Documents\socEvalTask\socialEvaluationTask\psychopyPilot\MWE3.py", line 20, in <module>
opacity=1, depth=-1.0)
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\contrib\lazy_import.py", line 120, in __call__
return obj(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'noAudio'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\visual\window.py", line 472, in close_on_exit
self.close()
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\visual\window.py", line 1124, in close
self.backend.close() # moved here, dereferencing the window prevents
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\visual\backends\pygletbackend.py", line 361, in close
self.gammaRamp = self._origGammaRamp
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\tools\attributetools.py", line 32, in __set__
newValue = self.func(obj, value)
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\visual\backends\pygletbackend.py", line 323, in gammaRamp
xDisplay=self.xDisplay)
File "C:\Program Files (x86)\PsychoPy2_PY3\lib\site-packages\psychopy\visual\backends\gamma.py", line 91, in setGammaRamp
assert success, 'SetDeviceGammaRamp failed'
AssertionError: SetDeviceGammaRamp failed
Any ideas of what could be causing this?
~Meg