VirtualBox

Opened 8 years ago

Last modified 6 years ago

#15853 new defect

audio and video out of sync on Ubuntu 16.04.1

Reported by: jrkul Owned by:
Component: other Version: VirtualBox 5.1.4
Keywords: Cc:
Guest type: Linux Host type: Linux

Description

Audio and video are out of sync when a youtube video is playing. Behaviour noticed in a topic of VirtualBox forum: https://forums.virtualbox.org/viewtopic.php?f=3&t=79360

My original issue concerned the fact that the Linux guest was unable to reproduce all media contents. In the forum I was suggested to change the Audio Controller, solution that solved the issue.

However @Perryg noticed that audio and video are out of sync and suggested to open this ticket.

My Linux host is Ubuntu 14.04 LTS, 5,7 GB of total memory My Linux guest is Ubuntu 16.04.1 LTS, 2 GB of memory and 50 GB of fixed-size file as virtual hard disk.

I attach two log files:

VBox1.log file concerning my original issue posted to the forum Vbox2.log file recording the reproduction of a youtube video and the reproduction of the same video with videos application.

Attachments (3)

Vbox1.log (106.4 KB ) - added by jrkul 8 years ago.
Vbox2.log (108.0 KB ) - added by jrkul 8 years ago.
VBox.log (136.2 KB ) - added by Don Hughes 6 years ago.
Start VB, Start windows, Open Firefox, play YouTube video.

Download all attachments as: .zip

Change History (19)

by jrkul, 8 years ago

Attachment: Vbox1.log added

by jrkul, 8 years ago

Attachment: Vbox2.log added

comment:1 by BardurArantsson, 8 years ago

I think this may be a general issue and not specific to Linux *guests*: I'm seeing similar things with a Windows XP guest with a (Arch) Linux host. Here audio also lags about 0.5s behind the action that causes the sound. My concrete use case is Baldur's Gate 2 -- the only "weird" thing about this I can think of is that the game causes VBox to use >100% CPU all the time.

@jrkul: Does your VM also consume a lot of CPU on the host?

This seems to be a *regression* that happened between 5.1.2 -> 5.1.4. (I've reproduced by switching between 5.1.2 and 5.1.4 with no other system changes.)

comment:2 by BardurArantsson, 8 years ago

Oh, yes, and @jrkul: Any chance you could try 5.1.2?

comment:3 by jrkul, 8 years ago

VM uses on the host side up to 52% of cpu during boot of guest os and usually no more than 6% with no application running and about 34% of memory

It uses more than 90% (with peaks above 100%) of cpu with firefox and youtube reproducing a video

I agree, VM consumes a lot of cpu

I have to check if it is possible to install 5.1.2 alongside 5.1.4

Last edited 8 years ago by jrkul (previous) (diff)

comment:4 by Don Hughes, 8 years ago

Similar problem with 5.1.4 a SuSE 64 bit host and Windows 10 64 bit guest. Audio is about 3 seconds behind video.

comment:5 by BardurArantsson, 8 years ago

Issue persists on 5.1.6. (Linux host, Windows XP guest, PulseAudio + ICH AC97 Audio driver in guest.)

comment:6 by BardurArantsson, 8 years ago

Issue persists on 5.1.8. :(

comment:7 by Don Hughes, 7 years ago

Also still having issue using 5.1.8.

comment:8 by DaVinci, 7 years ago

Seeing a similar issue with a Windows Host(7&10) and Linux guests. Not limited to Ubuntu

Audio clearly lags behind video by about a half second. When playing a youtube video, audio will continue to play for a half second after video is stopped in guest

5.1.2 Does not produce the lag, but 5.1.{4,6,8} does. All versions appear to work correctly on OSX

Last edited 7 years ago by DaVinci (previous) (diff)

comment:9 by BardurArantsson, 7 years ago

Well, the revert done in 5.1.10 certainly worked. (Perhaps not so surprising.)

comment:10 by Don Hughes, 7 years ago

I am still having this issue ( Audio and Video out of sync ) with VB 5.1.26.

Linux host and Windows guest watching youtube video in firefox browser. Using ALSA Audio Driver with Intel HD Audio Controller.

in reply to:  10 comment:11 by Creator, 7 years ago

Replying to ...don:

I am still having this issue ( Audio and Video out of sync ) with VB 5.1.26.

Linux host and Windows guest watching youtube video in firefox browser. Using ALSA Audio Driver with Intel HD Audio Controller.

I have the same issue:

Linux edevelop 4.12.10-1-ARCH #1 SMP PREEMPT Wed Aug 30 12:18:42 CEST 2017 x86_64 GNU/Linux

VirtualBox Graphical User Interface Version 5.1.26 r117224

The 5.1.22 version was the last where issue was not reproduced.

Last edited 7 years ago by Creator (previous) (diff)

comment:12 by Don Hughes, 6 years ago

Still an issue with 5.2

Display a YouTube video in Firefox, the audio is about 1-2 seconds behind the video. The delay gets longer as the video plays. Both the video and audio are clear and distortion fee - just out of sync.

SuSE 42.3 64B Linux host, 64B Windows 10 LTSB guest host audio:ALSA guest audio:intel HD Audio

1) Do not have the issue on other systems on the same network running Windows natively. 2) Do not have the issue running Firefox directly on the Linux host. 3) Same issue in the guest with IE or Chrome 4) Same issue on other systems with same version of VB but different hardware. 5) Worked in the past with earlier versions of VB ( and Linux ) but same version of Windows.

Updated .log attached.

Last edited 6 years ago by Don Hughes (previous) (diff)

by Don Hughes, 6 years ago

Attachment: VBox.log added

Start VB, Start windows, Open Firefox, play YouTube video.

comment:13 by Don Hughes, 6 years ago

Additional information:

The offset is not fixed, but drifts over time. After 10 minutes the audio was about 2.5 seconds ahead of the video, and after 20 minutes it was about 5 seconds ahead. If I paused the playback, the audio and video were again in sync but immediately started to drift apart again. Could the audio and video drivers be using different timers for their sampling?

Previously the audio seemed to be behind, but that could have been in error.

comment:14 by Don Hughes, 6 years ago

Here is a link to a YouTube video of a 10 minute timer. On my system the beep initially follows the video but as the clip runs they start to preceed the video. i.e. After the first ring clears and the second opens up there is about a second delay before the beep. The beep sounds just as the third ring clears. The beep sounds before the fourth ring clears. The alarm sounds about two seconds before the final ring clears. About a .5% variation.

https://www.youtube.com/watch?v=ap-JvvU0xV4

comment:15 by Don Hughes, 6 years ago

Found this in another thread:

The above screams bug in the Realtek sound device driver, incorrectly reporting “stream time”, probably in a case where some data arrived late. The audio driver let it’s definition of time drift forward when it didn’t have data to go with it. Stream time and host system clock time are distinct and they do not necessarily advance at the same rate and here, it looks like the Realtek driver is assuming they do. Audio is time master by definition. When video runs behind, video is supposed to drop frames to catch up. In your case, video is concluding that it is still “aligned” even when it is not and that is probably the fault of audio driver reporting time based upon where the host system clock says it should be vs. the amount of audio data consumed divided by data rate. The later is the right definition and will keep time aligned.

comment:16 by Don Hughes, 6 years ago

A temporary work-around suggested elsewhere - using a USB Audio Adapter to bypass the emulation - worked for me.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use