Release 980517
[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 current implementation is completely broken. (I think open(), read()
61    and write() of the /dev/midi device would make this implementation nearly
62    complete...)
63
64    TODO:
65         - Implement correct MIDI output
66         - Do not implement a software synthesizer. This should be done
67           using MIDI loopback devices in an external program (like timidity).
68
69 1.4 Timers
70
71    The API consists of the timer* functions found in multimedia/timer.c. 
72    There is currently only one implementation, which uses normal windows timers.
73    The implementation works for most cases found. The only problem is that
74    it doesn't support asynchronous timer events (as it is supposed to do).
75
76    There is a workaround for this lack in timeGetTime() to make Diablo work
77    and 'Pinball! SpaceCadet' at least start up.
78
79    TODO:
80         - Implemented asynchronous timers (using a thread probably)
81
82 1.5 MMIO
83    
84    The API consists of the mmio* functions found in multimedia/mmio.c.
85
86    FIXME: I am not sure about the status of this implementation.
87
88    TODO:
89         - add win32 support.
90         - ...
91
92 1.6 AUX
93    
94    The API consists of the aux* functions found in multimedia/mmsystem.c.
95    They call auxMessage in multimedia/mmaux.c.
96
97    The aux* functions are the predecessor of the mixer* functions.
98
99    The implementation uses the OSS mixer API, and is incomplete.
100
101    TODO:
102         - verify the implementation
103
104 1.7 JOYSTICK
105    
106    The API consists of the joy* functions found in multimedia/joystick.c.
107    The implementation currently uses the Linux joystick device driver API.
108    It is lacking support for enhanced joysticks and has not been extensively
109    tested.
110
111    TODO:
112         - better support of enhanced joysticks
113         - support more joystick drivers (like the XInput extension)
114
115 2. Midlevel drivers (MCI)
116    
117    The midlevel drivers are represented by some common API functions, 
118    mostly mciSendCommand and mciSendString. The mciSendString function
119    uses commandstrings, which are translated into normal MCI commands as
120    used by mciSendCommand. The API can be found in multimedia/mmsystem.c
121    and multimedia/mcistring.c.
122    The functions there (mciOpen,mciSysInfo) handle midlevel driver
123    allocation and calls.
124
125    The implementation is not complete, but works for most cases.
126    Win32 support for mciSendCommand is missing (mciSendString works
127    in the Win32 case, since the use of strings doesn't differ between
128    win16 and win32).
129
130    TODO:
131         - Win32 support
132         - support windows MCI drivers (should be possible for they usually 
133           do not use lowlevel calls)
134         - MCI command loading support
135         - implement other stuff as yet unknown
136
137    WINE implements several MCI midlevel drivers:
138
139 2.1 CDAUDIO
140    
141    The currently best implementation is the MCI CDAUDIO driver that can
142    be found in multimedia/mcicda.c. The implementation is mostly complete,
143    there have been no reports of errors.
144    The implementation currently uses only the Linux /dev/cdrom controlling
145    functions. (Sun and BSD like should be similair, but are not implemented.)
146
147    A very small example of a cdplayer consists just of the line
148    mciSendString("play cdaudio",NULL,0,0);
149
150    TODO:
151         - add support for other cdaudio drivers
152
153 2.2 MCIWAVE
154    
155    The implementation is rather complete and can be found in multimedia/audio.c.
156    It uses the lowlevel audio API (although not abstracted correctly).
157    FIXME: The MCI_STATUS command is broken.
158
159    TODO: - check for correctness
160
161 2.3 MIDI/SEQUENCER
162    
163    The implementation can be found in multimedia/midi.c. I am not sure
164    about the completeness.
165    It uses the lowlevel midi driver and is probably broken too.
166
167    TODO: 
168         - implement it correctly
169
170 2.4 MCIANIM
171
172    The implementation consists of stubs and is in multimedia/mcianim.c.
173
174    TODO: 
175         - implement it, probably using xanim or something similair. Could
176           also be implemented by using the Windows MCI video drivers.