[MPlayer-users] sound sync problems with arts, oss fixes

gabor gabor at realtime.sk
Thu Jan 30 17:38:25 CET 2003


On Thu, 2003-01-30 at 16:49, 97671059 at hermes.usherb.ca wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> First - Thanks to all those who develope mplayer/mencoder. 
> It is VERY well documented. 
>  
> I have noticed many comments on sound sync problems.  My experience may 
> help some: 
>  
> I ripped my first dvd (The bourne identity) on linux. At first the sound  
> was completely out of sync!  - I got a lot of DUPLICATE FRAMES! while 
> encoding.  I read the documents and found I should be using -ofps 23.976 
> and maybe -mc 0 (not needed).  This helped a lot and only a few SKIPPED  
> or DUP FRAMES! appeared (like right at the begining of encoding). 
>  
> PROBLEM WAS: on playback the audio was just ever so slightly out of sync! 
> ARG! Many tries, I tried just copying AC3 audio, MP3 CBR, VBR, pcm etc. 
>  
> FINALLY I tried to play the encoded movie in XINE (vbr mp3, lavc) and it  
> worked fine! The audio was perfectly in sync on a windows machine as  
> well!  How could mencoder have made a movie playable by other players but 
> incorrectly played back on mplayer?!?!?! 
>  
> I NOTICED that Xine used OSS for sound.  I did: 
> "mplayer -ao oss movie.avi" and the audio was perfectly in sync!  (I had  
> been using ARTS before). 
>  
> So if you are having sound sync problems (and you think you are doing  
> everything "right") try switching your sound system ("mplayer -ao help"). 
>  
> Note that oss didn't always start with mplayer, sometimes it took a  
> couple tries ... don't know why.  When I searched "sound sync" problems on 
> this list I never came across anything mentioning this. 

i think i can clarify some thing for you.
let's begin:

you're using either oss or alsa... you should try mplayer -ao alsa9
something.avi ... if it works => you're using alsa. if not => you're
using oss...

arts is a program that sits on the top of oss or alsa...
why?

because:
kde uses arts for sound output. that means that all kde applications
output their sound to arts, which in turn outputs to oss or alsa.
why is this needed?

there are many reasons, the most important is this:
your sound card can play only from one sound source at the same time.
that means that if you start an oss application ( for example "mplayer
-ao oss file1.avi" ), and start an another oss application ( "mplayer
-ao oss file2.avi" ), then you won't hear the second one.... 
only 1 source...
(there are cards like soundblaster live, which can play 32 channels, so
you can start 32 mplayer -ao oss )

arts solves this:
arts gets  sound data from many applications and mixes them together and
sends to oss or alsa.
like you can start a lot of mplayer -ao arts ...

the good thing:
this way you can watch a film with mplayer -ao arts, and still get
sounds from for example a kde-icq client.

the bad things:
1. arts is not as 'fast' as oss or alsa . that means that when watching
a movie with -ao arts, it can happen that you will hear some noise...
it's not 100% that it happens but it's possible
2. arts 'takes' the sound card... that means that when arts is running (
we are talkin about the program 'artsd' - the arts daemon )... no other
oss or alsa apps can run. like you start a mplayer -ao arts, then if you
want to start an another mplayer, you HAVE to use -ao arts.

and about the fact that sometimes it took a couple of tries to start it:

when a kde application wants to output sound, it connects to artsd if
artsd is running.if not, he starts artsd and then connects to it.
when the applications ends, artsd waits some time ( a minute or so ) and
then shuts down...

so when artsd was still running you couldn't do a mplayer -ao oss, but
when artsd ended, you could.

hope this helps,
gabor

p.s: as you see the best solution is to buy a card like
soundblaster-live... then you don't have to worry about arts or oss or
whatever.. but of course that solution costs money :(((
>  
> I am using an Athlon T-bird 800, Ensonic (1371 Audio Pci), Kde 3.0.1, 
> Redhat8, Geoforce 2 system. 
>  
> Thanks 
> 
> _______________________________________________
> RTFM!!!  http://www.MPlayerHQ.hu/DOCS
> Search:  http://www.MPlayerHQ.hu/cgi-bin/htsearch
> http://mplayerhq.hu/mailman/listinfo/mplayer-users



More information about the MPlayer-users mailing list