The low level drivers abstract the hardware specific features from the rest of the multimedia code. Those are implemented with a well defined set of APIs, as windows do.
Please note that native low level drivers are not currently supported in Wine, because they either access hardware components or require VxDs to be loaded; Wine does not correctly supports those two so far.
There are two specific low level drivers (msacm.drv for wave input/output, midimap.drv for MIDI output only). These drivers (also present in Windows) allow:
choosing one low level driver between many (we'll discuss how the choice is made later on)
add the possibility to convert stream's format (ie ADPCM => PCM) (this is useful if the format required by the application for playback isn't supported by the soundcard).
add the possibility to filter a stream (adding echo, equalizer... to a wave stream, or modify the instruments that have to be played for a MIDI stream).
Each low lever driver has to implement at least one of the following functionality, through the named function:
Waveform audio: out for playback, and in for
recording. MMSYSTEM and WINMM call the real low level
audio driver using the driver's
wodMessage
and
widMessage
functions which handle
the different requests.
MIDI (Musical Instrument Digital Interface): out for
playback, and in for recording. MMSYSTEM and WINMM
call the low level driver functions using the driver's
midMessage
and the
modMessage
functions.
Mixer: this allows setting the volume for each one of
the other functionnality (and also some specific
attributes, like left/right balance for stereo
streams...). MMSYSTEM and WINMM call the low level
driver functions using the
mxdMessage
function.
Aux: this is the predecessor of the mixer functionnality (introduced in Win 95). Its usage has been deprecated in favor of mixer interfaces.
Wine currently supports the following (kernel) multimedia interfaces.
Open Sound System (OSS) as supplied in the Linux and FreeBSD kernels by 4Front Technologies. The presence of this driver is checked by configure (depends on the <sys/soundcard.h> file). Source code resides in dlls/winmm/wineoss.
Advanced Linux Sound Architecture (ALSA) as supplied in the Linux kernel. Source code resides in dlls/winmm/winealsa.
Analog RealTime Synthetizer (aRts): a network server (and virtual mixer) used in the KDE project.
Enlightenment Sound Daemon (EsounD): a network server used in the GNOME project.
Network Audio Server (NAS): an audio server.
Jack: a low latency audio server.
AudioIO: the native Solaris audio interface.
The supported functionnalities per driver is as follows (this table lists the available features of the products, not exactly what's actually implemented on Wine):
Table 14-1. Wine multimedia drivers' functionalities
Driver | Wave Out | Wave In | Midi Out | Midi In | Mixer (and Aux) |
---|---|---|---|---|---|
OSS | Yes | Yes | Yes | Yes | Yes |
ALSA | Yes | Yes | Yes | Yes | Yes |
aRts | Yes | Yes | No | No | Yes |
ESD | Yes | Yes | No | No | No |
NAS | Yes | Yes | No | No | Yes |
AudioIO | Yes | Yes | No | No | Yes |
Jack | Yes | Yes | No | No | Yes |
Lots of listed drivers won't support Midi (in a short time) because the exposed "Un*x" native interfaces don't. This would require using some kind as software synthesis (as Timidity), but we cannot incorporate as it's GPL'ed.
The Wave mapper device allows to load on-demand audio codecs in order to perform software conversion for the types the actual low level driver (hardware). Those codecs are provided through the standard ACM drivers in MSACM32.DLL.
Wave mapper driver implementation can be found in dlls/winmm/wavemap/ directory. This driver heavily relies on MSACM and MSACM32 DLLs which can be found in dlls/msacm and dlls/msacm32. Those DLLs load ACM drivers which provide the conversion to PCM format (which is normally supported by low level drivers). A Law, uLaw, ADPCM, MP3... fit into the category of non PCM formats.
Midi mapper allows to map each one of 16 MIDI channels to a specific instrument on an installed sound card. This allows for example to support different MIDI instrument definitions (XM, GM...). It also permits to output on a per channel basis to different MIDI renderers.
A built-in MIDI mapper can be found in dlls/winmm/midimap/. It partly provides the same functionality as the Windows' one. It allows to pick up destination channels: you can map a given channel to a specific playback device channel (see the configuration bits for more details).