Animation Playback Delayed With Time Remapping And AV-Sync #74111

Closed
opened 2020-02-22 12:14:05 +01:00 by Philip Holzmann · 21 comments

System Information
Operating system: Windows 10 64 bit
Graphics card: Nvidia GTX 750 Ti

Blender Version
Broken: 2.82.7 hash: 77d23b0bd7

Short description of error
When an animation is played back while both

  • AV-Sync is enabled
  • Time Remapping is enabled
    the animation playback starts with a delay (upon pressing spacebar).
    The delay is the longer, the higher the current frame number is.
    Also each time you start playback, it seems as if it started from 0.

Exact steps for others to reproduce the error
time_remapping_delay.blend

  • Open file
  • Don't move playhead

Start playback

Notice a ~1s delay, before the cube or playhead actually starts moving.

**System Information** Operating system: Windows 10 64 bit Graphics card: Nvidia GTX 750 Ti **Blender Version** Broken: 2.82.7 hash: 77d23b0bd76f **Short description of error** When an animation is played back while both * AV-Sync is enabled * Time Remapping is enabled the animation playback starts with a delay (upon pressing spacebar). The delay is the longer, the higher the current frame number is. Also each time you start playback, it seems as if it started from 0. **Exact steps for others to reproduce the error** [time_remapping_delay.blend](https://archive.blender.org/developer/F8362658/time_remapping_delay.blend) - Open file - Don't move playhead # Start playback Notice a ~1s delay, before the cube or playhead actually starts moving.

Added subscriber: @Foaly

Added subscriber: @Foaly

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

Can not reproduce this

Does this happen, when you click on File -> Defaults -> Load Factory Settings?

Can not reproduce this Does this happen, when you click on File -> Defaults -> Load Factory Settings?

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

I ran with --factory-startup

I also just tried this on Linux with recent master and it happens as well.
commit 24ea6b713d
Date: Sun Feb 23 16:52:43 2020 +0100

Note that the frame counter starts right away when you play the animation, but the cube starts to move with a delay.

I ran with --factory-startup I also just tried this on Linux with recent master and it happens as well. commit 24ea6b713d7db459327cf2c62e8d596eebf74d59 Date: Sun Feb 23 16:52:43 2020 +0100 **Note** that the frame counter starts right away when you play the animation, but the cube starts to move with a delay.

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I accidentally moved playhead to 0, so i didn't see the issue...

I accidentally moved playhead to 0, so i didn't see the issue...

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

I'm unsure if I am missing something obvious here... It seems to work fine for me with the latest master.
Has this issue been fixed or am I missing something?

recording.mp4

I'm unsure if I am missing something obvious here... It seems to work fine for me with the latest master. Has this issue been fixed or am I missing something? [recording.mp4](https://archive.blender.org/developer/F8426762/recording.mp4)

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

I just tried with a self-built master b759857825 Tue Mar 24 14:02:16 2020 +0100
and with the alpha from builder.blender.org 94b8166a8b

The issue still exists.

I don't know why it works for you.

I just tried with a self-built master b759857825b80af98621c2ff4b52f106ab79576c Tue Mar 24 14:02:16 2020 +0100 and with the alpha from builder.blender.org 94b8166a8b05 The issue still exists. I don't know why it works for you.

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

I can still confirm as well.

I have looked into this briefly, in screen_animation_step()

    else if (scene_eval->id.recalc & ID_RECALC_AUDIO_SEEK) {
      /* Ignore seek here, the audio will be updated to the scene frame after jump during next
       * dependency graph update. */
    }
    else if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false &&
             isfinite(time = BKE_sound_sync_scene(scene_eval))) {
      double newfra = (double)time * FPS;

When I start playback, value of newfra starts at 64

So following condition ignores AV sync, until it reaches scene->r.cfra

      /* give some space here to avoid jumps */
      if (newfra + 0.5 > scene->r.cfra && newfra - 0.5 < scene->r.cfra) {
        scene->r.cfra++;
      }
      else {
        scene->r.cfra = max_ii(scene->r.cfra, newfra + 0.5);
      }

It seems to me that either BKE_sound_sync_scene(scene_eval) or audio seek position is not corrected by time remapping. Also I am not sure if time remapping is supposed to control audio pitch - that would be another thing to consider.

I can still confirm as well. I have looked into this briefly, in `screen_animation_step()` ``` else if (scene_eval->id.recalc & ID_RECALC_AUDIO_SEEK) { /* Ignore seek here, the audio will be updated to the scene frame after jump during next * dependency graph update. */ } else if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false && isfinite(time = BKE_sound_sync_scene(scene_eval))) { double newfra = (double)time * FPS; ``` When I start playback, value of `newfra` starts at 64 So following condition ignores AV sync, until it reaches `scene->r.cfra` ``` /* give some space here to avoid jumps */ if (newfra + 0.5 > scene->r.cfra && newfra - 0.5 < scene->r.cfra) { scene->r.cfra++; } else { scene->r.cfra = max_ii(scene->r.cfra, newfra + 0.5); } ``` It seems to me that either `BKE_sound_sync_scene(scene_eval)` or audio seek position is not corrected by time remapping. Also I am not sure if time remapping is supposed to control audio pitch - that would be another thing to consider.

Ah, nvm... I can reproduce this on my end too. I had just built blender without any sound support and that is why it was working x)

Ah, nvm... I can reproduce this on my end too. I had just built blender without any sound support and that is why it was working x)

@iss I fix it for this particular case with this patch: D7248

@iss I fix it for this particular case with this patch: [D7248](https://archive.blender.org/developer/D7248)

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Sebastian Parborg was assigned by Sybren A. Stüvel 2020-03-30 16:15:22 +02:00

Assigning to @ZedDB as he was already working on a solution.

Assigning to @ZedDB as he was already working on a solution.

This issue was referenced by 9ddbb03861

This issue was referenced by 9ddbb03861fbfb36a83c1eb3fe2fb0feb455d0bd

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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#74111
No description provided.