LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-25-2006, 05:19 PM   #1
petersum
Member
 
Registered: May 2006
Location: Karachi, Pakistan
Posts: 140

Rep: Reputation: 15
Sound and video out of sync


Perhaps I have a hardware problem, but all "movie" software wont keep the video and sound in sync. Mplayer, Xine and many others all have the same problem. When I play any kind of movie - avi mpeg wmv etc - it starts off well but rapidly loses sync with the sound trailing up to 30 seconds behind the video.
Is it my machine only, or do others have this problem?
It is the same on all distributions of Linux. I need help so that I can finally get rid of Windoze98 that currently is only used to play movies, which I hate to admit does so perfectly.
 
Old 09-25-2006, 06:09 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
What kernel, what sound card, what sound system software?

Try specifying different sound systems. For example:

mplayer -ao alsa somefile.avi

The list can be obtained by:

Code:
$ mplayer -ao help

Available audio output drivers:
        mpegpes DVB audio output
        oss     OSS/ioctl audio output
        alsa    ALSA-0.9.x-1.x audio output
        arts    aRts audio output
        esd     EsounD audio output
        sdl     SDLlib audio output
        openal  OpenAL audio output
        null    Null audio output
        pcm     RAW PCM/WAVE file writer audio output
For additional information, see the man page for each application.
 
Old 09-28-2006, 09:54 PM   #3
petersum
Member
 
Registered: May 2006
Location: Karachi, Pakistan
Posts: 140

Original Poster
Rep: Reputation: 15
Kernel 2.6.16 Sound: VIA 82c686A/B rev 50 on /dev/dsp
System: 550 mhz Celeron, 256mb ram, Trident Cyberblade videocard.

Tried your suggestion with the following results:-

Only sdl and oss worked. Alsa can't find various things, arts hangs the computer!

Sdl produces terribly distorted sound but works everytime. Oss produces good quality sound but only works about once in three attempts, hanging the computer or "failed to find sound device / device busy" on the other occassions.
Working from command line, the sync problem appeared to be fixed. The gui is by default sdl and is very out of sync.

I was convinced that this was the right line of investigation until...

I switched to Slax (Popcorn) which is running from harddisk, not CD! I repeated the command line tests.
Oss now produced a number of "Video frame size errors" which didn't occur or were not reported under my main system. After many tries, it became clear that the errors were coming consistantly and were indeed causing the sync problem. I first assumed that the video media was bad, but on changing the movie, the same results were found.

It would appear to be a video related timing problem.

Any more ideas?
 
Old 09-28-2006, 10:03 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Quote:
Only sdl and oss worked. Alsa can't find various things, arts hangs the computer!
Well, that's certainly not the same on all distributions. Most major distributions are using ALSA for sound support now, and that should work (no sync problems here - unless the source is not sync'd).
 
Old 09-29-2006, 10:44 AM   #5
petersum
Member
 
Registered: May 2006
Location: Karachi, Pakistan
Posts: 140

Original Poster
Rep: Reputation: 15
Quite frankly, I've seen ALSA on so many distributions and on a large variety of hardware and it never works straight out of the box! It's a pain!
I wish we still had the days of "sndconfig" and the old sound systems of RedHat 5.0 and the like. Sometimes things don't get better with time.
 
Old 09-29-2006, 11:33 AM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
I have ALSA on 8 (different hardware) machines; I never had a problem with it. Have you remembered to apply maintenance after installation as the first step?
 
Old 10-01-2006, 03:08 PM   #7
petersum
Member
 
Registered: May 2006
Location: Karachi, Pakistan
Posts: 140

Original Poster
Rep: Reputation: 15
Whatever! Forget ALSA.
I've tried every available video driver and none fix the problem.
I tried all the cache / nocache options and the so-called bad media fixes but nothing works. It would seem that the data just isn't flowing through my system fast enough.

The strange thing is that starting mplayer by xterm, it nearly works - well it does work using sdl if you ignore the sound quality, but gui gmplayer always has the problem.
Actually I prefer Xine, so anyone have any ideas in this area?
 
Old 10-01-2006, 06:12 PM   #8
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Your main problem is probably that 550 Mhz. Celeron. That's a week machine and will only do so much. When you are playing a video is your processor maxed out? I use FreeBSD and Linux on some PII types and they work ok but video won't keep up all the time. Depends on how large in resolution it is. Using a lighter window manager like fluxbox will help. KDE will make that older box kinda slow. Also the video card that came with that vintage may not have the mem to keep up with modern vids. Anyway here is mplayers pages. Good luck. You may want to make the video smaller in resolution to fix it. Or you can try hard frame dropping.

http://www.mplayerhq.hu/DOCS/HTML-si...n/MPlayer.html
http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html
 
Old 10-05-2006, 02:58 PM   #9
petersum
Member
 
Registered: May 2006
Location: Karachi, Pakistan
Posts: 140

Original Poster
Rep: Reputation: 15
teckk - you are probably right in many areas, but seeing is believing! I tried hard frame dropping but it had no effect. So in desperation, I decided to change my distribution (again!). I installed Zenwalk 3.0.
Surprise!!! gxine works perfectly. I have tried it on all my available movie CD's and it works perfectly using every codec.
My next task is to figure out what video and audio drivers gzine is using (haven't had time yet).
The previous distro, and many others before, hung the computer so completely that it was impossible to debug the cause. And yes, KDE was probably a major part of the problem - now using Xfce. Yet, Slax popcorn, also using Xfce, has the problem too!
Although my problem is solved, I would still like to get to the bottom of it for my own satisfaction and knowledge.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i want to sync my video using ffmpeg Jeon, Chang-Min Linux - Software 0 11-17-2005 03:04 PM
Sound and Video out of Sync in KDE RAMMS+EIN Linux - Software 2 06-17-2005 05:25 PM
Sound and Video are Out of Sync in SuSE 9.3 RAMMS+EIN Linux - Hardware 0 06-04-2005 11:00 AM
Transcode - Video and Audio not in sync davecs Linux - Software 1 06-01-2004 02:52 PM
Sound out of sync with Video for movies Relativity Linux - Software 2 04-23-2004 05:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration