blob: 322902713e0e14570819e1371afd546614ff9b4d [file] [log] [blame]
Eric Pouech30975c02001-05-22 19:26:31 +00001 <chapter id="multimedia">
2 <title>Wine and Multimedia</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00003
Eric Pouech30975c02001-05-22 19:26:31 +00004 <para>
5 This file contains information about the implementation of the
Andreas Mohr5ec74d62002-07-24 03:00:02 +00006 multimedia layer of WINE.
Eric Pouech30975c02001-05-22 19:26:31 +00007 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00008
Eric Pouech30975c02001-05-22 19:26:31 +00009 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000010 The implementation can be found in the dlls/winmm/ directory (and in
Eric Pouech30975c02001-05-22 19:26:31 +000011 many of its subdirectories), but also in dlls/msacm/ (for the
12 audio compression/decompression manager) and dlls/msvideo/ (for the
13 video compression/decompression manager).
Andreas Mohr5ec74d62002-07-24 03:00:02 +000014 </para>
15
Eric Pouech30975c02001-05-22 19:26:31 +000016 <para>
17 Written by &name-eric-pouech; <email>&email-eric-pouech;</email>
18 (Last updated: 02/16/2001)
19 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000020
Eric Pouech30975c02001-05-22 19:26:31 +000021 <sect1 id="mm-overview">
22 <title>Overview</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000023
Eric Pouech30975c02001-05-22 19:26:31 +000024 <para>
25 The multimedia stuff is split into 3 layers. The low level (device
26 drivers), mid level (MCI commands) and high level abstraction layers.
27 The low level layer has also some helper DLLs (like the MSACM/MSACM32
28 and MSVIDEO/MSVFW32 pairs).
29 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000030
Eric Pouech30975c02001-05-22 19:26:31 +000031 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000032 The low level layer may depend on current hardware and OS services
33 (like OSS on Unix). Mid level (MCI) and high level layers must be
Eric Pouech30975c02001-05-22 19:26:31 +000034 written independently from the hardware and OS services.
35 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000036
Eric Pouech30975c02001-05-22 19:26:31 +000037 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000038 There are two specific low level drivers (one for wave input/output,
Eric Pouech30975c02001-05-22 19:26:31 +000039 another one for MIDI output only), whose role is:
40 <itemizedlist>
41 <listitem>
42 <para>help choosing one low level driver between many</para>
43 </listitem>
44 <listitem>
45 <para>
46 add the possibility to convert streams (ie ADPCM =&gt; PCM)
47 </para>
48 </listitem>
49 <listitem>
50 <para>
51 add the possibility to filter a stream (adding echo, equalizer...
Andreas Mohr5ec74d62002-07-24 03:00:02 +000052 to a wave stream), or modify the instruments that have to be
Eric Pouech30975c02001-05-22 19:26:31 +000053 played (MIDI).
54 </para>
55 </listitem>
56 </itemizedlist>
57 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000058
Eric Pouech30975c02001-05-22 19:26:31 +000059 <para>
60 All of those components are defined as DLLs (one by one).
61 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000062
Eric Pouech30975c02001-05-22 19:26:31 +000063 </sect1>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000064
Eric Pouech30975c02001-05-22 19:26:31 +000065 <sect1 id="mm-low">
66 <title>Low level layers</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000067
Eric Pouech30975c02001-05-22 19:26:31 +000068 <para>
69 Please note that native low level drivers are not currently supported
70 in WINE, because they either access hardware components or require
71 VxDs to be loaded; WINE does not correctly supports those two so far.
72 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000073
Eric Pouech30975c02001-05-22 19:26:31 +000074 <para>
75 The following low level layers are implemented (as built-in DLLs):
76 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000077
Eric Pouech30975c02001-05-22 19:26:31 +000078 <sect2>
79 <title>(Wave form) Audio</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000080
Eric Pouech30975c02001-05-22 19:26:31 +000081 <para>
82 MMSYSTEM and WINMM call the real low level audio driver using the
83 wodMessage/widMessage which handles the different requests.
84 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000085
Eric Pouech30975c02001-05-22 19:26:31 +000086 <sect3>
87 <title>OSS implementation</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000088
Eric Pouech30975c02001-05-22 19:26:31 +000089 <para>
90 The low level audio driver is currently only implemented for the
91 OpenSoundSystem (OSS) as supplied in the Linux and FreeBSD kernels by
Andreas Mohr5ec74d62002-07-24 03:00:02 +000092 <ulink url="http://www.4front-tech.com/">4Front Technologies</ulink>.
93 The presence of this driver is checked by configure (depends on the
94 &lt;sys/soundcard.h&gt; file). Source code resides in
Eric Pouech30975c02001-05-22 19:26:31 +000095 dlls/winmm/wineoss/audio.c.
96 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +000097
Eric Pouech30975c02001-05-22 19:26:31 +000098 <para>
99 The implementation contains all features commonly used, but has
100 several problems (see TODO list).
101 </para>
102
103 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000104 Note that some Wine specific flag has been added to the wodOpen function,
105 so that the dsound DLL can share the /dev/dsp access. Currently, this
Eric Pouech30975c02001-05-22 19:26:31 +0000106 only provides mutual exclusion for both DLLs. Future extension could add
107 a virtual mixer between the two output streams.
108 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000109
Eric Pouech30975c02001-05-22 19:26:31 +0000110 <para>TODO:
111 <itemizedlist>
112 <listitem>
113 <para>
114 verify all functions for correctness
115 </para>
116 </listitem>
117 <listitem>
118 <para>
119 Add virtual mixer between wave-out and dsound interfaces.
120 </para>
121 </listitem>
122 </itemizedlist>
123 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000124
Eric Pouech30975c02001-05-22 19:26:31 +0000125 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000126
Eric Pouech30975c02001-05-22 19:26:31 +0000127 <sect3>
128 <title>Other sub systems</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000129
Eric Pouech30975c02001-05-22 19:26:31 +0000130 <para>
131 No other is available. Could think of Sun Audio, remote audio systems
132 (using X extensions, ...), ALSA, EsounD, ArTs...
133 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000134
Eric Pouech30975c02001-05-22 19:26:31 +0000135 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000136
Eric Pouech30975c02001-05-22 19:26:31 +0000137 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000138
Eric Pouech30975c02001-05-22 19:26:31 +0000139 <sect2>
140 <title>MIDI</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000141
Eric Pouech30975c02001-05-22 19:26:31 +0000142 <para>
143 MMSYSTEM and WINMM call the low level driver functions using the
144 midMessage and the modMessage functions.
145 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000146
Eric Pouech30975c02001-05-22 19:26:31 +0000147 <sect3>
148 <title>OSS driver</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000149
Eric Pouech30975c02001-05-22 19:26:31 +0000150 <para>
151 The low level audio driver is currently only implemented for the
152 OpenSoundSystem (OSS) as supplied in the Linux and FreeBSD kernels by
153 <ulink url="http://www.4front-tech.com/">4Front Technologies</ulink>.
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000154 The presence of this driver is checked by configure (depends on the
155 &lt;sys/soundcard.h&gt; file, and also some specific defines because
156 MIDI is not supported on all OSes by OSS). Source code resides in
Eric Pouech30975c02001-05-22 19:26:31 +0000157 dlls/winmm/wineoss/midi.c
158 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000159
Eric Pouech30975c02001-05-22 19:26:31 +0000160 <para>
161 Both Midi in and Midi out are provided. The type of MIDI devices
162 supported is external MIDI port (requires an MIDI capable device -
163 keyboard...) and OPL/2 synthesis (the OPL/2 patches for all
164 instruments are in midiPatch.c).
165 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000166
Eric Pouech30975c02001-05-22 19:26:31 +0000167 <para>TODO:
168 <itemizedlist>
169 <listitem>
170 <para>
171 use better instrument definition for OPL/2 (midiPatch.c) or use
172 existing instrument definition (from playmidi or kmid) with a
173 .winerc option
174 </para>
175 </listitem>
176 <listitem>
177 <para>
178 have a look at OPL/3 ?
179 </para>
180 </listitem>
181 <listitem>
182 <para>
183 implement asynchronous playback of MidiHdr
184 </para>
185 </listitem>
186 <listitem>
187 <para>
188 implement STREAM'ed MidiHdr (question: how shall we share the code
189 between the midiStream functions in MMSYSTEM/WINMM and the code
190 for the low level driver)
191 </para>
192 </listitem>
193 <listitem>
194 <para>
195 use a more accurate read mechanism than the one of snooping on
196 timers (like select on fd)
197 </para>
198 </listitem>
199 </itemizedlist>
200 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000201
Eric Pouech30975c02001-05-22 19:26:31 +0000202 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000203
Eric Pouech30975c02001-05-22 19:26:31 +0000204 <sect3>
205 <title>Other sub systems</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000206
Eric Pouech30975c02001-05-22 19:26:31 +0000207 <para>
208 Could support other MIDI implementation for other sub systems (any
209 idea here ?)
210 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000211
Eric Pouech30975c02001-05-22 19:26:31 +0000212 <para>
213 Could also implement a software synthesizer, either inside Wine or
214 using using MIDI loop back devices in an external program (like
215 timidity). The only trouble is that timidity is GPL'ed...
216 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000217
Eric Pouech30975c02001-05-22 19:26:31 +0000218 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000219
Eric Pouech30975c02001-05-22 19:26:31 +0000220 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000221
Eric Pouech30975c02001-05-22 19:26:31 +0000222 <sect2>
223 <title>Mixer</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000224
Eric Pouech30975c02001-05-22 19:26:31 +0000225 <para>
226 MMSYSTEM and WINMM call the low level driver functions using the
227 mixMessage function.
228 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000229
Eric Pouech30975c02001-05-22 19:26:31 +0000230 <sect3>
231 <title>OSS implementation</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000232
Eric Pouech30975c02001-05-22 19:26:31 +0000233 <para>
234 The current implementation uses the OpenSoundSystem mixer, and resides
235 in dlls/winmm/wineoss/mixer.c
236 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000237
Eric Pouech30975c02001-05-22 19:26:31 +0000238 <para>TODO:
239 <itemizedlist>
240 <listitem>
241 <para>
242 implement notification mechanism when state of mixer's controls
243 change
244 </para>
245 </listitem>
246 </itemizedlist>
247 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000248
Eric Pouech30975c02001-05-22 19:26:31 +0000249 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000250
Eric Pouech30975c02001-05-22 19:26:31 +0000251 <sect3>
252 <title>Other sub systems</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000253
Eric Pouech30975c02001-05-22 19:26:31 +0000254 <para>TODO:
255 <itemizedlist>
256 <listitem>
257 <para>
258 implement mixing low level drivers for other mixers (ALSA...)
259 </para>
260 </listitem>
261 </itemizedlist>
262 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000263
Eric Pouech30975c02001-05-22 19:26:31 +0000264 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000265
Eric Pouech30975c02001-05-22 19:26:31 +0000266 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000267
Eric Pouech30975c02001-05-22 19:26:31 +0000268 <sect2>
269 <title>Aux</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000270
Eric Pouech30975c02001-05-22 19:26:31 +0000271 <para>
272 The AUX low level driver is the predecessor of the mixer driver
273 (introduced in Win 95).
274 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000275
Eric Pouech30975c02001-05-22 19:26:31 +0000276 <sect3>
277 <title>OSS driver</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000278
Eric Pouech30975c02001-05-22 19:26:31 +0000279 <para>
280 The implementation uses the OSS mixer API, and is incomplete.
281 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000282
Eric Pouech30975c02001-05-22 19:26:31 +0000283 <para>TODO:
284 <itemizedlist>
285 <listitem>
286 <para>
287 verify the implementation
288 </para>
289 </listitem>
290 <listitem>
291 <para>
292 check with what is done in mixer
293 </para>
294 </listitem>
295 <listitem>
296 <para>
297 open question: shall we implement it on top of the low level mixer
298 functions ?
299 </para>
300 </listitem>
301 </itemizedlist>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000302
Eric Pouech30975c02001-05-22 19:26:31 +0000303 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000304
Eric Pouech30975c02001-05-22 19:26:31 +0000305 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000306
Eric Pouech30975c02001-05-22 19:26:31 +0000307 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000308
Eric Pouech30975c02001-05-22 19:26:31 +0000309 <sect2>
310 <title>Wine OSS</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000311
Eric Pouech30975c02001-05-22 19:26:31 +0000312 <para>
313 All the OSS dependent functions are stored into the WineOSS DLL. It still
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000314 lack a correct installation scheme (as any multimedia device under Windows),
Eric Pouech30975c02001-05-22 19:26:31 +0000315 so that all the correct keys are created in the registry. This requires
316 an advanced model since, for example, the number of wave out devices can
317 only be known on the destination system (depends on the sound card driven
318 by the OSS interface). A solution would be to install all the multimedia
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000319 drivers through the SETUPX DLL; this is not doable yet (the multimedia
Eric Pouech30975c02001-05-22 19:26:31 +0000320 extension to SETUPX isn't written yet).
321 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000322
Eric Pouech30975c02001-05-22 19:26:31 +0000323 </sect2>
324
325 <sect2>
326 <title>Joystick</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000327
Eric Pouech30975c02001-05-22 19:26:31 +0000328 <para>
329 The API consists of the joy* functions found in dlls/winmm/joystick/joystick.c.
330 The implementation currently uses the Linux joystick device driver
331 API. It is lacking support for enhanced joysticks and has not been
332 extensively tested.
333 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000334
Eric Pouech30975c02001-05-22 19:26:31 +0000335 <para>TODO:
336 <itemizedlist>
337 <listitem>
338 <para>
339 better support of enhanced joysticks (Linux 2.2 interface is available)
340 </para>
341 </listitem>
342 <listitem>
343 <para>
344 support more joystick drivers (like the XInput extension)
345 </para>
346 </listitem>
347 <listitem>
348 <para>
349 should load joystick DLL as any other driver (instead of hardcoding)
350 the driver's name, and load it as any low lever driver.
351 </para>
352 </listitem>
353 </itemizedlist>
354 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000355
Eric Pouech30975c02001-05-22 19:26:31 +0000356 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000357
Eric Pouech30975c02001-05-22 19:26:31 +0000358 <sect2>
359 <title>Wave mapper (msacm.drv)</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000360
Eric Pouech30975c02001-05-22 19:26:31 +0000361 <para>
362 The Wave mapper device allows to load on-demand codecs in order to
363 perform software conversion for the types the actual low level driver
364 (hardware). Those codecs are provided through the standard ACM
365 drivers.
366 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000367
Eric Pouech30975c02001-05-22 19:26:31 +0000368 <sect3>
369 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000370
Eric Pouech30975c02001-05-22 19:26:31 +0000371 <para>
372 A first working implementation for wave out as been provided (wave in
373 exists, but doesn't allow conversion).
374 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000375
Eric Pouech30975c02001-05-22 19:26:31 +0000376 <para>
377 Wave mapper driver implementation can be found in dlls/winmm/wavemap/
378 directory. This driver heavily relies on MSACM and MSACM32 DLLs which
379 can be found in dlls/msacm and dlls/msacm32. Those DLLs load ACM
380 drivers which provide the conversion to PCM format (which is normally
381 supported by low level drivers). ADPCM, MP3... fit into the category
382 of non PCM formats.
383 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000384
Eric Pouech30975c02001-05-22 19:26:31 +0000385 <para>
386 There is currently no built-in ACM driver in Wine, so you must use
387 native ones if you're looking for non PCM playback.
388 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000389
Eric Pouech30975c02001-05-22 19:26:31 +0000390 <para>TODO:
391 <itemizedlist>
392 <listitem>
393 <para>
394 check for correctness and robustness
395 </para>
396 </listitem>
397 </itemizedlist>
398 </para>
399 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000400
Eric Pouech30975c02001-05-22 19:26:31 +0000401 <sect3>
402 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000403
Eric Pouech30975c02001-05-22 19:26:31 +0000404 <para>
405 Seems to work quite ok (using of course native MSACM/MSACM32 DLLs)
406 Some other testings report some issues while reading back the registry
407 settings.
408 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000409
Eric Pouech30975c02001-05-22 19:26:31 +0000410 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000411
Eric Pouech30975c02001-05-22 19:26:31 +0000412 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000413
Eric Pouech30975c02001-05-22 19:26:31 +0000414 <sect2>
415 <title>MIDI mapper</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000416
Eric Pouech30975c02001-05-22 19:26:31 +0000417 <para>
418 Midi mapper allows to map each one of 16 MIDI channels to a specific
419 instrument on an installed sound card. This allows for example to
420 support different MIDI instrument definition (XM, GM...). It also
421 permits to output on a per channel basis to different MIDI renderers.
422 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000423
Eric Pouech30975c02001-05-22 19:26:31 +0000424 <sect3>
425 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000426
Eric Pouech30975c02001-05-22 19:26:31 +0000427 <para>
428 A built-in MIDI mapper can be found in dlls/winmm/midimap/. It partly
429 provides the same functionnality as the Windows' one. It allows to pick up
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000430 destination channels (you can map a given channel to a specific playback
Eric Pouech30975c02001-05-22 19:26:31 +0000431 device channel (see the configuration bits for more details).
432 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000433
Eric Pouech30975c02001-05-22 19:26:31 +0000434 <para>TODO:
435 <itemizedlist>
436 <listitem>
437 <para>
438 implement the Midi mapper features (instrument on the fly modification)
439 if it has to be done as under Windows, it required parsing the midi
440 configuration files (didn't find yet the specs)
441 </para>
442 </listitem>
443 </itemizedlist>
444 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000445
Eric Pouech30975c02001-05-22 19:26:31 +0000446 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000447
Eric Pouech30975c02001-05-22 19:26:31 +0000448 <sect3>
449 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000450
Eric Pouech30975c02001-05-22 19:26:31 +0000451 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000452 The native midimapper from Win 98 works, but it requires a bunch of
Eric Pouech30975c02001-05-22 19:26:31 +0000453 keys in the registry which are not part of the Wine source yet.
454 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000455
Eric Pouech30975c02001-05-22 19:26:31 +0000456 <para>TODO:
457 <itemizedlist>
458 <listitem>
459 <para>
460 add native midimapper keys to the registry to let it run. This
461 will require proper multimedia driver installation routines.
462 </para>
463 </listitem>
464 </itemizedlist>
465 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000466
Eric Pouech30975c02001-05-22 19:26:31 +0000467 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000468
Eric Pouech30975c02001-05-22 19:26:31 +0000469 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000470
Eric Pouech30975c02001-05-22 19:26:31 +0000471 </sect1>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000472
Eric Pouech30975c02001-05-22 19:26:31 +0000473 <sect1 id="mm-mci">
474 <title>Mid level drivers (MCI)</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000475
476 <para>
Eric Pouech30975c02001-05-22 19:26:31 +0000477 The mid level drivers are represented by some common API functions,
478 mostly mciSendCommand and mciSendString. See status in chapter 3 for
479 more information. WINE implements several MCI mid level drivers
480 (status is given for both built-in and native implementation):
481 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000482
Eric Pouech30975c02001-05-22 19:26:31 +0000483 <para>TODO: (apply to all built-in MCI drivers)
484 <itemizedlist>
485 <listitem>
486 <para>
487 use MMSYSTEM multitasking caps instead of the home grown
488 </para>
489 </listitem>
490 </itemizedlist>
491 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000492
493
Eric Pouech30975c02001-05-22 19:26:31 +0000494 <sect2>
495 <title>CDAUDIO</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000496
Eric Pouech30975c02001-05-22 19:26:31 +0000497 <sect3>
498 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000499
Eric Pouech30975c02001-05-22 19:26:31 +0000500 <para>
501 The currently best implementation is the MCI CDAUDIO driver that can
502 be found in dlls/winmm/mcicda/mcicda.c. The implementation is mostly
503 complete, there have been no reports of errors. It makes use of
504 misc/cdrom.c Wine internal cdrom interface.
505 This interface has been ported on Linux, FreeBSD and NetBSD. (Sun
506 should be similar, but are not implemented.)
507 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000508
Eric Pouech30975c02001-05-22 19:26:31 +0000509 <para>
510 A very small example of a cdplayer consists just of the line
511 mciSendString("play cdaudio",NULL,0,0);
512 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000513
Eric Pouech30975c02001-05-22 19:26:31 +0000514 <para>TODO:
515 <itemizedlist>
516 <listitem>
517 <para>
518 add support for other cdaudio drivers (Solaris...)
519 </para>
520 </listitem>
521 <listitem>
522 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000523 add support for multiple cdaudio devices (plus a decent
Eric Pouech30975c02001-05-22 19:26:31 +0000524 configuration scheme)
525 </para>
526 </listitem>
527 <listitem>
528 <para>
529 The DLL is not cleanly separated from the NTDLL DLL. The CDROM
530 interface should be exported someway (or stored in a Wine only DLL)
531 </para>
532 </listitem>
533 </itemizedlist>
534 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000535
Eric Pouech30975c02001-05-22 19:26:31 +0000536 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000537
Eric Pouech30975c02001-05-22 19:26:31 +0000538 <sect3>
539 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000540
Eric Pouech30975c02001-05-22 19:26:31 +0000541 <para>
542 Native MCICDA works also correctly... It uses the MSCDEX traps (on int
543 2f). However, some commands (like seeking) seem to be broken.
544 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000545
Eric Pouech30975c02001-05-22 19:26:31 +0000546 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000547
Eric Pouech30975c02001-05-22 19:26:31 +0000548 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000549
Eric Pouech30975c02001-05-22 19:26:31 +0000550 <sect2>
551 <title>MCIWAVE</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000552
Eric Pouech30975c02001-05-22 19:26:31 +0000553 <sect3>
554 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000555
Eric Pouech30975c02001-05-22 19:26:31 +0000556 <para>
557 The implementation is rather complete and can be found in
558 dlls/winmm/mciwave/audio.c. It uses the low level audio API (although
559 not abstracted correctly).
560 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000561
Eric Pouech30975c02001-05-22 19:26:31 +0000562 <para>FIXME:
563 <itemizedlist>
564 <listitem>
565 <para>
566 The MCI_STATUS command is broken.
567 </para>
568 </listitem>
569 </itemizedlist>
570 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000571
Eric Pouech30975c02001-05-22 19:26:31 +0000572 <para>TODO:
573 <itemizedlist>
574 <listitem>
575 <para>
576 check for correctness
577 </para>
578 </listitem>
579 <listitem>
580 <para>
581 better use of asynchronous playback from low level
582 </para>
583 </listitem>
584 <listitem>
585 <para>
586 better implement non waiting command (without the MCI_WAIT flag).
587 </para>
588 </listitem>
589 </itemizedlist>
590 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000591
Eric Pouech30975c02001-05-22 19:26:31 +0000592 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000593
Eric Pouech30975c02001-05-22 19:26:31 +0000594 <sect3>
595 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000596
Eric Pouech30975c02001-05-22 19:26:31 +0000597 <para>
598 Native MCIWAVE works also correctly.
599 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000600
Eric Pouech30975c02001-05-22 19:26:31 +0000601 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000602
Eric Pouech30975c02001-05-22 19:26:31 +0000603 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000604
Eric Pouech30975c02001-05-22 19:26:31 +0000605 <sect2>
606 <title>MCISEQ (MIDI sequencer)</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000607
Eric Pouech30975c02001-05-22 19:26:31 +0000608 <sect3>
609 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000610
Eric Pouech30975c02001-05-22 19:26:31 +0000611 <para>
612 The implementation can be found in dlls/winmm/mciseq/mcimidi.c. Except
613 from the Record command, should be close to completion (except for non
614 blocking commands, as many MCI drivers).
615 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000616
Eric Pouech30975c02001-05-22 19:26:31 +0000617 <para>TODO:
618 <itemizedlist>
619 <listitem>
620 <para>
621 implement it correctly
622 </para>
623 </listitem>
624 <listitem>
625 <para>
626 finish asynchronous commands (especially for reading/record)
627 </para>
628 </listitem>
629 <listitem>
630 <para>
631 better implement non waiting command (without the MCI_WAIT flag).
632 </para>
633 </listitem>
634 <listitem>
635 <para>
636 implement the recording features
637 </para>
638 </listitem>
639 </itemizedlist>
640 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000641
Eric Pouech30975c02001-05-22 19:26:31 +0000642 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000643
Eric Pouech30975c02001-05-22 19:26:31 +0000644 <sect3>
645 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000646
Eric Pouech30975c02001-05-22 19:26:31 +0000647 <para>
648 Native MCIMIDI has been working but is currently blocked by scheduling
649 issues (mmTaskXXX no longer work).
650 </para><para>FIXME:
651 <itemizedlist>
652 <listitem>
653 <para>
654 midiStreamPlay get from time to time an incorrect MidiHdr when
655 using the native MCI sequencer
656 </para>
657 </listitem>
658 </itemizedlist>
659 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000660
Eric Pouech30975c02001-05-22 19:26:31 +0000661 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000662
Eric Pouech30975c02001-05-22 19:26:31 +0000663 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000664
Eric Pouech30975c02001-05-22 19:26:31 +0000665 <sect2>
666 <title>MCIANIM</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000667
Eric Pouech30975c02001-05-22 19:26:31 +0000668 <sect3>
669 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000670
Eric Pouech30975c02001-05-22 19:26:31 +0000671 <para>
672 The implementation is in dlls/winmm/mcianim/.
673 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000674
Eric Pouech30975c02001-05-22 19:26:31 +0000675 <para>TODO:
676 <itemizedlist>
677 <listitem>
678 <para>
679 implement it, probably using xanim or something similar.
680 </para>
681 </listitem>
682 </itemizedlist>
683 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000684
Eric Pouech30975c02001-05-22 19:26:31 +0000685 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000686
Eric Pouech30975c02001-05-22 19:26:31 +0000687 <sect3>
688 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000689
Eric Pouech30975c02001-05-22 19:26:31 +0000690 <para>
691 Native MCIANIM is reported to work (but requires native video DLLs
692 also, even though the built-in video DLLs start to work correctly).
693 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000694
Eric Pouech30975c02001-05-22 19:26:31 +0000695 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000696
Eric Pouech30975c02001-05-22 19:26:31 +0000697 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000698
Eric Pouech30975c02001-05-22 19:26:31 +0000699 <sect2>
700 <title>MCIAVI</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000701
Eric Pouech30975c02001-05-22 19:26:31 +0000702 <sect3>
703 <title>Built-in</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000704
Eric Pouech30975c02001-05-22 19:26:31 +0000705 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000706 The implementation is in dlls/winmm/mcianim/. Basic features are present,
Eric Pouech30975c02001-05-22 19:26:31 +0000707 simple playing is available, even if lots remain to be done. It rather
708 heavily relies on MSVIDEO/MSVFW32 DLLs pair to work.
709 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000710
Eric Pouech30975c02001-05-22 19:26:31 +0000711 <para>TODO:
712 <itemizedlist>
713 <listitem>
714 <para>
715 finish the implementation
716 </para>
717 </listitem>
718 <listitem>
719 <para>
720 fix the audio/video synchronisation issue
721 </para>
722 </listitem>
723 </itemizedlist>
724 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000725
Eric Pouech30975c02001-05-22 19:26:31 +0000726 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000727
Eric Pouech30975c02001-05-22 19:26:31 +0000728 <sect3>
729 <title>Native</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000730
Eric Pouech30975c02001-05-22 19:26:31 +0000731 <para>
732 Native MCIAVI is reported to work (but requires native video DLLs
733 also). Some files exhibit some deadlock issues anyway.
734 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000735
Eric Pouech30975c02001-05-22 19:26:31 +0000736 </sect3>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000737
Eric Pouech30975c02001-05-22 19:26:31 +0000738 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000739
Eric Pouech30975c02001-05-22 19:26:31 +0000740 </sect1>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000741
Eric Pouech30975c02001-05-22 19:26:31 +0000742 <sect1 id="mm-high">
743 <title>High level layers</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000744
745 <para>
Eric Pouech30975c02001-05-22 19:26:31 +0000746 The rest (basically the MMSYSTEM and WINMM DLLs entry points). It also
747 provides the skeleton for the core functionality for multimedia
748 rendering. Note that native MMSYSTEM and WINMM do not currently work
749 under WINE and there is no plan to support them (it would require to
750 also fully support VxD, which is not done yet).
751 Moreover, native DLLs require 16 bit MCI and low level drivers. Wine
752 implements them as 32 bit drivers.
753 MCI and low level drivers can either be 16 or 32 bit for Wine.
754 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000755
Eric Pouech30975c02001-05-22 19:26:31 +0000756 <para>TODO:
757 <itemizedlist>
758 <listitem>
759 <para>
760 it seems that some program check what's installed in registry
761 against value returned by drivers. Wine is currently broken
762 regarding this point.
763 </para>
764 </listitem>
765 <listitem>
766 <para>
767 add clean-up mechanisms when process detaches from MM DLLs
768 </para>
769 </listitem>
770 <listitem>
771 <para>
772 prepare for the 16/32 big split
773 </para>
774 </listitem>
775 <listitem>
776 <para>
777 check thread-safeness for MMSYSTEM and WINMM entry points
778 </para>
779 </listitem>
780 <listitem>
781 <para>
782 unicode entry points are badly supported
783 </para>
784 </listitem>
785 </itemizedlist>
786 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000787
Eric Pouech30975c02001-05-22 19:26:31 +0000788 <sect2>
789 <title>MCI skeleton</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000790
Eric Pouech30975c02001-05-22 19:26:31 +0000791 <para>
792 Implementation of what is needed to load/unload MCI drivers, and to
793 pass correct information to them. This is implemented in
794 dlls/winmm/mci.c. The mciSendString function uses command strings,
795 which are translated into normal MCI commands as used by
796 mciSendCommand with the help of command tables. The API can be found
797 in dlls/winmm/mmsystem.c and dlls/winmm/mci.c. The functions there
798 (mciOpen,mciSysInfo) handle mid level driver allocation and calls. The
799 implementation is not complete.
800 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000801
Eric Pouech30975c02001-05-22 19:26:31 +0000802 <para>
803 MCI drivers are seen as regular WINE modules, and can be loaded (with
804 a correct load order between built-in, native, elfdll, so), as any
805 other DLL. Please note, that MCI drivers module names must bear the
806 .drv extension to be correctly understood.
807 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000808
Eric Pouech30975c02001-05-22 19:26:31 +0000809 <para>
810 The list of available MCI drivers is obtained as follows:
811 1. key 'mci' in [option] section from .winerc (or wineconf)
812 mci=CDAUDIO:SEQUENCER gives the list of MCI drivers (names, in
813 uppercase only) to be used in WINE.
814 2. This list, when defined, supersedes the mci key in
815 c:\windows\system.ini
816 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000817
Eric Pouech30975c02001-05-22 19:26:31 +0000818 <para>
819 Note that native VIDEODISC crashes when the module is loaded, which
820 occurs when the MCI procedures are initialised. Make sure that this is
821 not in the list from above. Try adding:
822 mci=CDAUDIO:SEQUENCER:WAVEAUDIO:AVIVIDEO:MPEGVIDEO
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000823 to the [options] section of the wine config file.
Eric Pouech30975c02001-05-22 19:26:31 +0000824 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000825
Eric Pouech30975c02001-05-22 19:26:31 +0000826 <para>TODO:
827 <itemizedlist>
828 <listitem>
829 <para>
830 correctly handle the MCI_ALL_DEVICE_ID in functions.
831 </para>
832 </listitem>
833 <listitem>
834 <para>
835 finish mapping 16 <=> 32 of MCI structures and commands
836 </para>
837 </listitem>
838 <listitem>
839 <para>
840 MCI_SOUND is not handled correctly (should not be sent to MCI
841 driver =&gt; same behavior as MCI_BREAK)
842 </para>
843 </listitem>
844 <listitem>
845 <para>
846 implement auto-open feature (ie, when a string command is issued
847 for a not yet opened device, MCI automatically opens it)
848 </para>
849 </listitem>
850 </itemizedlist>
851 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000852
Eric Pouech30975c02001-05-22 19:26:31 +0000853 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000854
Eric Pouech30975c02001-05-22 19:26:31 +0000855 <sect2>
856 <title>MCI multi-tasking</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000857
Eric Pouech30975c02001-05-22 19:26:31 +0000858 <para>
859 Multi-tasking capabilities used for the MCI drivers are provided in
860 dlls/winmm/mmsystem.c.
861 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000862
Eric Pouech30975c02001-05-22 19:26:31 +0000863 <para>TODO:
864 <itemizedlist>
865 <listitem>
866 <para>
867 mmTaskXXX functions are currently broken because the 16 loader does
868 not support binary command lines =&gt; provide Wine's own mmtask.tsk not
869 using binary command line.
870 </para>
871 </listitem>
872 <listitem>
873 <para>
874 the Wine native MCI drivers should use the mmThreadXXX API (but since
875 all built-in MCI drivers are 32 bit, this would require a special
876 flag to mark 32 bit entry points)
877 </para>
878 </listitem>
879 </itemizedlist>
880 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000881
Eric Pouech30975c02001-05-22 19:26:31 +0000882 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000883
Eric Pouech30975c02001-05-22 19:26:31 +0000884 <sect2>
885 <title>Timers</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000886
Eric Pouech30975c02001-05-22 19:26:31 +0000887 <para>
888 It currently uses a service thread, run in the context of the calling
889 process, which should correctly mimic Windows behavior.
890 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000891
Eric Pouech30975c02001-05-22 19:26:31 +0000892 <para>TODO:
893 <itemizedlist>
894 <listitem>
895 <para>
896 Check if minimal time is satisfactory for most programs.
897 </para>
898 </listitem>
899 <listitem>
900 <para>
901 current implementation may let a timer tick (once) after it has
902 been destroyed
903 </para>
904 </listitem>
905 </itemizedlist>
906 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000907
Eric Pouech30975c02001-05-22 19:26:31 +0000908 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000909
Eric Pouech30975c02001-05-22 19:26:31 +0000910 <sect2>
911 <title>MMIO</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000912
Eric Pouech30975c02001-05-22 19:26:31 +0000913 <para>
914 The API consists of the mmio* functions found in mdlls/winmm/mmio.c.
915 Seems to work ok in most of the cases. There's some linear/segmented
916 issues with 16 bit code. There are also some bugs when writting MMIO
917 files.
918 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000919
Eric Pouech30975c02001-05-22 19:26:31 +0000920 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000921
Eric Pouech30975c02001-05-22 19:26:31 +0000922 <sect2>
923 <title>sndPlayXXX functions</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000924
Eric Pouech30975c02001-05-22 19:26:31 +0000925 <para>
926 Seem to work correctly.
927 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000928
Eric Pouech30975c02001-05-22 19:26:31 +0000929 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000930
Eric Pouech30975c02001-05-22 19:26:31 +0000931 </sect1>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000932
Eric Pouech30975c02001-05-22 19:26:31 +0000933 <sect1 id="mm-conf">
934 <title>Multimedia configuration</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000935
Eric Pouech30975c02001-05-22 19:26:31 +0000936 <para>
937 Currently, multimedia configuration heavily relies on Win 3.x
938 configuration model.
939 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000940
Eric Pouech30975c02001-05-22 19:26:31 +0000941 <sect2>
942 <title>Drivers</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000943
Eric Pouech30975c02001-05-22 19:26:31 +0000944 <para>
945 Since all multimedia drivers (MCI, low level ones, ACM drivers,
946 mappers) are, at first, drivers they need to appear in the [mci] or
947 [mci32] section of the system.ini file.
948 Since all drivers are, at first, DLLs, you can choose to load their
949 Wine's (built-in) or Windows (native) version.
950 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000951
Eric Pouech30975c02001-05-22 19:26:31 +0000952 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000953
Eric Pouech30975c02001-05-22 19:26:31 +0000954 <sect2>
955 <title>MCI</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000956
Eric Pouech30975c02001-05-22 19:26:31 +0000957 <para>
958 A default [mci] section (in system.ini) looks like (see the note above
959 on videodisc):
960 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000961
Eric Pouech30975c02001-05-22 19:26:31 +0000962 <screen>
963 [mci]
964 cdaudio=mcicda.drv
965 sequencer=mciseq.drv
966 waveaudio=mciwave.drv
967 avivideo=mciavi.drv
968 videodisc=mcipionr.drv
969 vcr=mcivisca.drv
970 MPEGVideo=mciqtz.drv
971 </screen>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000972
Eric Pouech30975c02001-05-22 19:26:31 +0000973 <para>
974 By default, the list of loadable MCI drivers will be made of those
975 drivers (in the [mci] section).
976 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000977
Eric Pouech30975c02001-05-22 19:26:31 +0000978 <para>
979 The list of loadable (recognized) MCI drivers can be altered in the
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000980 [option] section of the wine config file, like:
Eric Pouech30975c02001-05-22 19:26:31 +0000981 mci=CDAUDIO:SEQUENCER:WAVEAUDIO:AVIVIDEO:MPEGVIDEO
982 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000983
Eric Pouech30975c02001-05-22 19:26:31 +0000984 <para>TODO:
985 <itemizedlist>
986 <listitem>
987 <para>
988 use a default registry setting to bypass this (ugly) configuration
989 model
990 </para>
991 </listitem>
992 </itemizedlist>
993 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000994
Eric Pouech30975c02001-05-22 19:26:31 +0000995 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000996
Eric Pouech30975c02001-05-22 19:26:31 +0000997 <sect2>
998 <title>Low level drivers</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +0000999
Eric Pouech30975c02001-05-22 19:26:31 +00001000 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001001 Configuration of low level drivers is done with the Wine configuration file.
Eric Pouech30975c02001-05-22 19:26:31 +00001002 Default keys are provided in winedefault.reg.
1003 </para>
1004
1005 <para>
1006 The registry keys used here differ from the Windows' one. Using the Windows' one
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001007 would require implementing something equivalent to a (real) driver installation.
Eric Pouech30975c02001-05-22 19:26:31 +00001008 Even if this would be necessary in a few cases (mainly using MS native multimedia)
1009 modules, there's no real need so far (or it hasn't been run into yet).
1010 </para>
1011
1012 <para>
1013 See the configuration part of the User's Guide for more details.
1014 </para>
1015
1016 </sect2>
1017
1018 <sect2>
1019 <title>Midi mapper</title>
1020
1021 <para>
1022 The Midi mapper configuration is the same as on Windows 9x. Under the key
1023 <screen>
1024HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Multimedia\MIDIMap
1025 </screen>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001026 if the 'UseScheme' value is not set, or is set to a null value, the midi
1027 mapper will always use the driver identified by the 'CurrentInstrument'
1028 value. Note: Wine (for simplicity while installing) allows to define
Eric Pouech30975c02001-05-22 19:26:31 +00001029 'CurrentInstrument' as "#n" (where n is a number), whereas Windows only
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001030 allows the real device name here. If UseScheme is set to a non null value,
1031 'CurrentScheme' defines the name of the scheme to map the different channels.
Eric Pouech30975c02001-05-22 19:26:31 +00001032 All the schemes are available with keys like
1033 <screen>
1034HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Midi\Schemes\%name_of_scheme%
1035 </screen>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001036 For every scheme, under this key, will be a sub-key (which name is usually
1037 a two digit index, starting at 00). Its default value is the name of the
1038 output driver, and the value 'Channels' lists all channels (of the 16
Eric Pouech30975c02001-05-22 19:26:31 +00001039 standard MIDI ones) which have to be copied to this driver.
1040 </para>
1041
1042 <para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001043 To provide enhanced configuration and mapping capabilities, each driver
Eric Pouech30975c02001-05-22 19:26:31 +00001044 can define under the key
1045 <screen>
1046HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Midi\Ports\%driver_name%
1047 </screen>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001048 a link to and .IDF file which allows to remap channels internally (for
1049 example 9 -&gt; 16), to change instruments identification, event
1050 controlers values. See the source file dlls/winmm/midimap/midimap.c
Eric Pouech30975c02001-05-22 19:26:31 +00001051 for the details (this isn't implemented yet).
1052 </para>
1053 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001054
Eric Pouech30975c02001-05-22 19:26:31 +00001055 <sect2>
1056 <title>ACM</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001057
Eric Pouech30975c02001-05-22 19:26:31 +00001058 <para>
1059 To be done (use the same mechanism as MCI drivers configuration).
1060 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001061
Eric Pouech30975c02001-05-22 19:26:31 +00001062 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001063
Eric Pouech30975c02001-05-22 19:26:31 +00001064 <sect2>
1065 <title>VIDC</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001066
Eric Pouech30975c02001-05-22 19:26:31 +00001067 <para>
1068 To be done (use the same mechanism as MCI drivers configuration).
1069 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001070
Eric Pouech30975c02001-05-22 19:26:31 +00001071 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001072
Eric Pouech30975c02001-05-22 19:26:31 +00001073 </sect1>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001074
Eric Pouech30975c02001-05-22 19:26:31 +00001075 <sect1 id="mm-arch">
1076 <title>Multimedia architecture</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001077
Eric Pouech30975c02001-05-22 19:26:31 +00001078 <sect2>
1079 <title>Windows 9x multimedia architecture</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001080
Eric Pouech30975c02001-05-22 19:26:31 +00001081 <screen>
1082 |
1083Kernel space | Client applications
1084 |
1085 | | | ^ ^ | | | |
1086 | 16>| |<32 16>| |<32 16>| |<32 16>| |<32
1087 | | v | | | v | v
1088 | +----|-----------|---------|------------|-------+
1089 | | | | | | | WinMM.dll
1090 | | | | | | | 32 bit
1091 | +----|-----------|---------|------------|-------+
1092 | | | | ^ | | |
1093 | +------+ | |<16 | | | |<16 |
1094 | | 16>| | | | | | | |
1095 | | v v v | | v v v
1096 | | +---------------+---+-------------+-------------+
1097 | | | waveInXXX | | mciXXX | *playSound* |
1098 | | | waveOutXXX | | | mmioXXX |
1099 | | | midiInXXX | | | timeXXX |
1100 | | | midiOutXXX | | | driverXXX |
1101 | | | midiStreamXXX | | | | MMSystem.dll
1102 | | | mixerXXX | | | | 16 bit
1103 +--------+ | | | auxXXX +---+ +---+ mmThread| |
1104 |MMDEVLDR|<------->| joyXXX | Call back | mmTask | |
1105 +--------+ | | +-----------+-----------+---------+-------------+
1106 ^ | | | ^ ^ | ^
1107 | | | 16>| |<16>| 16>| |<16
1108 v | | v | | v |
1109 +--------+ | | +-------------+ +----------+
1110 | VxD |<------->| *.drv | | mci*.drv |
1111 +--------+ | | +--------------+ +-----------+
1112 | | | msacm.drv | | mciwave |
1113 | | +--------------+ +-----------+
1114 | | | midimap.drv | | mcimidi |
1115 | | +-------------+ +-----------+
1116 | | Low-level drivers | ... | MCI drivers
1117 | | +----------+
1118 | | |
1119 | | |<16
1120 | +-------------------------------+
1121 |
1122 </screen>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001123
Eric Pouech30975c02001-05-22 19:26:31 +00001124 <para>
1125 The important points to notice are:
1126 <itemizedlist>
1127 <listitem>
1128 <para>
1129 all drivers (and most of the core code) is 16 bit
1130 </para>
1131 </listitem>
1132 <listitem>
1133 <para>
1134 all hardware (or most of it) dependant code reside in the kernel
1135 space (which is not surprising)
1136 </para>
1137 </listitem>
1138 </itemizedlist>
1139 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001140
Eric Pouech30975c02001-05-22 19:26:31 +00001141 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001142
Eric Pouech30975c02001-05-22 19:26:31 +00001143 <sect2>
1144 <title>Wine multimedia architecture</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001145
Eric Pouech30975c02001-05-22 19:26:31 +00001146 <screen>
1147 |
1148Kernel space | Client applications
1149 |
1150 | | | ^ ^ | | | |
1151 | 16>| |<32 16>| |<32 16>| |<32 16>| |<32
1152 | | | | | | | | |
1153 | +------+ | | | | | | | |
1154 | |32/16>| | | | | | | | |
1155 | | v v v | | v v v v
1156 | | +---------------+---+-------------+-------------+
1157 | | | waveInXXX | | mciXXX | *playSound* |
1158 | | | waveOutXXX | | | mmioXXX | WinMM.dll
1159 | | | midiInXXX | | | timeXXX | 32 bit
1160 | | | midiOutXXX | | | driverXXX |
1161 | | | midiStreamXXX | | | | MMSystem.dll
1162 | | | mixerXXX | | | | 16 bit
1163 | | | auxXXX +---+ +---+ mmThread| |
1164 | | | joyXXX | Call back | mmTask | |
1165 | | +-----------+-----------+---------+-------------+
1166 | | || ^ ^ || ^^
1167 | | 16>||<32 |<16>| 16>||<32>||<16
1168 | | vv |<32>| vv ||
1169+---------+ | | +-------------+ +----------+
1170|HW driver|<------->| *.drv | | mci*.drv |
1171+---------+ | | +--------------+ +-----------+
1172 | | | msacm.drv | | mciwave |
1173 | | +--------------+ +-----------+
1174 | | | midimap.drv | | mcimidi |
1175 | | +-------------+ +-----------+
1176 | | Low-level drivers | ... | MCI drivers
1177 | | +----------+
1178 | | |
1179 | | |<32/16
1180 | +-------------------------------+
1181 |
1182 </screen>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001183
Eric Pouech30975c02001-05-22 19:26:31 +00001184 <para>
1185 From the previous drawings, the most noticeable differences are:
1186 <itemizedlist>
1187 <listitem>
1188 <para>
1189 low-level drivers can either be 16 or 32 bit
1190 </para>
1191 </listitem>
1192 <listitem>
1193 <para>
1194 MCI drivers can either be 16 or 32 bit
1195 </para>
1196 </listitem>
1197 <listitem>
1198 <para>
1199 MMSystem and WinMM will be hosted in a single elfglue library
1200 </para>
1201 </listitem>
1202 <listitem>
1203 <para>
1204 no link between the MMSystem/WinMM pair on kernel space shall
1205 exist. For example, there will be a low level driver to talk to a
1206 UNIX OSS (Open Sound System) driver
1207 </para>
1208 </listitem>
1209 <listitem>
1210 <para>
1211 all built-in drivers (low-level and MCI) will be written as 32 bit
1212 drivers
1213 </para>
1214 </listitem>
1215 <listitem>
1216 <para>
1217 all native drivers will be 16 bits drivers
1218 </para>
1219 </listitem>
1220 </itemizedlist>
1221 </para>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001222
Eric Pouech30975c02001-05-22 19:26:31 +00001223 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001224
Eric Pouech30975c02001-05-22 19:26:31 +00001225 </sect1>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001226
Eric Pouech30975c02001-05-22 19:26:31 +00001227 <sect1 id="msacm">
1228 <title>MS ACM Dlls</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001229
Eric Pouech30975c02001-05-22 19:26:31 +00001230 <sect2>
1231 <title>Contents</title>
1232
1233 <para>tbd</para>
1234 </sect2>
1235
1236 <sect2>
1237 <title>Status</title>
1238
1239 <para>tbd</para>
1240 </sect2>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001241
Eric Pouech30975c02001-05-22 19:26:31 +00001242 <sect2>
1243 <title>Caching</title>
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001244
Eric Pouech30975c02001-05-22 19:26:31 +00001245 <para>
1246 The MSACM/MSACM32 keeps some data cached for all known ACM
1247 drivers. Under the key
1248 <screen>
1249 Software\Microsoft\AudioCompressionManager\DriverCache\&lt;driver
1250 name&gt;
1251 </screen>
1252 are kept for values:
1253 <itemizedlist>
1254 <listitem>
1255 <para>
1256 aFormatTagCache which contains an array of
1257 DWORD. There are two DWORDs per cFormatTags
1258 entry. The first DWORD contains a format tag
1259 value, and the second the associated maximum
1260 size for a WAVEFORMATEX structure.
1261 (Fields dwFormatTag and cbFormatSize from
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001262 ACMFORMATDETAILS)
Eric Pouech30975c02001-05-22 19:26:31 +00001263 </para>
1264 </listitem>
1265 <listitem>
1266 <para>
1267 cFilterTags contains the number of tags supported by the driver
1268 for filtering.
1269 </para>
1270 </listitem>
1271 <listitem>
1272 <para>
1273 cFormatTags contains the number of tags support
1274 by the driver for conversions.
1275 </para>
1276 </listitem>
1277 <listitem>
1278 <para>
1279 fdwSupport (the same as the one returned from
Andreas Mohr5ec74d62002-07-24 03:00:02 +00001280 acmDriverDetails).
Eric Pouech30975c02001-05-22 19:26:31 +00001281 </para>
1282 </listitem>
1283 </itemizedlist>
1284 </para>
1285
1286 <para>
1287 The cFilterTags, cFormatTags, fdwSupport are the same
1288 values as the ones returned from acmDriverDetails
1289 function.
1290 </para>
1291 </sect2>
1292 </sect1>
1293
1294
1295 </chapter>
1296
1297<!-- Keep this comment at the end of the file
1298Local variables:
1299mode: sgml
1300sgml-parent-document:("wine-doc.sgml" "set" "book" "part" "chapter" "")
1301End:
1302-->