Breakdown after stimulus random stop

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2022.2.1
What are you trying to achieve?:
I have this experiment and my question is about the ‘movies’-routine:

I show movies and want them to stop at different moments, in a random order as specified in the code:

And it actually works, the movie stops at one of these durations - but not only the movie stops, but the whole experiment, it doesn’t go to the next routine.

At the beginning and the end of the routine I did the following:

in the movie properties, I specified the Stop duration with the created variable:

My loops looks like this, each movie should be shown once:
image

What specifically went wrong when you tried that?:
When I run the experiment, the movie stops as I desire, but also the whole experiment stops and
I get the following error message:

If anyone has an idea why the whole experiment stops, I would be thankful to learn about it :slight_smile: Thank you very much!!

If you change $stim_dur to stim_dur[trials_3.thisN] does it run further along? I don’t think the “$” is required with the timing boxes, but if that doesn’t work try it with the “$” back in front.

1 Like

Hi :slight_smile:
Thank you for your reply.
With this specification, the movies don’t start to play anymore (with and without $).
I don’t know if it matters, but the output data file the trials_3.thisN column empty

I get the following error:

Does it playthrough if you put in a time instead of a coded time? So if you put a duration of 10 seconds for testing purposes, does it move to the next file or does it still throw an error?

Yes, if I put 10 sec it works fine.

Anyone has some further ideas how I can make my experiment run? :pray:

Could you please provide a copy of

  • the .log file from your data folder (after running with your initial set-up, not with the suggested fix above)?
  • your Builder .psyexp file, and
  • the empathymovie.xlsx conditions file.

But before doing that, please:

  • delete the sstim_dur = 0 from the “begin experiment” tab – it isn’t (or shouldn’t) be doing anything, if sstim_dur gets defined in the “begin routine” tab.
  • please also confirm the actual durations of the movie files – in particular, do they all exceed 60 s?

PS Your approach seems perfectly sensible – so it isn’t clear why it isn’t working.

1 Like

Hello,

Thank you so much for your reply.
All movie files are longer than 1.41min.
When I use the newest version of psychopy, the movies doesn’t start because PsychoPy does not respond anymore. In this version I upload now, I used the version 2020.1.1.

A second point that occurs now is that the movie presentation is 50 or 60 sec, even though I put the code on showing between 0.5 and 3 sec.

Here are the 3 files:
psychpyZip.zip (10.8 KB)

Thank you very very much!

Thanks, that all seems OK, although the log file doesn’t give any useful information.

Going back to you original report, can you scroll up there and provide the entire error report? I’m guessing it starts earlier and will give us a clue as to where in your script (as opposed to within ffpyplater_player.py) the error arises.

Hi Michael,

thanks so much for your help.
Here is the complete error report

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Program Files\PsychoPy\lib\runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 253, in
compileScript(args.infile, args.version, args.outfile)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 242, in compileScript
thisExp = _getExperiment(infile, version)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 137, in _getExperiment
thisExp = experiment.Experiment()
File “C:\Users\rwolm\AppData\Roaming\psychopy3\versions\psychopy\experiment_experiment.py”, line 89, in init
settingsComp = getComponents(fetchIcons=False)[‘SettingsComponent’]
File "C:\Users\rwolm\AppData\Roaming\psychopy3\versions\psychopy\experiment\components_init
.py", line 153, in getComponents
if hasattr(module, ‘file’) and module.file.endswith(‘.pyc’):
AttributeError: ‘NoneType’ object has no attribute ‘endswith’

Running: C:\Users\rwolm\OneDrive\Desktop\Bianca Francesca\empathy - Copy_lastrun.py

pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
136.8279 EXP Imported empathymovie.xlsx as conditions, 5 conditions, 1 params
136.8320 EXP Imported empathymovie.xlsx as conditions, 5 conditions, 1 params
136.8399 EXP Imported VAS.xlsx as conditions, 6 conditions, 1 params
136.8400 WARNING duplicate variable names: empathymovies
136.8485 INFO Loaded monitor calibration from [‘2022_07_02 13:30’]
136.8923 EXP Imported empathymovie.xlsx as conditions, 5 conditions, 1 params
136.8964 EXP Imported empathymovie.xlsx as conditions, 5 conditions, 1 params
136.9007 EXP Imported VAS.xlsx as conditions, 6 conditions, 1 params
136.9008 WARNING duplicate variable names: empathymovies
Traceback (most recent call last):
Hello from the pygame community. Contribute - pygame wiki
9.1511 WARNING launchHubServer: If using the iohub mouse or eyetracker devices, fullScr should be True.
File “C:\Users\rwolm\OneDrive\Desktop\Bianca Francesca\empathy - Copy_lastrun.py”, line 489, in
movie.stop()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\movies_init_.py”, line 346, in stop
self._player.stop(log=log)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\movies\players\ffpyplayer_player.py”, line 831, in stop
raise RuntimeError(“Cannot close stream, not opened yet.”)
RuntimeError: Cannot close stream, not opened yet.
[ffpyplayer_abuffersink @ 000001e527b70140] Removing channel layout 0x3, redundant with 2 channels
1.7275 WARNING Monitor specification not found. Creating a temporary one…
[ffpyplayer_abuffersink @ 000001e527b6f340] Removing channel layout 0x3, redundant with 2 channels
################# Experiment ended with exit code 1 [pid:9976] #################
182.5773 EXP Imported empathymovie.xlsx as conditions, 5 conditions, 1 params
182.5816 EXP Imported empathymovie.xlsx as conditions, 5 conditions, 1 params
182.5858 EXP Imported VAS.xlsx as conditions, 6 conditions, 1 params
182.5858 WARNING duplicate variable names: empathymovies
182.5881 INFO Loaded monitor calibration from [‘2022_07_02 13:30’]

There is no solution for this error ?

raise RuntimeError(“Cannot close stream, not opened yet.”)

I was opening this new thread with maybe a more precise title: Raise RuntimeError(“Cannot close stream, not opened yet.”)
Maybe it helps to find a solution