MMapDSP - memory-mapped DSP-device emulator Copyright (C) 2004 Felix Kuehling
What is it?
MMapDSP is a small tool that emulates a memory mapped DSP (audio) device on top of an audio device that does not support memory mapping.
Memory mapping is an optional feature according to OSS documentation but unfortunately a number of programs, particularly games, rely on it anyway. This causes lots of grief, especially with some on-board sound cards. Originally I wrote this little tool two years ago when I tried to play quakeforge with such an on-board sound device. Now I have a notebook with the same problem, so I dug up the old sources and polished them up a little for distribution. It should work with Linux on i386-compatible systems with OSS sound drivers or ALSA OSS emulation.
Enjoy ...
Felix
How to compile and install
Unpack the tar.gz archive and enter the MMapDDSP directory. Then type make and make install:
tar -xzf mmapdsp-<version>.tar.gz
cd mmapdsp-<version>
make
make install # you need to be root to install
MMapDSP will be installed to /usr/local/bin.
Usage
Very simple. Prefix your application's command line with "mmapdsp" and that's it. Example:
mmapdsp nq-glx -width 800 -height 600
Unfortunetely this doesn't work if the command (nq-glx in the example) is only a shell script that starts the real application. The reason is that MMapDSP can't keep track of forked child processes. In that case you'll have to make a copy of that script and modify it so that the line which starts the application binary is prefixed with mmapdsp. Future versions may track forks of new processes automatically.
There are two command line options that allow you to specify the real sound device that MMapDSP should use ("-d") and the device that MMapDSP is emulating ("-e"). Both may be the same. The default is "/dev/dsp" for both. "--" stops option processing. Everything that follows will be the command line of the child program. Example:
mmapdsp -d /dev/dsp1 -e /dev/dsp2 -- nq-glx -width 800 -height 600
would tell MMapDSP to emulate a sound device /dev/dsp2 and map all operations on that device to the real sound device /dev/dsp1. Of course you'd also have to tell nq-glx to use /dev/dsp2.
Missing features
Fork tracking (see above) is the most important one. Furthermore the implementation could be improved and optimized in a few places.
It could use real shared memory between parent and child process, using POSIX shared memory. Now data is copied to/from the child process word by word via ptrace calls.
Audio data from shared memory could be sent to the real sound device in a separate thread. Right now this is triggered by system calls from the child process. Submitting audio data in a separate thread could reduce latency.
License
MMapDSP is licensed under the GPL. It comes with ABSOLUTELY NO WARRANTY. See COPYING for details.
