13.2. Low level layers

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.

The following low level layers are implemented (as built-in DLLs):

13.2.1. (Wave form) Audio

MMSYSTEM and WINMM call the real low level audio driver using the wodMessage/widMessage which handles the different requests.

13.2.1.1. OSS implementation

The low level audio driver is currently only implemented for the OpenSoundSystem (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/audio.c.

The implementation contains all features commonly used, but has several problems (see TODO list).

Note that some Wine specific flag has been added to the wodOpen function, so that the dsound DLL can share the /dev/dsp access. Currently, this only provides mutual exclusion for both DLLs. Future extension could add a virtual mixer between the two output streams.

TODO:

  • verify all functions for correctness

  • Add virtual mixer between wave-out and dsound interfaces.

13.2.2. MIDI

MMSYSTEM and WINMM call the low level driver functions using the midMessage and the modMessage functions.

13.2.2.1. OSS driver

The low level audio driver is currently only implemented for the OpenSoundSystem (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, and also some specific defines because MIDI is not supported on all OSes by OSS). Source code resides in dlls/winmm/wineoss/midi.c

Both Midi in and Midi out are provided. The type of MIDI devices supported is external MIDI port (requires an MIDI capable device - keyboard...) and OPL/2 synthesis (the OPL/2 patches for all instruments are in midiPatch.c).

TODO:

  • use better instrument definition for OPL/2 (midiPatch.c) or use existing instrument definition (from playmidi or kmid) with a .winerc option

  • have a look at OPL/3 ?

  • implement asynchronous playback of MidiHdr

  • implement STREAM'ed MidiHdr (question: how shall we share the code between the midiStream functions in MMSYSTEM/WINMM and the code for the low level driver)

  • use a more accurate read mechanism than the one of snooping on timers (like select on fd)

13.2.3. Mixer

MMSYSTEM and WINMM call the low level driver functions using the mxdMessage function.

13.2.4. Aux

The AUX low level driver is the predecessor of the mixer driver (introduced in Win 95).

13.2.5. Wine OSS

All the OSS dependent functions are stored into the WineOSS DLL. It still lack a correct installation scheme (as any multimedia device under Windows), so that all the correct keys are created in the registry. This requires an advanced model since, for example, the number of wave out devices can only be known on the destination system (depends on the sound card driven by the OSS interface). A solution would be to install all the multimedia drivers through the SETUPX DLL; this is not doable yet (the multimedia extension to SETUPX isn't written yet).

13.2.6. Joystick

The API consists of the joy* functions found in dlls/winmm/joystick/joystick.c. The implementation currently uses the Linux joystick device driver API. It is lacking support for enhanced joysticks and has not been extensively tested.

TODO:

13.2.7. Wave mapper (msacm.drv)

The Wave mapper device allows to load on-demand 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.

13.2.8. MIDI mapper

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 definition (XM, GM...). It also permits to output on a per channel basis to different MIDI renderers.