Bug 476059 - animation playing lag
Summary: animation playing lag
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR critical
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-24 19:07 UTC by ahmett
Modified: 2023-11-21 13:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ahmett 2023-10-24 19:07:48 UTC
https://krita-artists.org/t/while-playing-the-animation-it-is-not-real-time/76521

I wrote to the forum, but I don't think anyone else is aware of this. Since I am an animator, I wanted to convey this difference to you. I know that Krita developers have restructured the timeline player. I am talking about the 5.3.0 prealpha (dda76a2) version. But this new player causes lag. The 5.2 pre alpha (64a6fc1) version, which I previously backed up to myself, plays without any problems since it has the old timeline structure. I play a 24 fps video and the krita at the same time. There is no delay. Even if I activate the drop frames button in the new version, it does not have any effect. There are videos in my post on the forum. thanks.
Comment 1 YRH 2023-11-18 23:19:37 UTC
Hi, I wanted to add a bit more information about this issue.

This is a regression in version 5.2.0 and still occurring in master. The animation playback was working correctly in version 5.1.5. To observe the bug, the following steps can be used:

1. Create a new document with 16 x 16 pixels size (to rule out any performance-related impact).
2. Switch to Animation workspace, or show the Timeline docker.
3. Verify that the frame rate is 24 FPS in Animation Settings.
4. Play the animation and hover the mouse cursor over the Drop Frames button. The tooltip will read "Real FPS: 21.5" (or similar) instead of 24 FPS.

NB: In Krita 5.1.5 there's no FPS tooltip, but I measured it manually to confirm.
Comment 2 YRH 2023-11-19 00:12:30 UTC
It seems that the bug is only apparent with KisPlaybackEngineQT. If the animation is played back with KisPlaybackEngineMLT, the framerate is correct. To switch to MLT and "fix" the bug, you need to attach an audio file to the animation.

However, I noticed that attaching a short MP3 file causes erratic frame pacing. It does not happen with a short WAV file.

Related discussion in this thread: https://krita-artists.org/t/slower-animation-playback-in-krita/78244
Comment 3 Bug Janitor Service 2023-11-20 22:12:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2002
Comment 4 Dmitry Kazakov 2023-11-21 13:41:34 UTC
Git commit e8fc172c90e42574c76e1496f36f9aad82d177a5 by Dmitry Kazakov, on behalf of Maciej Jesionowski.
Committed on 21/11/2023 at 14:41.
Pushed by dkazakov into branch 'master'.

Use PreciseTimer type with KisPlaybackEngineQT

This fixes the erratic playback of frames.
A precise timer is needed to achieve 1 ms accuracy.

M  +1    -0    libs/ui/KisPlaybackEngineQT.cpp

https://invent.kde.org/graphics/krita/-/commit/e8fc172c90e42574c76e1496f36f9aad82d177a5
Comment 5 Dmitry Kazakov 2023-11-21 13:42:02 UTC
Git commit cab0dbdc2587dddf545123333491add2b50d0be2 by Dmitry Kazakov, on behalf of Maciej Jesionowski.
Committed on 21/11/2023 at 14:41.
Pushed by dkazakov into branch 'krita/5.2'.

Use PreciseTimer type with KisPlaybackEngineQT

This fixes the erratic playback of frames.
A precise timer is needed to achieve 1 ms accuracy.


(cherry picked from commit e8fc172c90e42574c76e1496f36f9aad82d177a5)

M  +1    -0    libs/ui/KisPlaybackEngineQT.cpp

https://invent.kde.org/graphics/krita/-/commit/cab0dbdc2587dddf545123333491add2b50d0be2