
Signal Generation tools for Linux and /dev/dsp                Jim Jackson
----------------------------------------------                  Mar  1997

Release 1.0

What are the programs?

This is a set of tools for imitating a laboratory Signal Generator,
generating audio signals out of Linux's /dev/dsp audio device. There is
support for mono and/or stereo and 8 or 16 bit samples. The basic waveform
sample generation code is in the file generator.c, the functions here can be
added to other programs fairly easily. 

Two of the programs below are front ends for using the generator functions,
mixing the generated outputs and playing them on /dev/dsp. Neither siggen or
sgen control the mixer - use your favorite mixer program or use the simple
mixer 'smix' which I have included here.

soundinfo   A program to display some of the programming capabilities
            of the sound system support for the mixer device /dev/mixer
            and the DSP device /dev/dsp. Can easily be changed if
            the mixer and dsp devices are called something else. Also
            shows some of the ioctl calls in action :-).
            Further info on your kernel's sound card configuration is
            given by 'cat /dev/sndstat'.

sgen        is a command line signal generator where
            details are specified from the command line for generating
            sine, cos, square, triangle, sawtooth, pulse, noise waves.
            Frequency, sample rate, relative amplitude etc can be
            specified thru' command line options. The signal is played 
            continuously until the program is stopped. There are options
            to save the basic raw digital samples raw to file or to a WAVE
	    format file.

siggen      an Ncurses screen based Signal Generator for 2 seperate channels.
            On stereo audio cards the 2 channels are played on seperate 
            outputs. On mono cards the 2 channels are digitally
            mixed onto the one output. Type of waveform, frequency, amplitude,
            sample rate etc are specified/changed via a screen menu.

smix        a simple command line program for getting and setting the mixer
            settings. (gee yet another mixer, yawn).
	    

Compiling and installing

You will need the ncurses library and header files. You will need sound card
support compiled into your kernel.

Check out the Makefile and edit anything that is wrong for your system. The
ncurses library is assumed to be in normal library 'path' and the include
ncurses include file is assumed to be in either /usr/include or
/usr/include/ncurses . If not, edit as appropriate. Just type 'make' to make
the 4 programs, soundinfo, sgen, siggen and smix. 

Warning: you will get some warnings from gcc, from the compilation of
sigscr.c and ncfio.c. Don't worry, they are only warnings, the programs work. 
Don't set -Wall in the makefile, the results will be deeply embarassing to
yours truly :-)

Type 'make sysinstall' to install the programs into /usr/local/bin and the
man pages into /usr/local/man/man1. Type 'make localinstall' to install into
$HOME/bin and $HOME/man/man1. If none of these are ok for you then copy
manually or edit the Makefile. Edit the setting of variable PROGS to
customise which programs you install, e.g. you may not wish to install yet
another mixer program so delete smix from the list.


These programs have been tested on

 Linux 1.3.52, with Voxware Sound Driver 3.5 with a MAD16 based soundcard.
 Linux 2.0.0,  with Voxware Sound Driver 3.5.2 with a Soundblaster 16


Distribution and Copying

Distribution of this package is covered by the terms of the GNU 
General Public License, version 2. See the file COPYING for further details.
These programs are Copyright (c) 1996,1997 Jim Jackson.


Jim Jackson      jj@scs.leeds.ac.uk
School Of Computer Studies
University of Leeds
Leeds
LS2 9JT 
UK
