Pipe Mixer set v.0.03 by Lesha Bogdanow. This is free software. It is distributed under GNU General Public License. See file COPYING for details. There is NO WARRANTY. Use it at your own risk. This program uses some parts from free IOCTL 90 API demonstration program. INTRO This is a set of mixer backend demons with pipe interface. These demons can be used in combination with LBMix mixer front end. This set contains of mixer backends for IOCTL90 API and Crystal Semi mode 2 chips. The pipe interface is a simple mixer backend interface which allows easy developing of new mixers. A side effect of using pipes to communicate is ability to control the mixer remotely or by REXX scripts. USAGE The demon can be either started a text mode application or detached. Detaching is recommended. Command line parameters common for all demons: -pn - Changes name of the pipe used for communication with the demon. Default is \PIPE\MIXER -v - Enables verbose mode. The mixer displays incoming commands and outgoing responses on stdio. This option significantly slows down the command processing speed so you should use it only for debugging purposes. You should start LBMix with -p option to use it with pipe mixer backend. IOCTL90 BACKEND (Mix90.exe) This backend works with drivers supporting IOCTL90 mixer API (see http://www.pompano.net/~joenord/ioctl90/ for more info) It was written primarily for debugging or demonstration purposes. However it can be used to control the mixer remotely or by a REXX script. Additional command line parameters: -d - Changes the name of audio device driver. Default is MMOS/2 default driver. -mv - Enables Master volume support (via IOCTL category 80 API). CRYSTAL SEMI MODE 2 BACKEND (MixCS2.exe) This backend works with audio cards using Crystal Semiconductor chips working in mode 2 (using drivers v.1.xx). Additional command line parameters are: -b - OBLIGATORY parameter. Specifies base port of the card (value of /P parameter of BASEDEV=CWCONFIG.SYS in CONFIG.SYS). -l - Specifies the lock rate in milliseconds. The lock rate specifies how often locked controls will be re-programmed. Locking is turned off on default. NOTE1: The backend reports that the microphone output mixer is supported while it is not due to hardware limitations. This is done to enable selecting microphone as an input. CRYSTAL SEMI MODE 3 MIXER PATCH FOR DRIVER 2.08 (MixCS38.exe) This backend works with Crystal Semiconductor driver v.2.08 and provides a full functionality of driver v.2.09 (not released at this moment) by handling some controls by itself and passing the rest to the driver. The controls handled by the patch are: Line volume, Mic volume, DAC volume, ADC gain, 3D processing, Record source multiplexer. Additional command line parameters are: -b - OBLIGATORY parameter. Specifies base port of the card (value of /P parameter of BASEDEV=CWCONFIG.SYS in CONFIG.SYS). -l - Specifies the lock rate in milliseconds. The lock rate specifies how often locked controls will be re-programmed. Locking is turned off on default. -d - Changes the name of audio device driver. Default is MMOS/2 default driver. -c - Set control port base and enable 3D. The control port is used to access 3D control registers. It is not the same as base port. Usually 120. -mv - Enables Master volume support (via IOCTL category 80 API). NOTE: If your card does not support 3D processing or you don't need it you should not specify the control port. 3D support was tested only on CS4237B and I don't know if it will work with other 3D-enhanced mode 3 chips. CRYSTAL SEMI MODE 3 MIXER PATCH FOR DRIVERS 2.09+ (MixCS3.exe) This backend works with Crystal Semiconductor drivers v.2.09+ (not released at this moment) and can fix non-continuous DAC volume control problem and/or provide 3D support. Additional command line parameters are: -d - Changes the name of audio device driver. Default is MMOS/2 default driver. -c - Set control port base and enable 3D. The control port is used to access 3D control registers. It is not the same as base port. Usually 120. -dac - Enable patch of non-continuous DAC volume. I'm not sure that this problem will persist in the driver when it is released so the patch must be turned on explicitly. -mv - Enables Master volume support (via IOCTL category 80 API). NOTE1: If your card does not support 3D processing or you don't need it you should not specify the control port. 3D support was tested only on CS4237B and I don't know if it will work with other 3D-enhanced mode 3 chips. NOTE2: If the driver supports 3D processing -c option will be ignored. NOTE3: If neither -c nor -dac option is specified the backend behaves as IOCTL90 backend, just passing the pipe commands to the driver. THE INTERFACE (Advanced info) The interaction between the front end and the back end consists of two stages, first the front end opens the control pipe and writes a text line with command. The backend then processes it and writes a text line with its response. The front end should read it and close the pipe. The command line consists of one or more tokens separated by spaces. The first token is the command number in hex that corresponds to IOCTL 90 functions. The supported commands are: 80 - Get API level. No other data are required. 83 - Get Message buffer. No other data are required. 4x - Set control values. Up to three tokens may follow that contain .VolumeL value in dec, .VolumeR value in dec and .Mute value in hex (see IOCTL 90 API definition for details). If less than 3 tokens follow the command the missing ones are supposed to be 100 100 0. 01 - Set master volume (not present in IOCTL90). Same syntax as fns. 4x but .Mute value is ignored 6x - Get control values. No other data are required. 11 - Query master volume (not present in IOCTL90). No other data are required. The responce consists of one or more tokens as well. The first token is always the command number. The further tokens are: Common tokens: "UNSUPPORTED" - The function is not supported "FAILED" - The function is supported but failed to complete. Command specific tokens: command 80 - API level in dec command 83 - Message buffer contents. commands 4x - "OK" command 01 - "OK" commands 6x - .VolumeL value in dec, .VolumeR value in dec and .Mute value in hex (see IOCTL 90 API definition for details). command 11 - same as fns. 6x but .Mute value is always 0 The total response length must not exceed 2047 characters. CONTROLLING THE MIXER WITH REXX (Advanced info) To send a mixer command from a REXX script you should do the following: Open the control pipe by calling stream() function: stream(pipe,'c','open') Where pipe is a control pipe name. Write the command by calling lineout() function: lineout(pipe,command) Where command is command text. Wait for response by calling charin() function: charin(pipe,,2047) Close the control pipe by callin stream() function: stream(pipe,'c','close') A simple REXX mixer front end PMixCtl.cmd is provided as a REXX example. A more complicated and more useful REXX text mode mixer minimix.cmd written by Franz Bakan is also included. WRITING YOUR OWN MIXER (Advanced info) The suggested mixer demon layout consists of two parts: base and hardware specific. The base part is common for every mixer and does not need to be modified. It is called base.c It receives the control upon the program startup, creates the control pipe, receives and pre-processes the commands and sends the replies. It calls several subroutines from the hardware specific parts. They are defined and explained in PipeMixPvt.h. CONTACT You can send your bug reports and suggestions to e-mail boga@inbox.ru or FIDO 2:5095/9. The lastest version of the mixer can be downloaded from http://www.podolsk.ru/~boga/OS2Programs.html where you can also find a couple of other useful OS/2 programs. IOCTL 90 API and IOCTL 90 API demonstration program were developed by Joe Nord . API definition is available at http://www.pompano.net/~joenord/ioctl90/ minimix.cmd REXX mixer was developed by Franz Bakan HISTORY 0.01 - Initial release. 0.02 - Small improvements in the base code. - Added support for master volume - Fixed disconnecting the pipe before the client read it. - Added minimix.cmd REXX mixer by Franz Bakan 0.03 - Added a new version of minimix.cmd REXX mixer by Franz Bakan - Improvement in the base code (now it handles default values for set functions itself). - Fixed processing multi-line responses in PMixCtl.cmd