VSE: 'Prefetch frames' causes excessive CPU usage whenever there is animation on a strip (freezes when tweaking animation [Graph Editor, Dopesheet, typing in new values]) #70194

Closed
opened 2019-09-23 23:30:52 +02:00 by Telmo Silva · 11 comments

System Information
Operating system: Linux-5.2.15-200.fc30.x86_64-x86_64-with-fedora-30-Thirty 64 Bits
Graphics card: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) Intel Open Source Technology Center 4.5 (Core Profile) Mesa 19.1.6

Blender Version
Broken: version: 2.81 (sub 12), branch: master, commit date: 2019-09-22 20:38, hash: 52bdf522af
Worked: (optional)

Short description of error
When using the Graph Editor Slider on f-curve with Sequencer "Prefetch Frames" ON, Blender Freezes

Exact steps for others to reproduce the error

  • Start New Video Editing File
  • Activate "Prefetch Frames" in the "Sequencer Preview" N-Panel
  • Create a simple "Animation" with a "Color Strip"
  • Go to "Graph Editor", menu "View > Show Sliders"
  • Move the Slider on the animation f-curve -> Freeze

Example File
slider_graphEditor_freeze.blend

**System Information** Operating system: Linux-5.2.15-200.fc30.x86_64-x86_64-with-fedora-30-Thirty 64 Bits Graphics card: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) Intel Open Source Technology Center 4.5 (Core Profile) Mesa 19.1.6 **Blender Version** Broken: version: 2.81 (sub 12), branch: master, commit date: 2019-09-22 20:38, hash: `52bdf522af` Worked: (optional) **Short description of error** When using the Graph Editor Slider on f-curve with Sequencer "Prefetch Frames" ON, Blender Freezes **Exact steps for others to reproduce the error** - Start New Video Editing File - Activate "Prefetch Frames" in the "Sequencer Preview" N-Panel - Create a simple "Animation" with a "Color Strip" - Go to "Graph Editor", menu "View > Show Sliders" - Move the Slider on the animation f-curve -> Freeze Example File [slider_graphEditor_freeze.blend](https://archive.blender.org/developer/F7772623/slider_graphEditor_freeze.blend)
Author

Added subscriber: @nottelmo-4

Added subscriber: @nottelmo-4
Member

Added subscribers: @iss, @lichtwerk

Added subscribers: @iss, @lichtwerk
Member

Can confirm the freeze.

This is actually true for all keyframe transforms [be it Graph Editor, Dopesheet, can be sliders, keyframes, tangents...]
Should call BKE_sequencer_prefetch_stop(scene) or similar in the appropriate places in transform code, I guess...

CC @iss

Can confirm the freeze. This is actually true for all keyframe transforms [be it Graph Editor, Dopesheet, can be sliders, keyframes, tangents...] Should call `BKE_sequencer_prefetch_stop(scene)` or similar in the appropriate places in transform code, I guess... CC @iss
Philipp Oeser changed title from [FREEZE] Graph Editor Slider with Prefetch Frames to [FREEZE] tweaking animation on a VSE strip [Graph Editor, Dopwsheet, ...] 2019-09-24 15:13:09 +02:00
Member

Just noticed that it actually hangs in BKE_sequencer_prefetch_stop, for some reason the thread is not suspended, loops infinitely here

  while (pfjob->running) {
    BLI_condition_notify_one(&pfjob->prefetch_suspend_cond);
  }
Just noticed that it actually hangs in `BKE_sequencer_prefetch_stop`, for some reason the thread is not suspended, loops infinitely here ``` while (pfjob->running) { BLI_condition_notify_one(&pfjob->prefetch_suspend_cond); } ```
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Member

Also: just opening that file seems to spawn a thread that never really finishes?
(keeps one CPU core busy here all the time -- without doing anything in that file)

Can even be reproduced much simpler:

  • File > New > Video Editing
  • in the Sequencer Editor: Add > Color
  • on the created Color strip: insert a keyframe (e.g. on Opacity)
  • in the Preview Editor: enable Prefetch frames
  • inspect CPU usage :( [never finishes...]

Guess this should be fixed asap?
CC @Sergey

Also: just opening that file seems to spawn a thread that never really finishes? (keeps one CPU core busy here all the time -- without doing anything in that file) Can even be reproduced much simpler: - `File` > `New` > `Video Editing` - in the Sequencer Editor: `Add` > `Color` - on the created Color strip: insert a keyframe (e.g. on Opacity) - in the Preview Editor: enable `Prefetch frames` - inspect CPU usage :( [never finishes...] Guess this should be fixed asap? CC @Sergey
Philipp Oeser changed title from [FREEZE] tweaking animation on a VSE strip [Graph Editor, Dopwsheet, ...] to VSE: 'Prefetch frames' causes excessive CPU usage whenever there is animation on a strip (freezes when tweaking animation [Graph Editor, Dopesheet, typing in new values]) 2019-09-25 12:15:34 +02:00
Richard Antalik was assigned by Sergey Sharybin 2019-09-25 12:21:14 +02:00

My guess is that it's caused by ab3a9dc1ed.

My guess is that it's caused by ab3a9dc1ed.
Member

Yes, caused by ab3a9dc1ed.

Adding this to 2.81 milestone, if this cant be fixed until then it should probably be reverted?

Yes, caused by ab3a9dc1ed. Adding this to 2.81 milestone, if this cant be fixed until then it should probably be reverted?

@Sergey
I modified prefetch to use same method as pipeline.c to update animdata (not sure if that has changed), but I get random crashes in depsgraph module.

I am using depsgraph to generate scene copy, and rendering it in separate thread. Not sure if method I use (copied from pipeline.c) is designed to do what I need. This was suggested to me by brecht, but I was not 100% sure about what I was doing.

I can revert to making scene copy using scene API, but this may be bug in depsgraph itself.
You can check my attempt to fix this by patching P1118, and messing with animation, while prefetch is enabled.

To confirm bug in depsgraph, I tried to mess with animation while rendering - no crash and no effect on original data.
(did crash when rendering movie strip, but thats unrelated)

@Sergey I modified prefetch to use same method as pipeline.c to update animdata (not sure if that has changed), but I get random crashes in depsgraph module. I am using depsgraph to generate scene copy, and rendering it in separate thread. Not sure if method I use (copied from pipeline.c) is designed to do what I need. This was suggested to me by brecht, but I was not 100% sure about what I was doing. I can revert to making scene copy using scene API, but this may be bug in depsgraph itself. You can check my attempt to fix this by patching [P1118](https://archive.blender.org/developer/P1118.txt), and messing with animation, while prefetch is enabled. To confirm bug in depsgraph, I tried to mess with animation while rendering - no crash and no effect on original data. (did crash when rendering movie strip, but thats unrelated)

This issue was referenced by 2b29bf25fc

This issue was referenced by 2b29bf25fcaa22812a4656c2f4243c037b6b2bb2

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Thomas Dinges added this to the 2.81 milestone 2023-02-08 16:46:56 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#70194
No description provided.