Initializing and Configuring Multimedia Device Drivers

To activate an installed driver, the multimedia driver must receive an initialization message, DRV_OPEN. The DRV_OPEN message sets up an initial session in which the instance information is NULL. This session keeps the driver active as long as it is installed. Because this session remains open for a long time, it is important that no critical resources be allocated and left allocated for the life of the session.

If your device driver supports more than one interrupt-level or port assignment, it should allow user configuration through the Multimedia option in the Control Panel. Through the DRV_CONFIGURE message, installable drivers can supply a configuration dialog box for this purpose. The dialog box should display the name and version number of your device driver.

In addition to the DRV_CONFIGURE message, device drivers might support driver-specific messages. For example, video-capture drivers also use the DVM_DIALOG message to display dialog boxes for configuring various channels. For more information about the messages for displaying additional dialog boxes, see the main topics describing specific device drivers.

Installable drivers can supply a configuration dialog box for users to access through the Drivers option in the Control Panel. The Multimedia option sends the DRV_CONFIGURE message to your driver to display the dialog box. The dialog box should display the name and version number of your device driver. If your device driver supports different interrupt-level and port assignments, it should also support user configuration through the Multimedia option in the Control Panel.

Introduction

This topic contains information that pertains to non-Plug and Play devices. Configuration and loading information for Plug and Play devices is stored in the registry.

The SYSTEM.INI file contains information for loading and configuring device drivers. Your device driver must be identified in the [drivers] section. Your device driver might also have entries in the [386enh] section if it requires any VxDs for operation. Your driver might also reserve a device-specific section in the SYSTEM.INI to store configuration information. When you install or remove a device, the installation program updates the [drivers] and [386enh] sections.

Interrupt-Level and Port Assignments

Interrupt-level and port assignments, and any other hardware-related settings, can be stored in a section with the same name as the driver in the user's SYSTEM.INI file. (Alternatively, your driver might use its own .INI file for this information.)

For example, the following SYSTEM.INI section, created by the Bravado driver, specifies interrupt level 9 and memory base E:


[Bravado.drv]
Interrupt=9
MemoryBase=E

To conform to other Windows drivers, use the keynames int and port to specify interrupt-level and port assignments. For example, the following SYSTEM.INI section specifies interrupt level 3 and port 0x220 for the Sound Blaster(tm) driver:


[Sound Blaster]
int=3
port=220

Note

Software-only codecs do not require interrupt and port settings, but hardware-assisted codecs do. Interrupt and port settings for hardware-assisted codecs are similar to those used by wave and capture drivers. The ACM is like software-only codecs in that it does not require specific interrupt and port settings. The installation program for any audio hardware in a system should create the appropriate entries for that hardware.

Support for Driver Installation

The Multimedia option in the Control Panel is the preferred method for installing device drivers. The Multimedia option uses information in the OEMSETUP.INF file for your driver to add the entries in the [drivers] section, as well as entries in the [386enh] section, to install any VxDs you require.

The entry that identifies your driver in the [drivers] section lets Windows load the driver. If this entry is absent, your driver won't be recognized. While installation programs usually add the necessary entry for completed device drivers, you might have to manually add it while you are developing your device driver. You might also have to manually add any [386enh] entries you need. The final version of your device driver should use an installation program to create and delete the entries in these two sections. The following table identifies the keynames for various multimedia drivers.

Use this keyname

For the following driver types

MSVideo

Video-capture device drivers.

wave

Waveform device drivers.

midi

MIDI device drivers.

vidc.nnnn

Video compression or decompression device driver. In this case, nnnn represents the four-character code for the driver.

msacm.nnnn

Audio compression or decompression device driver. In this case, nnnn represents the four-character code for the driver.

vids.nnnn

Video stream compression driver. In this case, nnnn represents the four-character code for the driver.


If there is more than one wave or MIDI driver, append a number from 1 to 9 after the keyname. When you have multiple drivers, use sequential numbers to identify them.

For example, the following [drivers] section extract identifies one waveform device driver named SNDBLST2.DRV, two MIDI device drivers named ADLIB.DRV and MPU401.DRV, and one video-capture device driver named BRAVADO.DRV.


[drivers]
timer=timer.drv
joystick=ibmjoy.drv
wave=*.drv
midi=*.drv
midimapper=midimap.drv
wavemapper=msacm.drv
MSVideo=bravado.drv

Note

After installing an audio driver with the Multimedia option in the Control Panel, Windows must be restarted to load the driver.

Video-Capture Drivers

You can have more than one driver of the MSVideo type in the [drivers] section. The following example shows a [drivers] section with entries for five video-capture drivers:


[drivers] 
MSVideo=targa16.drv 
MSVideo1=testdrv.drv 
MSVideo2=bravado.drv 
MSVideo3=vblaster.drv 
MSVideo4=MYDRVR.DRV

If you are using the VidCap video-capture application, you can select the video-capture driver it uses with the -d command-line option. The integer specified after the -d corresponds to the video-capture driver entry. For example, the command VidCap -d0 uses the TARGA16.DRV driver associated with the MSVideo entry. VidCap -d3 uses the VBLASTER.DRV associated with the MSVideo3 entry.

Note

Video-capture device drivers are loaded only when needed by an application.

Video Compression and Decompression Drivers

Video compression and decompression drivers can use an entry in the [Installable Compressors] section of the SYSTEM.INI file for loading and configuring the driver. Identify your driver in the [drivers] section if you want to use the Multimedia option of the Control Panel to install or configure it. Identify your driver in the [Installable Compressors] section if you want to use a custom-installation application. If you use a custom-installation application, it should update the [Installable Compressors] section when your driver is installed or removed.

Video compression and decompression drivers are identified by the keyname VIDC., followed by its four-character code identifier. For example, the following [Installable Compressors] section of SYSTEM.INI identifies one video compression and decompression driver:


[Installable Compressors] 
VIDC.SAMP = ICSAMPLE.DRV

SAMP is the four-character code identifier of the compressor. This driver has a file name of ICSAMPLE.DRV.

The four-character code identifier must be unique. If you want to create a new four-character code identifier, register it with Microsoft to set up a standard definition and avoid any conflicts with other codes that might be defined. To register a code for a compression and decompression driver, request a Multimedia Developer Registration Kit from the following group:

Microsoft Corporation

Advanced Consumer Technology Group

Product Marketing

One Microsoft Way

Redmond, WA 98052-6399


For more information about four-character codes, see the Microsoft Windows Programmer's Reference.