2.3.2. Audio output devices

MPlayer's audio interface is called libao2. It currently contains these drivers :

General:

  oss  OSS (ioctl) driver
sdlSDL driver (supports up/downsampling, ESD, ARTS etc)
nasNAS (Network Audio System) driver
alsa5native ALSA 0.5 driver
alsa9native ALSA 0.9 driver (works, but has problems -> use OSS)
sunSUN audio driver (/dev/audio) for BSD and Solaris8 users

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.

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

2.3.2.1. Soundcard experiences, recommendations

VIA onboard chipset (via82cxxx) 48Khz only
Driver: from here
Aureal Vortex 2
    OSS:no driver
OSS/Pro:OK
ALSA:no driver
Max kHz:48
Driver:aureal.sourceforge.net
Driver2: from here
(buffer size increased to 32k)
GUS PnP
OSS:no driver
OSS/Pro:OK
ALSA:OK
Max kHz:48
SB Live!
OSS:OK
ALSA:(?)
Max kHz:48
SB AWE 64
OSS:max 44kHz
ALSA:48kHz sounds shit
Max kHz:48
Gravis UltraSound ACE
OSS:not OK
ALSA:OK
Max kHz:44
Gravis UltraSound MAX
OSS:OK
ALSA:OK (?)
Max kHz:48
ESS 688
OSS:OK
ALSA:OK (?)
Max kHz:48
C-Media cards (which ones?)
OSS:not OK (hissing) (?)
ALSA:OK (?)
Max kHz:?
Yamaha cards (*ymf*)
OSS:not OK (?) (maybe -ao sdl)
ALSA:OK only with ALSA 0.5 with OSS emulation AND -ao sdl (!) (?)
Max kHz:?
Cards with envy24 chips (like Terratec EWS88MT)
OSS:?
OSS/Pro:OK
ALSA:?
Max kHz:?
PC Speaker or DAC
OSS:OK (use the SDL driver : -ao sdl)
ALSA:no driver
Max kHz:the driver emulates 44.1 maybe more
Driver:ftp://ftp.infradead.org/pub/pcsp

2.3.2.2. Audio plugins

MPlayer 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 -aop switch followed by the list=plugin1,plugin2,... switch. The list switch is required and determines which plugins that should be used and in which order they should be executed, example:

  mplayer media.avi -aop list=resample,format

would run the sound through the resampling plugin followed by the format plugin.

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:

  mplayer media.avi -aop list=resample,format:fout=48000:format=0x8

would set the output frequency of the resample plugin to 44100Hz and the output format of the format plugin to AFMT_U8.

Currently audio plugins can not be used in MEncoder.

2.3.2.2.1. Up/Downsampling

MPlayer 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: fout which is used for setting the desired output sample frequency, it defaults to 48kHz, and is given in <Hz>.

Usage :
  mplayer media.avi -aop list=resample:fout=<required frequency in Hz, like 44100>

2.3.2.2.2. Surround Sound decoding

MPlayer has an audio plugin that can decode matrix encoded surround sound. Dolby Surround is an example of a matrix encoded format.

Many files with 2 channel audio actually contain matrixed surround sound.

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

Usage :
  mplayer media.avi -aop list=surround

2.3.2.2.3. Sample format converter

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 format 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.

Usage :
  mplayer media.avi -aop list=format:format=<required output format>

2.3.2.2.4. Delay

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.