Miscellaneous small fixes.
[wine] / documentation / status / multimedia
1 This file contains information about the implementation of the multimedia
2 layer of WINE.
3
4 The libraries consist of MMSYSTEM.DLL (win16), WINMM.DLL (win32) and some
5 (abstracted, not Windows compatible) lowlevel drivers. The implementation
6 can be found in the multimedia/ subdirectory.
7
8 The multimedia stuff is split into 3 layers. The lowlevel (device drivers),
9 midlevel (MCI commands) and highlevel abstraction layers.
10
11 1. Lowlevel layers
12
13    Following lowlevel layers are implemented:
14 1.1 (Waveform) Audio
15
16    The API consists of the waveIn*/waveOut* functions found in
17    multimedia/mmsystem.c. They call the real lowlevel audiodriver using
18    the wodMessage/widMessage function in multimedia/audio.c, which handles
19    the different requests.
20
21    The lowlevel audio driver is currently only implemented for the
22    OpenSoundSystem (OSS) as supplied in the Linux and FreeBSD kernels by
23    4Front Technologies (http://www.4front-tech.com/). The presence of this
24    driver is checked by configure (depends on the <sys/soundcard.h> file).
25
26    The implementation contains all features commonly used, but has several
27    problems. For instance:
28       Writes and reads are not done asynchronously as they are supposed to
29    be done. This breaks some programs (soundrec.exe from the Windows applets),
30    but doesn't worry other programs. Some callbacks are probably done
31    incorrectly (there are reports of some broken multimedia applications,
32    but I haven't found one yet.)
33
34    TODO:
35         - add asynchronous writes and reads (must use threads)
36         - check the callback functions
37         - verify all functions for correctness
38         - add drivers for other soundsystems (Sun Audio, remote audio systems
39           (using X extensions, ...)
40
41 1.2 Mixer
42
43    The API consists of the mixer* functions found in multimedia/mmsystem.c.
44    They call the lowlevel driver functions in multimedia/mixer.c using the
45    mixMessage function.
46
47    The current implementation tries to use the OpenSoundSystem mixer, but is
48    missing nearly everything. There is no report of a working application.
49    
50    TODO:
51         - implement mixing functionality for OSS correctly.
52         - implement mixing lowlevel drivers for other mixers.
53
54 1.3 MIDI
55         
56    The API consists of the midi* functions found in multimedia/mmsystem.c.
57    They call the lowlevel driver functions in multimedia/midi.c using the
58    midMessage and the modMessage functions.
59
60    The lowlevel audio driver is currently only implemented for the
61    OpenSoundSystem (OSS) as supplied in the Linux and FreeBSD kernels by
62    4Front Technologies (http://www.4front-tech.com/). The presence of this
63    driver is checked by configure (depends on the <sys/soundcard.h> file).
64    Both Midi in and Midi out are provided. The type of MIDI devices supported
65    is external MIDI port (requires an MIDI capable device - keyboard...) and
66    OPL/2 synthesis (the OPL/2patches for all instruments are in midiPatch.c).
67
68    TODO:
69         - Do not implement a software synthesizer. This should be done
70           using MIDI loopback devices in an external program (like timidity).
71           the only trouble is that timidity is GPL'ed...
72         - use better instrument definition for OPL/2 (midiPatch.c)
73         - have a look at OPL/3 ?
74         - a hack is used in mmsystem.c (setting reserved to the 32 bit linear
75           address of the block whatever the call is made from 16 or 32 bits 
76           code...). this should be in midi.c I think
77
78 1.4 Timers
79
80    The API consists of the timer* functions found in multimedia/timer.c. 
81    There is currently only one implementation, which uses normal windows timers.
82    The implementation works for most cases found. The only problem is that
83    it doesn't support asynchronous timer events (as it is supposed to do).
84
85    There is a workaround for this lack in timeGetTime() to make Diablo work
86    and 'Pinball! SpaceCadet' at least start up.
87
88    TODO:
89         - Implemented asynchronous timers (using a thread probably)
90
91 1.5 MMIO
92    
93    The API consists of the mmio* functions found in multimedia/mmio.c.
94
95    FIXME: I am not sure about the status of this implementation.
96
97    TODO:
98         - add win32 support.
99         - ...
100
101 1.6 AUX
102    
103    The API consists of the aux* functions found in multimedia/mmsystem.c.
104    They call auxMessage in multimedia/mmaux.c.
105
106    The aux* functions are the predecessor of the mixer* functions.
107
108    The implementation uses the OSS mixer API, and is incomplete.
109
110    TODO:
111         - verify the implementation
112
113 1.7 JOYSTICK
114    
115    The API consists of the joy* functions found in multimedia/joystick.c.
116    The implementation currently uses the Linux joystick device driver API.
117    It is lacking support for enhanced joysticks and has not been extensively
118    tested.
119
120    TODO:
121         - better support of enhanced joysticks
122         - support more joystick drivers (like the XInput extension)
123
124 2. Midlevel drivers (MCI)
125    
126    The midlevel drivers are represented by some common API functions, 
127    mostly mciSendCommand and mciSendString. The mciSendString function
128    uses commandstrings, which are translated into normal MCI commands as
129    used by mciSendCommand. The API can be found in multimedia/mmsystem.c
130    and multimedia/mcistring.c.
131    The functions there (mciOpen,mciSysInfo) handle midlevel driver
132    allocation and calls.
133
134    The implementation is not complete, but works for most cases.
135    Win32 support for mciSendCommand is missing (mciSendString works
136    in the Win32 case, since the use of strings doesn't differ between
137    win16 and win32).
138
139    TODO:
140         - Win32 support
141         - support windows MCI drivers (should be possible for they usually 
142           do not use lowlevel calls)
143         - MCI command loading support
144         - implement other stuff as yet unknown
145
146    WINE implements several MCI midlevel drivers:
147
148 2.1 CDAUDIO
149    
150    The currently best implementation is the MCI CDAUDIO driver that can
151    be found in multimedia/mcicda.c. The implementation is mostly complete,
152    there have been no reports of errors.
153    The implementation currently uses only the Linux /dev/cdrom controlling
154    functions. (Sun and BSD like should be similair, but are not implemented.)
155
156    A very small example of a cdplayer consists just of the line
157    mciSendString("play cdaudio",NULL,0,0);
158
159    TODO:
160         - add support for other cdaudio drivers
161
162 2.2 MCIWAVE
163    
164    The implementation is rather complete and can be found in multimedia/audio.c.
165    It uses the lowlevel audio API (although not abstracted correctly).
166    FIXME: The MCI_STATUS command is broken.
167
168    TODO: - check for correctness
169
170 2.3 MIDI/SEQUENCER
171    
172    The implementation can be found in multimedia/midi.c. I am not sure
173    about the completeness.
174    It uses the lowlevel midi driver and is probably broken too.
175
176    TODO: 
177         - implement it correctly
178
179 2.4 MCIANIM
180
181    The implementation consists of stubs and is in multimedia/mcianim.c.
182
183    TODO: 
184         - implement it, probably using xanim or something similair. Could
185           also be implemented by using the Windows MCI video drivers.