Issues with Sound and Movie components in one program

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Ubuntu 22.04.2 & Windows 11 (22H2)
PsychoPy version (e.g. 1.84.x): 2023.1.2 & 2022.2.5
Standard Standalone? (y/n) y
What are you trying to achieve?:
Play sound and movie (not simultaneously) in an experiment.

What did you try to make it work?:
Numerous attempts over a week.

What specifically went wrong when you tried that?:

movie backend: ffpyplayer & moviepy
audio backend: ptb

movie file: 48kHz and 44.1kHz
sound file: 48kHz and 44.1kHz

I’m testing an experiment including a movie (with sound) and audio playing. The movie playing was affected by the existence of any sound component in an experiment even the movie and sound components are set in different Routines. Here are some specific symptoms:

In PsychoPy 2023.1.2:

When sound Routine is set before the movie Routine, the sound can play nicely, but the movie would be played at 2x-4x speed without any sound (even though the movie is set to play sound).

When the movie Routine is set before the sound Routine, the movie would be played at normal speed without any sound, and the audio would be played normally after the movie offset.

Also, if the movie is set to loop, the movie plays only once then stops.

Movie playing is normal (with sound and can loop) if I remove the sound Routine.

Movie playing is also normal (with sound and can loop) if I create a sound object in a code component AFTER the movie routine.

It seems the creation of Sound component affected movie component.

When I tested it with PsychoPy 2023.1.2, I did patch psychopy/sound/backend_ptb.py with this version:
8472687

When I tested everything above with moviepy as the movie engine, the program would crash.

In PsychoPy 2022.2.5:
I did exactly the same tests with PsychoPy 2022.2.5 by reinstalling PsychoPy rather than use version control in 2023.1.2.

The only thing works was when I play movie with moviepy. ffpyplayer never worked in this version of PsychoPy.

And, yes, this is the only setup that I could play movie and sound normally.

All of the issues above were replicated in two Windows machines (one of them is a new computer) and in a Linux computer running Ubuntu 22.04.2.

Personally, I’m very disappointed by the lack of consistency across PsychoPy versions (at least in audio playing) and the buggy audio/visual presentation. The fact that there are 4 movie engines is already confusing, not to mention two of them never work.

1 Like