Audio Sync and DXR3 Cards FAQ

Version 1.1 4th November, 2002

Getting audio in sync with the dxr3 card can difficult. The problem is that the video decoding can take a different amount of time than outputting the audio.

To start with, you need to understand how the dxr3 works with mplayer and xine. For MPEG 1 and 2 format video, the MPEG video data is sent directly to the dxr3 card and decoded in hardware. For other formats of video, the video stream is decoded and then re-encoded as MPEG and sent to the card. This means for different types of video you will get different delays in processing so the audio might run more or less ahead of the video.

For this reason you may need to try different methods for different video codec types and formats.

GENERAL

Here are some things to try to get your audio just right so that it doesn't seem like you're watching a badly dubbed kung-fu movie.

  • Make sure you're using the latest combination of dxr3 drivers and video player (xine or mplayer) as constant improvements are being made.
  • Check that it's not the video file itself. Many divx and other files found on the net can have poor sync internally. Make sure you're working with good sources. Try playing it to your computer screen (not through the dxr3) and see if that is in sync.
  • Try all the different audio drivers. I particularly find that the SDL driver can work better, which is odd but works. In mplayer: mplayer -ao
  • If you're using your computer's sound card, try using the dxr3 card's audio output instead. In mplayer: mplayer -ao oss:/dev/em8300_ma-0 (replace "0" with the number of dxr3 card you want to use.)
  • If you're running some audio server like artsd (KDE) or esd (Gnome), try playing without that and talking directly to the sound hardware instead.
  • Your machine might have trouble keeping up, particularly playing non-MPEG video such as divx. Try: In mplayer: mplayer -framedrop
  • Newer versions of MPlayer have some special options for sync with the dxr3. Try this for anything other than mpeg: In mplayer: mplayer -vo dxr3:prebuf:sync -vop lavc=1:29.97

    And for standard mpeg 1 or 2 (including DVDs): -vo dxr3:prebuf:sync

  • Experiment with delays on the audio. You should work with something very dialogue-based to test this. An episode of the West Wing works well. Again, make sure you're using a good video file. In mplayer: mplayer -delay (delay can be a floating point value)

AVI FILES

Some AVI files have peculiar problems with audio sync which can be helped with the following options.

Use a non-interleaved AVI parser. Normally, audio and video are interleaved in the avi file, so you can read the file sequentially. For some broken avis, however, you need to read the audio and video stream separately. If you use this option and the file is badly interleaved, playing directly from a cd might be impossible, because your drive has to jump around a lot. In these cases, you have to copy the file to your harddisk first.
In mplayer: mplayer -ni

  • Some AVI files have broken headers and this can be fixed.
    mplayer -nobps
  • The audio can get seriously out of whack and to get it back in sync may require a more extreme correction than the default. Setting the maximum correction to something like three seconds works well.
    mplayer -mc
  • Finally, there are many, especially older avis out there (> 1.5 years) that have really fucked up a/v sync and even don't play right under Windows. If you get in contact with such a file, there's little you can do but look for a better copy.

Maintained by Simon Rumble

Thanks for the input from Michael Hunold.