Audio not playing in sync over waveform when scrubbing #53888

Closed
opened 2018-01-24 18:01:12 +01:00 by ChristopherAnderssarian · 5 comments

System Information
Windows 7 Ultimate, 64-bit, 32GB, 5960x, Nvidia Quadro FX 1800 (Primary) & GeForce 9800 GTX+ (Secondary)
Graphics Tablet: Wacom Bamboo Model: CTF-430 Driver Version 5.2.4-5

Official release(s) unless specified:
Broken: 2.79

Exact steps for others to reproduce the error
If you can't play the video in your web browser, right-click the video --> copy link address (or equivalent) and play it in a media player like VLC.
2018-01-24_16-45-50.mp4

Audio_scrubbing.blend

System Information Windows 7 Ultimate, 64-bit, 32GB, 5960x, Nvidia Quadro FX 1800 (Primary) & GeForce 9800 GTX+ (Secondary) Graphics Tablet: Wacom Bamboo Model: CTF-430 Driver Version 5.2.4-5 Official release(s) unless specified: Broken: 2.79 **Exact steps for others to reproduce the error** If you can't play the video in your web browser, right-click the video --> copy link address (or equivalent) and play it in a media player like VLC. [2018-01-24_16-45-50.mp4](https://archive.blender.org/developer/F1970376/2018-01-24_16-45-50.mp4) [Audio_scrubbing.blend](https://archive.blender.org/developer/F1970388/Audio_scrubbing.blend)

Added subscriber: @ChristopherAnderssarian

Added subscriber: @ChristopherAnderssarian
Member

Added subscribers: @neXyon, @lichtwerk

Added subscribers: @neXyon, @lichtwerk
Joerg Mueller was assigned by Philipp Oeser 2018-01-24 19:32:18 +01:00
Member

@neXyon: could you have a look?

@neXyon: could you have a look?
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Hi, thanks for the report.

The synchronization is not the problem here, the problem is that a scrub is playing audio longer than just a single frame. Audio playback is buffered. You can't playback single samples (think of an audio sample as the equivalent of a single frame in a video), because the processing load would be too huge, since audio doesn't have eg. 30 or 60 frames per second, but 48000 samples per second. Now if the buffer is for example 4096 samples long, that's 0.0853 seconds long. In your example you have set the frame rate to 1200 Hz, which means that the buffer is about 100 frames long, of course way longer than a single frame. Even for the 24 frames you have, the buffer would be about 2 frames long, that's why you can also hear the frame after, when you scrub.

We could fix this problem by cutting the audio samples to exactly the frame borders, setting the remaining samples to 0 (silence), instead of playing the full scene and pausing after a buffer length. However, without going into details as to why, a simple implementation of this would render scrubbing useless since it would be very bad in performance and you would hear your scrubs a few milliseconds or even seconds after you scrubbed. Alternatively, a more complex implementation could also solve this without the huge performance drop, but I guess the effort would not pay off and we would get unnecessarily increased code complexity for a minor feature that hardly anyone notices (I guess so, since your bug report came in about 9 years after I took over the maintenance of audio in blender).

Cheers

Hi, thanks for the report. The synchronization is not the problem here, the problem is that a scrub is playing audio longer than just a single frame. Audio playback is buffered. You can't playback single samples (think of an audio sample as the equivalent of a single frame in a video), because the processing load would be too huge, since audio doesn't have eg. 30 or 60 frames per second, but 48000 samples per second. Now if the buffer is for example 4096 samples long, that's 0.0853 seconds long. In your example you have set the frame rate to 1200 Hz, which means that the buffer is about 100 frames long, of course way longer than a single frame. Even for the 24 frames you have, the buffer would be about 2 frames long, that's why you can also hear the frame after, when you scrub. We could fix this problem by cutting the audio samples to exactly the frame borders, setting the remaining samples to 0 (silence), instead of playing the full scene and pausing after a buffer length. However, without going into details as to why, a simple implementation of this would render scrubbing useless since it would be very bad in performance and you would hear your scrubs a few milliseconds or even seconds after you scrubbed. Alternatively, a more complex implementation could also solve this without the huge performance drop, but I guess the effort would not pay off and we would get unnecessarily increased code complexity for a minor feature that hardly anyone notices (I guess so, since your bug report came in about 9 years after I took over the maintenance of audio in blender). Cheers
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
3 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#53888
No description provided.