## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### Step 3. Modifying the CARDINFO.RC File

The CARDINFO.RC file is located in the \MMOS2\MMTOOLKT\SAMPLES\AUDINST subdirectory. Modify this file so that it contains information relevant to your audio adapter. MMPM/2 uses this information to interface with your adapter.

Notes:

1.The lines in this file that contain RCDATA, BEGIN, and END identify the beginning and ending of specific pieces of data. Do not change these lines.

2.If more than one adapter is added, increment each RCDATA number by 10 for each additional adapter. For example, the first adapter uses RCDATA 10 through RCDATA 19, the second adapter uses RCDATA 20 through RCDATA 29, and so forth.

3.If the audio adapter does not have a value corresponding to one of the CARDINFO.RC file parameters, use a null string "/0" in the parameter.

The CARDINFO.RC parameters are:

RCDATA 1 Indicates the number of adapters described in this CARDINFO.RC file. In most cases, this is 1. To install more than one type of audio adapter, place that number in this parameter.

For example, in the CARDINFO.RC file, the ProAudio Spectrum adapter is:

    RCDATA 1
    BEGIN
       "1"           /* Number of adapters in this rc file */
    END

RCDATA 10 Contains two parameters, the ID number and the type of audio adapter. The ID number is used in the CONTROL.SCR file that you modify in Step 7. The ID number can be any number. However, it must match the ssdllinputparms keyword in the CONTROL.SCR file. For the type of adapter, use "audiovdd" if the adapter uses the IBM AUDIOVDD.SYS device driver. If the adapter does not use this driver, put "audio" in this field.

For example, in the CARDINFO.RC file, the ProAudio Spectrum 16 adapter is:

    RCDATA 10
    BEGIN
       "26",            /* ID number of this adapter             */
       "audiovdd"       /* Type of adapter - use audiovdd if     */
                        /* you use the IBM audiovdd.sys driver   */
    END

For more information, see Audio Physical Device Driver Template.

RCDATA 11 Contains parameters that indicate:

The maximum number of this type of audio adapter that can be installed at one time. The maximum is six adapters.

The name of the help file that describes the audio adapter. This name defaults to AUDHELP.HLP if the MAKEFILE provided to create the help file is used.

The name of the audio-adapter-specific DLL you wrote to perform functions not provided by this generic audio installation program. This DLL is described in Step 4. Creating an Audio Installation DLL. If you did not write a DLL, specify "\0".

The name of the audio-adapter-specific DLL entry point into the DLL in the previous field. If you did not write a DLL, specify "\0".

The number of CONFIG.SYS lines to add to the user's CONFIG.SYS file to support the audio adapter. The maximum is six lines.

Note: Do not count the AUDIOVDD.SYS line.

The CONFIG.SYS line format of the lines added to the user's CONFIG.SYS file (except for the AUDIOVDD.SYS line). Tokens in this line are replaced with the appropriate values at runtime. The following list describes the tokens and their data substitutions:

*PATH* Indicates the path where MMPM/2 is installed (for example, c:\MMOS2) .

*ORD* Indicates the device ordinal of this adapter.

*SEQ* Indicates the sequential number of this adapter. For example, if the user installs two IBM audio adapters, the first will have a number of 1 and the second a number of 2.

*PDD* Indicates the PDDName of this adapter.

*VAL* Indicates the values that the user gives when prompted by the installation program. You can have more than one of these tokens if the user is asked for more than one item.

Note: Later in the CARDINFO.RC file, you specify which questions the installation program should ask.

*SPEC* Indicates special values passed from your adapter-specific DLL.

For example, the line in the sample CARDINFO.RC file is:

"DEVICE=*PATH*\\MVPRODD.SYS /I*VAL* /D*VAL* /N:*PDD*"

After the real values are substituted, the CONFIG.SYS line is similar to:

DEVICE=C:\MMOS2\MVPRODD.SYS /I5 /D12 /N:PAS161$

The number of drivers to install into the MMPM/2 system. For an audio adapter, this would normally be three because most audio adapters install a Waveform, Audio Sequencer, and Audio Ampmixer driver. The maximum is six drivers.

The name of the adapter as it is displayed to the user.

The version number of the device driver.

The physical device driver name (PDDName) used to identify the device driver. The sequential number of the adapter and a "$" is added to this name to form the final PDDName. For example, if the user installs two ProAudio Spectrum 16 adapters, the PDDNames are PAS161$ and PAS162$.

The name of the MCD command table used by the drivers. In most cases, this is the IBM MCD command table 'MDM'.

The name of the VSD command table used by the drivers. In most cases this is blank.

For example, in the CARDINFO.RC file, the ProAudio Spectrum 16 adapter is:

    RCDATA 11
    BEGIN
       "1",                        /* Max number of adapters (2 chars)           */
       "audhelp.HLP",              /* Helpfile name (19 chars)                   */
       "\0",                       /* Adapter specific dll name (19 chars)       */
       "\0",                       /* Adapter specific dll entry point (39 chars)*/

       /**** Data for CONFIG.SYS **/
       "1",                        /* Number of CONFIG.SYS lines (1 char)        */
       "DEVICE=*PATH*\\MVPRODD.SYS /I*VAL* /D*VAL* /N:*PDD*"
                                   /* CONFIG.SYS Line 1                          */
                                   /* (255 chars after token substitution)       */

       /**** Data for INI File ****/
       "3",                        /* Number of Drivers to Install (1 char)      */
       "Pro AudioSpectrum 16",     /* Product name (39 chars)                    */
       "1.0"                       /* Version of the adapter's software (5 chars)*/
       "PAS16",                    /* PDD Name  (6 chars)                        */
       "MDM",                      /* MCD table name (19 chars)                  */
       "\0"                        /* VSD table name (19 chars)                  */
    END

RCDATA 12 This group of parameters is repeated for each driver you want to install. The repeated groups start with RCDATA 13, RCDATA 14, and so forth. ) These parameters indicate:

The InstallName of this driver. This must be a unique name. Consider using a name that is a combination of a company name, device type, and device model. The sequential number of this adapter is added to the name (for example, IBMWAVEPAS1601).

The device type encoding. These codes are defined in the MCIOS2.H file located in the \MMOS2\MMTOOLKT\H subdirectory.

The numeric device flag of this driver. Specifies the LONG INT with the flags set. This determines whether or not the device is controllable. The device flags are defined in the MCIOS2.H file located in the \MMOS2\ MMTOOLKT\H subdirectory.

The name of the media control driver (MCD) used by this driver. In most cases, this is the IBM MCD "AUDIOMCD."

The name of the vendor-specific driver (VSD) used by this driver. In most cases, this is the IBM VSD "AUDIOIF."

The numeric share type. Specifies an encoding of the valid types of sharing supported. These codes are defined in the MMDRVOS2.H file located in the \MMOS2\MMTOOLKT\H subdirectory.

The name to be given to this driver's resources. Specifies a unique name for the management of the driver resources. The sequential number of the adapter is added to this name so that resources of different drivers are not mixed. If you have more than one driver, be sure to use a different resource name for each driver. For more information, see Resource Units and Classes.

The number of resource units supported by this driver. For more information, see Resource Units and Classes.

The number of resource classes supported by this driver. The maximum is nine resource classes. These classes are listed in the next field. For more information, see Resource Units and Classes.

The resource classes. For more information, see Resource Units and Classes .

The number of valid combinations of resource classes. The maximum is 81 combinations. For more information, see Resource Units and Classes.

The valid resource class combinations. Resource class combinations are always listed in pairs. For example, if a class 1 can combine with a class 2, then class 2 can combine with class 1.

For more information, see Resource Units and Classes.

The number of connectors. These are listed in the next field. The maximum is 10 connectors. Each implementation of a media driver defines the paths of information flow into and out of the device. These paths are known as connectors. Connectors have defined connector types, and each connector type has an associated connector-type name.

The connectors. Each connector has three values:

-Numeric type of connector. Connection types are defined in the MCIOS2.H file located in the \MMOS2\MMTOOLKT\H subdirectory.

-InstallName of the driver to which it connects. If left blank, a default connector is used.

-Sequential number of the connector to which it connects. The sample CARDINFO.RC file uses:

"3","IBMAMPMIXPAS16","1"

where:

3 Indicates the wave stream connector.

"IBMAMPMIXPAS16" Indicates the amplifier-mixer device.

1 Indicates the first connector of the amplifier-mixer device.

The number of file-name extensions associated with this driver. When an element name is specified as the device name on an MCI_OPEN message and no device type is specified, the device type is identified by the file extension. For example, if the .WAV extension is associated with an internal driver name, that driver will be used if a file ending in .WAV is opened.

The file-name extensions associated with this driver.

The extended attribute associated with this driver. When an element name is specified as the device name on an MCI_OPEN message and no device type is specified, the device type is identified by the file's extended attribute. For example, if the "Digital Audio" extended attribute is associated with an internal driver name, that driver will be used if a file with an extended attribute of "Digital Audio" is opened.

The AliasName given to the driver. The device ordinal is added to this name if the ordinal is greater than 1. For example, the second Waveform Audio driver would be given an AliasName of Digital Audio 2.

Any device specific parameters. For the Waveform Audio driver, the following parameters set up the initial state of the adapter, and should be listed:

FORMAT= RIFF Datatype The RIFF Datatype is a format tab defined in \MMOS2\ MMTOOLKT\H\OS2MEDEF.H.

SAMPRATE= Indicates the sample rate.

BPS= Indicates the bits per second.

CHANNEL= Indicates mono (1) or stereo (2).

DIRECTION= Indicates PLAY or RECORD.

For the Audio AmpMixer driver, the following parameters set up the initial state of the adapter, and should be listed.

TREBLE= Indicates the treble setting. Valid values are from 0 to 100. This parameter should usually match the sample CARDINFO.RC file.

BASS= Indicates the bass setting. Valid values are from 0 to 100. This parameter should usually match the sample CARDINFO.RC file.

PITCH= Indicates the pitch setting. Valid values are from 0 to 100. This parameter should usually match the sample CARDINFO.RC file.

GAIN= Indicates the increase in level of output over the level of input setting. Valid values are from 0 to 100. This parameter should usually match the sample CARDINFO.RC file.

BALANCE= Indicates the BALANCE setting. Valid values are from 0 to 100. This parameter should usually match the sample CARDINFO.RC file.

VOL= Indicates the volume setting. Valid values are from 0 to 100. This parameter should usually match the sample CARDINFO.RC file.

INPUT= Specifies LINE or MIC.

OUTPUT= Specifies SPEAKERS or HEADPHONES.

RESOURCEDLL= Specifies the name of the vendor-specific driver resource DLL that you create. For more information, see Step 2. Writing a Vendor- Specific Driver.

RCID Specifies the resource ID in the vendor-specific driver resource DLL that you create. For more information, see Step 2. Writing a Vendor- Specific Driver. For the Sequencer driver, the following parameters are listed:

CHANNELS= This parameter is followed by 16 1s or 0s to represent whether the sequencer's channels default to on (1) or off (0).

MIDITYPE= This parameter is followed by "General MIDI" if your adapter uses the General MIDI specification. If your adapter does not use General MIDI, you create a MIDI Map Table as specified in Step 9. Creating a MIDI Map. In this case, the parameter is followed by the adapter name. This name must be the same name used for "keyname" in the MIDIMAP.SCR file in Step 9. Creating a MIDI Map.

For example, in the CARDINFO.RC file, the ProAudio Spectrum 16 adapter is:

    RCDATA 12
    BEGIN
        / * * * *   WAVEAUDIO   Driver   * * * * /
        " IBMWAVEPAS16 "                 / *   Installname   ( 17   chars )                         * /
        " 7 " ,                            / *   Device   type   ( 3   chars )                          * /
        " 1 " ,                            / *   Device   flag   ( 3   chars )                          * /
        " AUDIOMCD " ,                    / *   MCD   driver   name   ( 19   chars )                    * /
        " AUDIOIF " ,                     / *   VSD   driver   name   ( 19   chars )                    * /
        " 3 " ,                            / *   Share   Type   ( 3   chars )                           * /
        " ProAudioSpecW " ,               / *   Resource   name   ( 17   chars )                      * /
        " 1 " ,                            / *   #   of   Resource   units   ( 2   chars )                 * /
        " 1 " ,                            / *   #   of   Resource   classes   ( 2   chars )               * /
        " 1 " ,                            / *   Resource   classes   ( 2   char   each )                * /
        " 0 " ,                            / *   #   Valid   resource   class   combos   ( 2   chars )      * /
                                       / *   Valid   resource   class   combos   ( 2   chars   each )   * /
        " 1 " ,                            / *   #   of   connectors   ( 2   chars )                     * /
        " 3 " , " IBMAMPMIXPAS16 " , " 1 " ,     / *   Connectors   ( 2   chars ) ,   ( 17   chars ) ,   ( 2   chars ) * /
        " 1 " ,                            / *   #   of   extensions   ( 2   chars )                     * /
        " WAV " ,                          / *   Extension   names   ( 3   chars   each )                * /
        " Digital   Audio " ,               / *   Extended   attribute   ( 255   chars )                * /
        " Digital   Audio " ,               / *   Alias   Name   ( 17   chars )                          * /
        " FORMAT = 1 , SAMPRATE = 22050 , BPS = 16 , CHANNELS = 1 , DIRECTION = PLAY "
                                       / *   Device   Specific   Parameters   ( 255   chars )       * /
    END

RCDATA 19 This group of parameters indicates:

The number of prompts that should be presented to the user. This number is used to gather configuration-specific information about the adapter. The maximum is 10 prompts.

The title of the prompt text as it is displayed to the user.

The number of valid answers to the prompt. The maximum is 25 answers. You supply the valid answers in the next field.

The valid answers to your prompt. These answers are displayed to the user . The user can select one.

The values that are put in your CONFIG.SYS line. These values replace the *VAL* tokens that you placed in your CONFIG.SYS line format previously in this CARDINFO.RC file. These values correspond to the valid answers in the previous field. For example, if the user selects answer number three from the list of valid answers, then value number three is placed into your CONFIG.SYS line. This allows you to ask the user questions in a user- friendly fashion and then place a more cryptic value in the CONFIG.SYS line .

For example, if you want to ask the user which song to play, you can use the following prompt:

    Song to play on startup?

You can present the following choices to the user:

    Happy Birthday

    Beethoven's Fifth

    Joy to the World

The values put into the CONFIG.SYS line could be "birthday.wav", "beet_5. wav", or "joyworld.wav".

The default answer to the prompt. This is an index into the list of valid answers. For example, if the second answer is the default, specify "2". For an example of how to specify the RCDATA 19 parameters for this example, see Songs Example.

For example, in the CARDINFO.RC file, the ProAudio Spectrum 16 adapter is:

    RCDATA 19
    BEGIN
       // Prompts for the User
       "2",                        /* Number of prompts to ask user (2 chars)    */
                                   /* (max 10 prompts)                           */
       // Prompt 1
       "DMA Channel",              /* Title of Prompt (max 50 chars)             */
       "7",                        /* # of valid values (2 chars)                */
       "0","1","2","3",            /* Valid values  (20 chars each)              */
       "5","6","7",
       "0","1","2","3",            /* Corresponding config.sys values            */
       "5","6","7",                /* (20 chars each)                            */

       "4",                        /* Default value - Index into valid values    */
                                   /* (2 chars)                                  */

       // Prompt 2
       "Interrupt Level",          /* Title of Prompt (max 50 chars)             */
       "8",                        /* # of valid values (2 chars)                */
       "Interrupt 2",              /* Valid values (20 chars each)               */
       "Interrupt 3",
       "Interrupt 5",
       "Interrupt 7",
       "Interrupt 10",
       "Interrupt 11",
       "Interrupt 12",
       "Interrupt 15",

       "2",                        /* Corresponding config.sys values            */
       "3",                        /* (20 chars each)                            */
       "5",
       "7",
       "10",
       "11",
       "12",
       "15",

       "6"                         /* Default value - Index into valid values    */
                                   /* (2 chars)                                  */
    END