What's A Good Way To Handle Multiple /dev/dsp's?
kronoman asks: "I've got a multiple-soundcard setup (three cards, four DSP devices) under Mandrake 7.0. Currently, I have an Ensoniq ES1371 on /dev/dsp0 and /dev/dsp1, an SB AWE64 on /dev/dsp2 and an AU8830 on /dev/dsp3. I'm already using ESD to send all ESD sound (especially xmms/mpg123) to /dev/dsp3, and timidity and kmidi use /dev/dsp1. I want to use /dev/dsp2 for emulator output and /dev/dsp for system sound and programs not smart enough to be able to put sound anywhere else. Unfortunately, most of my emus only want to output to /dev/dsp (in particular, UAE, Bochs, Snes9x). Is there a way to either A) get those emus to send output to /dev/dsp2 or B) get kaudioserver/kwmsound to output on a different DSP device (can't seem to find it in the docs, don't know enough C/C++ to find it in the source without some clue what to look for)"
I have not tried this, so I could just be blowing smoke here, but how about running the emulaters in a chroot'd enviro?
I have a similar problem with CD-ROMs. Far too many apps use /dev/cdrom, and assume it'll be pointing to the right place. I have both a CD-ROM and a CD-RW in my machine, and obviously can't have /dev/cdrom pointing to both...
"The invisible and the non-existent look very much alike." -- Delos B. McKown
There is an easy answer although it may not be the cleanest/most scalable method. Just edit the source, change the references to /dev/dsp to /dev/dsp2 etc and recompile. Anyone got any comments on this?
You can tell esd to use a specific device with the -d parameter, and you can tell it to use TCP and bind a different port by using the -tcp and -port options.
/dev/dsp0 -tcp -port 12345 /dev/dsp1 -tcp -port 12346 /dev/dsp2 -tcp -port 12347
/dev/dsp can be launched with the esddsp script, which will cause them to use EsounD for their audio output, ie:
/dev/dsp2 (try viewing a shockwave thing with audio, or something).
/dev/dsp is the proper device to open, and send the patch back to the author/maintainer of the software:)
So, you can set up multiple EsounD instances by doing something like:
esd -d
esd -d
esd -d
Any programs that have built-in support for EsounD (ie: anything GNOME) can be told to use a specific host:port for audio output.
What's more: a lot of programs that just try to open
esddsp --server=localhost:12347 netscape
Given a build of Netscape that's dynamically linked against the same C library you build your local copy of EsounD (unless you're running an a.out build, it probably is;) with, netscape's audio will acutally come out on
Of course, with free software, the proper thing to do would be to patch the source so that it doesn't just assume that
-rozzin.
This isn't really an answer to the question, but please bear with me... there are good reasons to run multiple soundcards simultaneously (for instance, recording each player in your band through a separate channel), but this doesn't sound like one of them. Instead, the standard approach is to mix the output of the three programs together in software, and send it to the speakers through a single card. This is exactly what ESD and the like were created to do.
But my grandest creation, as history will tell,
But my grandest creation, as history will tell,
Was Firefrorefiddle, the Fiend of the Fell.
I just made a patch for UAE 0.7.6 that adds a -e option that allows you to specify the device used for sound output. Download it here. To apply it simply go into your UAE source directory and type patch -p0 < patchfile where patchfile is the patch you want to apply.
I hope this helps.
That'll be a few minutes work to fix... I'm off to write some patches for UAE, Bochs and Snes9x!
The most recent version of Bochs supports different sound output devices. Look at the default .bochsrc configuration file and search for /dev/dsp and you'll find the line you need to change.
Posted by 11223:
If you're using the commercial Open Sound System, there is a program that comes with your distrobution that allows you to run another program on a different dsp. I don't know the name (don't use OSS myself), but check your documentation.
Perhaps we should recommend this for all app writers under linux?
--