Error when starting an experiment with audio files

Hello everyone!

Details of what I am using:
OS : Windows 7
Psychopy 3 version 2020.2.5
Standalone

What are you trying to achieve?: I am trying to run an experiment: I am presenting either an X or an O at either side of the screen and simultaneously presenting an auditory stimuli. The experiment runs perfectly on my laptop and my collegue’s laptop; however, when I try to run it on a lab computer it does not even start. The lab computer has Windows 7 and old speakers attached. I am getting errors mostly about audio preferences.

What did you try to make it work?: Changed psychopy version, tried running it on different computers but only runs with laptops with no external audio device, we tried to run it with a computer with windows 10 and it works, changed the order of the psychopy audio preferences.

See image for error output.

Thank you in advance!

In the experiment settings, try setting the audio library to be something other than ptb - it looks like the ptb library and Windows 7 don’t play well together

Thank you for the suggestion @TParsons , but the problem remains. I tried to change the audio latency priority as well as the audio library and it does not change the errors.

Could you share the full error message? You can copy and paste text from the Stdout

@TParsons Here is the full error message. I am starting to believe that it is a compatibility issue with the audio/speakers and windows 7. Let me know if you believe there is another issue in this error message that I could target.

Hello from the pygame community. https://www.pygame.org/contribute.html
PTB-ERROR: Desired ultralow-latency audio parameters for device -1 unsupported by operating system, as this would require Windows-10 or later.
INTERNAL PSYCHTOOLBOX ERROR
error: PsychError_system
general description: Error reported by a system call
specific description: Failed to open PortAudio audio device due to unsupported reqlatencyclass 4 on operating system older than Windows 10.
module name: PsychPortAudio
subfunction call: Open
file name: ./PsychSourceGL/Source/Common/PsychPortAudio\PsychPortAudio.c
function name: PSYCHPORTAUDIOOpen
line number: 2816
PsychPortAudio:Open: See error message printed above.
PTB-ERROR: Desired ultralow-latency audio parameters for device -1 unsupported by operating system, as this would require Windows-10 or later.
INTERNAL PSYCHTOOLBOX ERROR
error: PsychError_system
general description: Error reported by a system call
specific description: Failed to open PortAudio audio device due to unsupported reqlatencyclass 4 on operating system older than Windows 10.
module name: PsychPortAudio
subfunction call: Open
file name: ./PsychSourceGL/Source/Common/PsychPortAudio\PsychPortAudio.c
function name: PSYCHPORTAUDIOOpen
line number: 2816
PsychPortAudio:Open: See error message printed above.
73.6608 WARNING User requested fullscreen with size [1280 720], but screen is actually [1280, 1024]. Using actual size
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 231, in init
channels=channels,
File “C:\Program Files\PsychoPy3\lib\site-packages\psychtoolbox\audio.py”, line 107, in init
flags)
OSError: [WinError 0] Der Vorgang wurde erfolgreich beendet

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\User\Desktop\EmbCog_Exp\Exp1\CompBasedExp_lastrun.py”, line 151, in
name=‘Task2’)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 334, in init
hamming=self.hamming)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 428, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound_base.py”, line 179, in setSound
hamming=hamming)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound_base.py”, line 213, in _setSndFromNote
self._setSndFromFreq(thisFreq, secs, hamming=hamming)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound_base.py”, line 229, in _setSndFromFreq
self._setSndFromArray(outArr)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 500, in _setSndFromArray
self.track = audio.Slave(self.stream.handle, data=self.sndArr,
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 582, in stream
blockSize=self.blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 143, in getStream
blockSize=blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 189, in _getStream
device=defaultOutput)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py”, line 237, in init
channels=channels,
File “C:\Program Files\PsychoPy3\lib\site-packages\psychtoolbox\audio.py”, line 107, in init
flags)
OSError: [WinError 0] Der Vorgang wurde erfolgreich beendet

Experiment ended.

12.0872 DEBUG Started sendUsageStats at 0.0
33.1568 WARNING Couldn’t connect to psychopy.org
Check internet settings (and proxy setting in PsychoPy Preferences.
40.1231 DEBUG Finished sendUsageStats at 28.036999940872192
40.1231 DEBUG Started checkForUpdates at 28.037999868392944
41.7074 DEBUG Read Excel file with pandas: Stim.xlsx
41.7082 DEBUG Clearing unnamed columns from Stim.xlsx
41.7089 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
41.7125 DEBUG Read Excel file with pandas: BlockType.xlsx
41.7132 DEBUG Clearing unnamed columns from BlockType.xlsx
41.7134 EXP Imported BlockType.xlsx as conditions, 2 conditions, 2 params
41.7177 DEBUG Read Excel file with pandas: Stim.xlsx
41.7184 DEBUG Clearing unnamed columns from Stim.xlsx
41.7191 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
41.7235 DEBUG Read Excel file with pandas: Stim.xlsx
41.7242 DEBUG Clearing unnamed columns from Stim.xlsx
41.7248 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
41.7249 WARNING duplicate variable names: correctVisual, side, trialStatus, text, filePath, letterStimulus, correctAuditory
41.7262 INFO Loaded monitor calibration from [‘2020_11_03 15:03’]
45.1963 DEBUG Read Excel file with pandas: Stim.xlsx
45.1971 DEBUG Clearing unnamed columns from Stim.xlsx
45.1977 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
45.2012 DEBUG Read Excel file with pandas: BlockType.xlsx
45.2020 DEBUG Clearing unnamed columns from BlockType.xlsx
45.2022 EXP Imported BlockType.xlsx as conditions, 2 conditions, 2 params
45.2066 DEBUG Read Excel file with pandas: Stim.xlsx
45.2074 DEBUG Clearing unnamed columns from Stim.xlsx
45.2081 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
45.2123 DEBUG Read Excel file with pandas: Stim.xlsx
45.2130 DEBUG Clearing unnamed columns from Stim.xlsx
45.2136 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
45.2137 WARNING duplicate variable names: correctVisual, side, trialStatus, text, filePath, letterStimulus, correctAuditory
45.2145 INFO Loaded monitor calibration from [‘2020_11_03 15:03’]
50.0220 DEBUG Read Excel file with pandas: Stim.xlsx
50.0227 DEBUG Clearing unnamed columns from Stim.xlsx
50.0234 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
50.0270 DEBUG Read Excel file with pandas: BlockType.xlsx
50.0277 DEBUG Clearing unnamed columns from BlockType.xlsx
50.0279 EXP Imported BlockType.xlsx as conditions, 2 conditions, 2 params
50.0322 DEBUG Read Excel file with pandas: Stim.xlsx
50.0330 DEBUG Clearing unnamed columns from Stim.xlsx
50.0337 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
50.0379 DEBUG Read Excel file with pandas: Stim.xlsx
50.0386 DEBUG Clearing unnamed columns from Stim.xlsx
50.0393 EXP Imported Stim.xlsx as conditions, 8 conditions, 6 params
50.0394 WARNING duplicate variable names: correctVisual, side, trialStatus, text, filePath, letterStimulus, correctAuditory
50.0416 INFO C:\Program Files\PsychoPy3\python.exe -m psychopy.scripts.psyexpCompile C:\Users\User\Desktop\EmbCog_Exp\Exp1\CompBasedExp.psyexp -o C:\Users\User\Desktop\EmbCog_Exp\Exp1\CompBasedExp_lastrun.py -v latest
77.8080 DEBUG Finished checkForUpdates at 65.72499990463257
77.8081 DEBUG Started checkNews at 65.72499990463257
112.8117 DEBUG Finished checkNews at 100.73099994659424
112.8118 DEBUG Started showTips at 100.73099994659424
116.3229 DEBUG Finished showTips at 104.242999792099
116.3229 DEBUG Started updateVersionChooser at 104.242999792099
173.1503 DEBUG Finished updateVersionChooser at 161.07399988174438
173.1504 DEBUG Started showNews at 161.07399988174438
173.1504 DEBUG Finished showNews at 161.07399988174438
173.4096 DEBUG Started getPavloviaUser at 161.3329999446869
173.4097 DEBUG Finished getPavloviaUser at 161.3329999446869

I think you’re spot on there, it looks like the audio drivers for your speakers are asking PTB for some low latency feature which Windows 7 doesn’t support. I thought changing the audio provider might get around the issue by avoiding PTB but looks like it hits it at some backend anyway. I’d suggest either using some different speakers or a computer running Windows 10

1 Like