You are not logged in.

#1 2012-08-02 09:48:12

David Batson
Member
Registered: 2011-10-13
Posts: 640

[SOLVED] Audio and Video out of sync in VLC

If I launch a video using VLC, the audio lags the video by several seconds.

However if I open the PulseAudio Volume Control, and then launch the video in VLC, the audio and video are in sync.

The audio lag does not happen with MPlayer, but I don't like MPlayer because of the lack of controls.

Is there a way to have the audio and video in sync with VLC and PulseAudio without having to open the PulseAudio Volume Control each time I watch a video?

Last edited by David Batson (2012-08-08 14:33:44)

Offline

#2 2012-08-02 21:39:14

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: [SOLVED] Audio and Video out of sync in VLC

What desktop environment are you using ? KDE ?

Offline

#3 2012-08-03 02:35:01

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [SOLVED] Audio and Video out of sync in VLC

XFCE w/compiz

I just did a complete update.  No change.

Offline

#4 2012-08-03 13:16:56

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [SOLVED] Audio and Video out of sync in VLC

I found I could choose ALSA for the audio output in VLC (Tools > Preferences > Audio > Output > Output Module > ALSA audio output), and the lag is gone.  However this is not really acceptable because the sound quality is diminished quite a bit.  Tried choosing Pulseaudio audio output for Output Module, but this did not solve the lag issue.

Offline

#5 2012-08-03 14:03:43

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: [SOLVED] Audio and Video out of sync in VLC

Have you tried editing the following line in /etc/pulse/default.pa ?

load-module module-udev-detect tsched=0

Offline

#6 2012-08-03 14:10:24

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: [SOLVED] Audio and Video out of sync in VLC

I stuck with pulseaudio for quite some time but had the same vlc sync problem. Once a video had started, dragging the position slider back to the start was enough to get sync back. If left, it would eventually sync itself. Went back to alsa a week ago.

@David Batson - have you run alsamixer to check none of the outputs are in the red? I found running the VLC volume above 100% caused distortion but was able to increase the outputs on alsamixer to around 80%.

Offline

#7 2012-08-03 16:19:56

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,398

Re: [SOLVED] Audio and Video out of sync in VLC

David Batson wrote:

I found I could choose ALSA for the audio output in VLC (Tools > Preferences > Audio > Output > Output Module > ALSA audio output), and the lag is gone.  However this is not really acceptable because the sound quality is diminished quite a bit.  Tried choosing Pulseaudio audio output for Output Module, but this did not solve the lag issue.

You don't need pulseaudio to get better sound quality:
search for: High quality resampling
in https://wiki.archlinux.org/index.php/Ad … chitecture

pacman -S alsa-plugins libsamplerate
~/.asoundrc:
defaults.pcm.rate_converter "samplerate_best"


Or you can totally get rid of any resampler (and cpu time) if you know the frequency of the input signal.
If you play mp3 most, you could try to set:
defaults.pcm.dmix.rate 44100
or use 48000 for video files

Or you can mix both and get the best quality for samples that matches the rate and fall back to the high quality resampler for others.

Last edited by kokoko3k (2012-08-03 16:29:38)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#8 2012-08-07 17:58:13

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [SOLVED] Audio and Video out of sync in VLC

LordChaos73 wrote:

Have you tried editing the following line in /etc/pulse/default.pa ?

load-module module-udev-detect tsched=0

I just now got around to trying this.  Actually I implemented all the changes from a Fedora Guide posted about 3 years ago regarding pulseaudio which included the above.  Works fine now!  Thanks!!! smile

http://forums.fedoraforum.org/showthread.php?t=225660

Offline

#9 2012-08-07 18:08:26

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 664

Re: [SOLVED] Audio and Video out of sync in VLC

Lack of controls in mplayer? Have you tried with smplayer? It works great with pulseaudio and is very similar to vlc.


Excuse my poor English.

Offline

#10 2012-08-07 18:13:22

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: [SOLVED] Audio and Video out of sync in VLC

David Batson wrote:
LordChaos73 wrote:

Have you tried editing the following line in /etc/pulse/default.pa ?

load-module module-udev-detect tsched=0

I just now got around to trying this.  Actually I implemented all the changes from a Fedora Guide posted about 3 years ago regarding pulseaudio which included the above.  Works fine now!  Thanks!!! smile

http://forums.fedoraforum.org/showthread.php?t=225660

You're very welcome!

Offline

#11 2012-08-08 09:28:05

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,398

Re: [SOLVED] Audio and Video out of sync in VLC

agapito wrote:

Lack of controls in mplayer? Have you tried with smplayer? It works great with pulseaudio and is very similar to vlc.

Slight OT, but: http://qt-apps.org/content/show.php/Xt7 … ent=151684


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB