Alternate Sound Driver for Linux 2.x Version 1.3 ================================================ Copyright (C) 1993-1997 Michael Beck This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. INSTALLATION ============ Install the linux kernel sources (normally under /usr/src). Install the PCSP sources in the same directory, ie # cd /usr/src # tar xfz pcsndrv-x.x.tgz Apply the patch by: # patch -p0 fixed, should now compile on glibc2 (RH5) - Linux 2.1.99+ support - fixed the 'lost volume settings after module remove' bug - RealAudio Player 5.0 should now work, thanks to J.Chandra Changes from 1.1 ================ - Linux 2.1.43+ support Changes from 1.0 ================ - Real Audio Player should now work, thanks to Bernd Paysan - PCSP settings are now save in the kernel part, so you can use PCSP with the kernel daemon without reconfiguring Changes from 0.9b ================= - better fragment support - patchfiles for 2.0 (hopefully no more mails :-) with full configuration support - improved utils - started with win3.x VxD (just for fun :-) Changes from 0.9 and 0.9a ========================= - module support - some stupid bugs fixed - ready for 1.3.x and ELF Changes from 0.8a ================= - new major number 13 to solve the conflict with iBCS2 - ready for Linux 1.2.x Changes from 0.7 ================ - added support for the joystick driver, apply the joystick-0.7.diff - added 16 bit support (mostly for DOOM :-) - added some IOCTL's for more compatibility with VoxWare 3.0 - increased buffer size for smoother playing - some changes for fast 486's, so the STO1 works Changes from 0.6 ================ - removed the ulaw-bug and added some more ulaw support, /dev/pcaudio is now as fast as /dev/pcsp - added a check_region() - improved pcspinstall script - man pages for the utilities Changes from 0.5 ================ - automatic speed detection! - speeded up by using a special interrupt delivery (the promised "other way"), this include some more patches - support for adjtimex(), but not tested - can be switched off and configured by commandline (pcsp=off), not very useful but now possible - driver is switched off if both buffers are empty, this short extremly the time of a "gap", not perfect but useful, thanks to Alistar MacDonald - removed useless 'INTERVAL MODE' - utility enhancement; pcsel -v now updates the mixer values if /dev/mixer is installed - removed some little bugs and include some panic() calls if something goes wrong with the timer-int, hopefully panic never occurs - acts more like /dev/dsp Changes from 0.4 ================ - the PC-Speaker samplerate can be changed in 'Fixed Mode' or can be selected in the intervall from ??? - 18356, for higher or lower rates the old oversampling method is used - the driver now stop the output if both buffers are empty, this reduces the gaps and speed things up if programs open the driver permanently - a small bugfix in the SYNC-ioctl and some warnings removed - bugfix for exclude /dev/mixer support Changes from 0.3 ================ - the (real) samplerate for PC-Speaker is now 18356 Hz; I only eleminated the twofold oversampling which was stupid - Volume-Control for PC-Speaker: Using another way of playing thru PC-Speaker, samples are much louder (like players under DOS), so this feature was usefull (for me) - dev/pcmixer support: Only the Master-Volume is supported, nonetheless it works in the expected way for Stereo-devices, Mono-devices use the left volume, PC-Speaker uses the mean of left and right - vplay now has the option -o device, and some bugfixes were done - pcsel bugfix, and support for volume control if /dev/pcmixer is disabled (in that case you can only change the volume of PC-Speaker) Changes from 0.2a ================= - Support Mark J. Cox Stereo-on-One DAC which plays Stereo, uses only one lp-port, can be autodetected and produce better quality than my SB 1.0 (really if no heavy diskacces :-( - Support simple DACs on one or two lp-ports (this allows Stereo) - Support version 2 /dev/dsp ioctl's (use #ifdef SOUND_VERSION to determine the version. This is choosen for compability with version 2 of the sounddriver, look in the vplay code for a (bad) example) or use the new format in the hope it will not be changed in the future - the pcsp.h file is now located in like soundcard.h - Restoring the timer 2 mode to square-wave generator after device release (this is needed for dosemu) - interrupt starts after first data was written / stopped after a SNDCTL_DSP_RESET - Some speed enhancement by optimizing the interrupt-routine (after I looked up the assembler-output I think it would be hard to get it significantly better). It runs better on faster machines :-(. Sorry, but it's a a cyclehog. Installation ============ Install the archive and read linux/drivers/pcsnd/README! To install the utilities, run make in the pcsnd-kit subdirectory. Utilities ========= This package should work with most utilities written for Hannu Savolainen's sounddriver using /dev/dsp or /dev/audio (tested with Doom, str, mixer, xmix, xvmixer, someone wrote me it works with xboing, a game which support -sound option). Simply get them! If your output-device is the PC-Speaker, you should set the default values to mono, 8 bit and up to 18356 Hz for best performance because the driver convert any other settings internally to this ones. DACs may be set to Stereo and they support real samplerates up to the measured maximum samplerate (or 44100 Hz on a 'really hot' machine). The pcsel program which allows configuring the /dev/pcsp by setting output-device, Stereo, samplespeed, real samplerate, volume and lp-port. The vplay-program to play CREATIVE LABS Voice files, Microsoft WAVE files and raw data files is included. Try: cat enterpri.raw >/dev/null (load it in the cache for best performance !!!) vplay -s 9321 enterpri.raw to check the driver (output should be different from white noise :-). Read the README in the pcsnd-kit directory. Using the driver ================ All programs using this driver should include . If you don't have the soundcard-driver the file is created by the pcspinstall script and consists of the line: #include So include if you want write programs which work with both drivers (because they use the same ioctl, your program will run on "right" soundcards. If you use /dev/dsp and install the symbolic links, this method is prefered). The devices are opened exclusively. When another program tries to open the driver returns EBUSY. Not more than one of the devices can be open at the same time (except /dev/pcmixer, you can only open one mixer, because I could not imagine about using more, write me if you need more mixers). Note that if your output-device is PC-Speaker : 1.) While a program have opened /dev/pc*, your console cannot 'beep' (the 'resource' is busy). 2.) Some programs running with root permissions may stop the output if they reprogram timer 2 (dosemu with speaker = native currently don't and other I don't know [auplay of course] :-). Audio output ============ The /dev/pcsp can be used in digitized voice applications. This device can be accessed with programs like cat or dd. The default speed is 8000 Hz and can be changed by SNDCTL_DSP_SPEED ioctl() -call. For example: samplespeed = 11025; ioctl(fd, SNDCTL_DSP_SPEED, &samplespeed); sets the sample speed to 11025 Hz The device driver has 2 buffers for audio output. When a program makes a write to the device, all bytes will be copied to a buffer and played in the timer-interrupt. While the first buffer is being played, the process may write to the other buffers. If no buffer is free, process has to wait. For optimal performance, you should write full blocks to the device. Writing too short blocks can result in a silence gap. Too long writes will cause unnecessary process switches. The size of a block can be obtained with a SNDCTL_DSP_GETBLKSIZE. For example: ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blksize). (if you have the "real" /dev/dsp, it's the same procedure, write me if you find incompatibilities) The HARDWARE ============ Please read Mark J. Cox' file HARDWARE.DOC which is included with his kindly permissions if you want to know how simple you can built DACs and the famous Stereo-on-One device! (Oh, it's a DOS-file for those who have problems looking at it with vi, simply try vim :-) Where to get a newer version ============================ If this driver isn't part of the standard kernel (and it seems it would never be :-) look at ftp.informatik.hu-berlin.de:/pub/os/linux/hu-sound/pcsnd* and maybe at ftp.dresearch.de:/pub/linux/pcsnd which is my home site for the latest version. If you have any ideas, please contact me. Credits ======= Because many people sends patches to me (and mostly I've forgotten their names) here a little (incomplete) list: Regis Duchesne Alistar MacDonald Chris Metcalf Harald Milz Martin Kraemer Bernd Paysan Hans Erik Martino Hansen Contact address Michael Beck beck@dresearch.de