[dundee] problems
Andrew Clayton
dundee at lists.lug.org.uk
Fri Feb 7 14:53:00 2003
On Fri, 2003-02-07 at 12:32, Keir Lawson wrote:
> typing grep /dev/dsp simply freezes the console(i pressed control z to abort). i have managed to recreated the circumstances where my sound worked in games: i loaded up xmms (oss sound plugin) and played an ogg. there was no sound out of the speakers but the visulizations still worked as if their was sound. whilst the ogg was still "playing" i opened up tuxracer and the sound worked perfectly! however after closing down xmms and restarting tux racer the sound stopped working again. the case was the same for frozen bubble. as for the poweroff command the computer still restarted. im prety shure its not and os problem but either a bios or hard ware problem.
>
> thanks
>
> from keir
OK. A little info on how sound operates under Linux. Maybe this will
make things a little clearer....
Your sound card(s) are accessible through a number of device files under
/dev
/dev/dsp being the principle one. So when a program wants to output
sound, it opens up /dev/dsp. Some cards have multiple channels so a
program or programs can open /dev/dsp multiple times. However when you
run out of channels /dev/dsp will no longer be available to use. To
overcome this multiple programs needing access to /dev/dsp, the idea of
the sound server/daemon was introduced.
These sound servers open the sound device as normal, but then they
handle the multiple programs talking to /dev/dsp though them. This of
course needs to be supported in programs.
So what you have is. e.g esd opens /dev/dsp. Then xmms talks to esd,
your game talks to esd, gaim to esd. Esd basically multiplexes (right
term?) the sound device. aRts is the other main sound server in use
today (KDE), esd (Gnome).
What you'll often find is that when using e.g esd with xmms, you will
still be able to open /dev/dsp directly at least once. This is how the
workaround for the flash plugin hanging up the browser problem works.
I'm guessing your games want to use OSS (the current kernel sound api,
being replaced/favoured by ALSA in 2.5) and open /dev/dsp directly. The
best way to do this, as the other guy said, is to make sure that nothing
has /dev/dsp open. If it does, stop/kill it. If you can log into a
failsafe (usually just X + an xterm) X session. Then you shouldn't have
anything like esd or arts running. Then try your game. Also doing a
$ strace <program> may shed light on any problems. Look for references
to opening /dev/dsp
HTH
Andrew