view DOCS/sound.html @ 4513:2e3800da1ceb

Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e (high quality divx movies that before ran very poor now plays perfectly). Also includes some minor fixes to the osd support. Since libmp1e has issues with non-mmx system I think this move is a smart one...
author mswitch
date Sun, 03 Feb 2002 14:55:27 +0000
parents fb02f169e8e2
children fd65c9bdcc76
line wrap: on
line source

<HTML>
<BODY BGCOLOR=white>

<FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>

<P><B><A NAME=2.3.2>2.3.2. Audio output devices</A></P></B>

<P><B>MPlayer</B>'s audio interface is called <I>libao2</I>. It currently
contains these drivers :</P>

<TABLE BORDER=0>

<TD COLSPAN=4><P><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>General:</B></P></TD>

<TR><TD>&nbsp;&nbsp;</TD><TD VALIGN=top><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>oss</TD><TD>&nbsp;&nbsp;</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS (ioctl) driver</TD></TR>
<TR><TD></TD><TD VALIGN=top><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>sdl</TD><TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>SDL driver (supports up/downsampling, <B>ESD</B>, <B>ARTS</B> etc)</TD></TR>
<TR><TD></TD><TD VALIGN=top><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>nas</TD><TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>NAS (Network Audio System) driver</TD></TR>
<TR><TD></TD><TD VALIGN=top><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>alsa5</TD><TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>native ALSA 0.5 driver</TD></TR>
<TR><TD></TD><TD VALIGN=top><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>alsa9</TD><TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>native ALSA 0.9 driver (works, but has problems -> use OSS)</TD></TR>
<TR><TD></TD><TD VALIGN=top><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>sun</TD><TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>SUN audio driver (/dev/audio) for BSD and Solaris8 users</TD></TR>

</TABLE>

<P>The fact is, Linux soundcard drivers are usually bad, and always as
incompatible as they can be. It MAY take a while to find your optimal settings.</P>
<P><UL>
<LI>if you have OSS as driver, first try with <I>-ao oss</I> (this is the default).
If you experience glitches, halts or anything out of the ordinary, have a
look at <I>-ao sdl</I> (NOTE: of course you'll have to have a new SDL library and its
devel pair installed). It helps in a lot of cases (it also supports ESD, ARTS, and
up/downsampling. /esd is GNOME's, arts is KDE's sound daemon/).</LI>
<LI>if you have ALSA version 0.5, then you ALMOST always have to use <I>-ao alsa5</I> ,
since 0.5 has buggy OSS emulation code, and will <B>crash MPlayer</B> with
a message like this:<BR>
  <UL>
  <CODE>DEMUXER: Too many (945 in 8390980 bytes) video packets in the buffer!</CODE></UL>
</LI>
<LI>if you have ALSA version 0.9, use <I>-ao oss</I> or <I>-ao sdl</I> as you
wish. You can also use <I>-ao alsa9</I> as it works now, however it has many
problems (losing sync, disappearing audio, etc).</LI>
</UL></P>

<P>On <B>Solaris/FreeBSD</B> systems, use the SUN audio driver with the
<I>-ao sun</I> option, otherwise you'll have no video, nor audio playing.</P>

<P><B><A NAME=2.3.2.1>2.3.2.1. Soundcard experiences, recommendations</A></B></P>

<P><TABLE BORDER=0 WIDTH=100%>
<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>VIA onboard chipset (via82cxxx) 48Khz only</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Driver:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> from <A HREF="http://sourceforge.net/project/showfiles.php?group_id=3242&release_id=59602">here</A></TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Aureal Vortex 2</B></TD><TR>
<TD>&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>no driver</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS/Pro:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>no driver</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD>48</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Driver:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><A HREF="http://aureal.sourceforge.net">aureal.sourceforge.net</A></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Driver2:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> from <A HREF="http://makacs.poliod.hu/~pontscho/aureal/au88xx-1.1.3.tar.bz2">here</A><BR>
(<I>buffer size increased to 32k</I>)</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>GUS PnP</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>no driver</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS/Pro:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>48</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>SB Live!</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>(?)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>48</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>SB AWE 64</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>max 44kHz</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>48kHz sounds shit</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>48</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Gravis UltraSound ACE</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>not OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>44</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Gravis UltraSound MAX</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK (?)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>48</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ESS 688</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK (?)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>48</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>C-Media cards (which ones?)</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>not OK (hissing) (?)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK (?)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>?</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Yamaha cards (*ymf*)</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>not OK (?) (maybe -ao sdl)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK only with ALSA 0.5 with OSS emulation <B>AND</B> <I>-ao sdl</I> (!) (?)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>?</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Cards with envy24 chips (like Terratec EWS88MT)</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>?</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS/Pro:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>?</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>?</TD><TR>

<TD COLSPAN=3><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>PC Speaker or DAC</B></TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OSS:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>OK (<I>use the SDL driver : -ao sdl</I>)</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>ALSA:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>no driver</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Max kHz:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>the driver emulates 44.1 maybe more</TD><TR>
<TD></TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Driver:</TD><TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><A HREF="ftp://ftp.infradead.org/pub/pcsp">ftp://ftp.infradead.org/pub/pcsp</A></TD><TR>
</TABLE></P>

<P><UL>
<LI>on Linux, use at least kernel 2.4 if possible, 2.2 isn't tested
<LI>if sound clicks when playing from CD-ROM, turn on IRQ unmasking !
     for example "hdparm -u1 /dev/cdrom" (see "man hdparm" !!!)
     This is recommended anyways... (for XMMS, etc...)
     Read section <A HREF="cd-dvd.html#4.1">4.1</A>.
<LI>don't use your soundcard by other application ( for ex. XMMS ) !
     if you use ESD, start MPlayer with the '-vo sdl:esd' option !
<LI>Please tell us how MPlayer and your soundcard(s) worked together!
</UL></P>


<P><B><A NAME=2.3.2.2>2.3.2.2. Audio plugins</B></P>

<P><B>MPlayer</B> has support for audio plugins. Audio plugins can be used for
  changing the properties of the audio data before the sound reaches the sound
  card. They are enabled using the <CODE>-aop</CODE> switch followed by the
  <CODE>list=plugin1,plugin2,...</CODE> switch. The <CODE>list</CODE> switch is
  required and determines which plugins that should be used and in which order
  they should be executed, example:
</P>

<P>&nbsp;&nbsp;<CODE>mplayer media.avi -aop list=resample,format</CODE></P>

<P>would run the sound through the resampling plugin followed by the format
  plugin.
</P>

<P>The plugins can also have switches that changes their behaviour. These
  switches are explained in detail in the sections below. A plugin will execute
  using default settings if it's switches are omitted.  Example of how to use
  plugins in combination with plugin specific switches:
</P>

<P>&nbsp;&nbsp;<CODE>mplayer media.avi -aop
  list=resample,format:fout=48000:format=0x8</CODE>
</P>

<P>would set the output frequency of the resample plugin to 44100Hz and the
  output format of the format plugin to AFMT_U8.
</P>                         

<P>Currently audio plugins can not be used in <B>MEncoder</B>.</P>


<P><B><A NAME=2.3.2.2.1>2.3.2.2.1. Up/Downsampling</B></P>

<P><B>MPlayer</B> fully supports up/down sampling of the sound. This plugin can
  for example be used if you have a fixed frequency sound card or if you are
  stuck with an olqd sound card that is only capable of max 44.1kHz.
  Limitations in your hardware are not auto detected, so you have to specify
  the sample frequency explicitly. This plugin has one switch:
  <CODE>fout</CODE> which is used for setting the desired output sample
  frequency, it defaults to 48kHz, and is given in
  &lt;Hz&gt;.
</P>

<P>Usage :<BR>
&nbsp;&nbsp;<CODE>mplayer media.avi -aop list=resample:fout=&lt;required
  frequency in Hz, like 44100&gt;</CODE></P>


<P><B><A NAME=2.3.2.2.2>2.3.2.2.2. Surround Sound decoding</B></P>

<P><B>MPlayer</b> has an audio plugin that can decode matrix encoded
surround sound.  Dolby Surround is an example of a matrix encoded format.</p>

<P>Many files with 2 channel audio actually contain matrixed surround
sound.</p>

<P>To use this feature, you will need a sound-card supporting at least 4 channels.</P>

<P>Usage :<BR>
&nbsp;&nbsp;<CODE>mplayer media.avi -aop list=surround</CODE></P>


<P><B><A NAME=2.3.2.2.3>2.3.2.2.3. Sample format converter</A></B></P>
                                                                               
<P>If your sound card driver doesn't support signed 16bit int, this plugin can
  be used to change the format to one which your sound card can understand. It
  has one switch <CODE>format</CODE> which can be set to one of the numbers
  found in libao2/afmt.h. This plugin is hardly ever needed and is intended for
  advanced users. Observe that this plugin only changes the sample format and
  not the sample frequency or the number of channels.
</P>

<P>Usage :<BR>
  &nbsp;&nbsp;<CODE>mplayer media.avi -aop
  list=format:format=&lt;required output format&gt;</CODE>
</P>


<P><B><A NAME=2.3.2.2.4>2.3.2.2.4. Delay</A></B></P>

<P>This plugin delays the sound and is intended as an example of how to develop
  new plugins. It can not be used for anything useful from users perspective
  and is mentioned here for the sake of completeness only. Do not use this
  plugin unless you are a developer.</P>

</BODY>
</HTML>