New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lag in second frame of movie on Linux system #814
Comments
Indeed, I was able to verify this problem on my Ubuntu 22.04 LTS system, following your repro steps. Thanks for the bug report. Also note that macOS on Apple Silicon Macs is not yet a currently supported platform, and stimulation timing will likely be wrong for Psychtoolbox and any other vision science toolkit, at least if frame accurate timing and time-stamping is required. |
@kleinerm Thanks for looking into it. Here is my authentication token: VJZ7R4KY-2023912144811:98b0fafc433b89e17639ea0ccf26b802e2b30ff1497a037ebef07410adb26bd5 Let me know what else you need. |
Is this from a just purchased license or paid via some slow wire transfer? So far the corresponding license key for the token is not in my database, which could mean a processing delay somewhere. |
It was purchased 2 days ago via a credit card. Let me know if you would like me to forward you the purchase receipt. |
Hmm, still not in our database. This either means the payment via credit
card didn't come through, or something else went wrong.
Could you please send the receipt via e-mail to
***@***.*** ?
…On Thu, Sep 14, 2023 at 10:30 PM Cameron T Ellis ***@***.***> wrote:
It was purchased 2 days ago via a credit card. Let me know if you would
like me to forward you the purchase receipt.
—
Reply to this email directly, view it on GitHub
<#814 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIXMNTH5TWIJ476LOZLEM3X2NSMVANCNFSM6AAAAAA4I4NWCM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok, mystery solved with the help of our sales person. Apparently you entered a wrong OrderId/Order No. when creating the authentication token, creating an invalid token, therefore the entry could not be found in our database. With the proper Order No. I found the entry. For future reference. The correct OrderId would have been SLL6APY4, to be found on your invoice according to our instructions here - see yellow highlighted region: https://www.psychtoolbox.net/license-key/ So to the topic: The reason for this lag is a bug in version 16 of the Pulseaudio sound server which ships with Ubuntu 22.04-LTS up to at least upcoming Ubuntu 23.10 (Pulseaudio bug report at https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1383 GStreamer bug report at https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1735). Whenever Pulseaudio is used as default audio backend for sound output during movie playback via Psychtoolbox GStreamer movie playback engine on Linux, that Pulseaudio bug will screw up timing in the way you described. The bug has been properly fixed for the upcoming Pulseaudio version 17 (https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/8fe50bbc31e11abf2f30864f1e2dbdaa16d0e1c3), but version 17 is not yet released, and therefore this bug is in all Ubuntu versions since 22.04 LTS. Hopefully the bug fix will end in a future Ubuntu 24.04-LTS release next year. Therefore we are left with workarounds for this issue:
|
As of 4th March 2024, the bug has been fixed in Pulseaudio version 17, but so far this is not a part of current Debian or the upcoming Ubuntu 24.04-LTS. I've pinged Ubuntu about still upgrading to Pulseaudio 17 for upcoming LTS: And we got the response that it is too late to include a modern Pulseaudio 17 package which would solve this and other problems. Instead it was recommended to me to file an important bug report, just asking for backport of that one bug fix for that one bug that affects us here, which I did: https://bugs.launchpad.net/pipewire/+bug/2056079 Fingers crossed that this will still make it into the upcoming April 2024 release of Ubuntu 24.04-LTS. |
Describe the bug
The duration of time between the call of the
OpenMovie
andPlayMovie
commands is added to the duration between frame 1 and frame 2 of the movie oncePlayMovie
is called. This behavior can make timing difficult to control: if you want to trigger the movie (e.g., fMRI experiments), then you want to listen for the trigger afterOpenMovie
, but doing that will add lag due to this bug. The alternative is to listen to the trigger beforeOpenMovie
but that adds I/O speed lag that is unpredictable.This didn't happen on previous Linux OS/PTB versions (circa 2019).
To Reproduce
Steps to reproduce the behavior:
SimpleMovieDemo
OpenMovie
andPlayMovie
commands), add:WaitSecs(2)
;SimpleMovieDemo
. There will be a 2s pause after the window is made (as expected), but then the first frame will hang for 2s before starting.SetMovieTimeIndex
to zero after theOpenMovie
call does not fix this behavior.Expected behavior
There shouldn't be a lag since the movie shouldn't 'begin' until the
PlayMovie
command.Desktop (please complete the following information):
System showing the bug:
System showing the correct behavior
Additional context
Feel free to reach out if you have any questions
The text was updated successfully, but these errors were encountered: