Ok, this is a sticky subject. The short answer: not easily.
The long answer:
1. All sounds being sent to your sound card are sent to /dev/dsp or similar, only one at a time is allowed to access this device.
2. If you want multiple programs to access this device you need to send them through mixing software ("arts" for kde, "esd" for gnome are two standard mixers). To do this you need to run the program with special parameters before the actual comand; read the arts or esd documentation for more info.
3.Here is some info I found a long time ago, it didn't work for me at the time probably because my sound card couldn't do it; try it anyway:
1. Are you using alsa ?
First thing to do is check if you are running alsa at all. Try "lsmod | grep snd" in a terminal as root, if you get some lines of output, you are using alsa, if you dont get anything, you are not.
2. Any sound demons running ?
Now we check if /dev/dsp is being used by any evil sound-demon (like arts or that gnome sound thingy (esd) :] ). For this you need the programme "lsof", if you dont have it installed you can get it from your distribution cd's. Now issue "lsof | grep dsp" (while not running anything that plays sound, like mp3 players, teamspeak, games etc.). This will list all aplications using the sound, idealy you shouldn't get any ouput (go to 4.) else we need to get rid of that demon.
3. Getting rid of the sound demon
If you got output in (2) then you most probably have arts running (if you are using kde) If something else is listed as programme name (first column) you have to get rid of that. (like esd)
a) disabling arts: Go to the KDE control center, hit search and type "artsd" this should find a hit "Sound-System". In the dialogue you deselect start arts at kde startup. Then you restart kde and check if arts is still running (2). It should be gone.
b) disabling other demons: You can always resort to killing the processes ("killall thedemon", but the better way is to find where you can set it to not start it.
4. Finding the process name of your game
For the following steps we need to know what the process is called that runs the game. To find out, you can start your game and switch to a ttySx [press Ctrl+Alt+F2 for example], then type "top", and you should see the name somewhere high up (as your game should use lots of CPU ) ). For quake3 the name is "quake3.x86".
5. Telling alsa your game only needs playback, no recording etc.
Now, to enable your game to play sound you have to tell alsa that your game will not need to record sound or anything - else alsa will refuse to give your game the capability to play sounds, since TeamSpeak already has the rights to record, and no two programme should be able to. Issue these commands as root:
echo "quake3.x86 0 0 direct" > /proc/asound/card0/pcm0p/oss
echo "quake3.x86 0 0 disable" > /proc/asound/card0/pcm0c/oss
(substite "quake3.x86" with the name you found for your specific game in (4)). Now you should be able to play your game with sounds while using TS.
6. Making the changes permanent (over reboot)
Since the /proc filesystem is not permanent [nothing gets saved if you reboot] you have to issue the commands in (5) every time you rebooted and want to game with TS. The sollution is to put those commands in a startup script, which will issue them automagicly at boot-up time. For SuSE its /etc/init.d/boot.local, for gentoo try /etc/conf.d/local.start. Just add those commands somewhere at the bottom of those files.
|