Chris wrote:

> How do I check if a program is hogging /dev/dsp? Aside from just checking
> if xmms plays or not.

Humm, good question.  I just tried this:

      ls -l /proc/*/fd | egrep 'dsp|fd:'

It lists all running processes but also lists the ones that have /dev/dsp open:

...
/proc/26014/fd:
/proc/26019/fd:
/proc/26039/fd:
/proc/26040/fd:
/proc/26050/fd:
l-wx------    1 duanev   duanev         64 Jan 10 13:53 10 -> /dev/dsp
/proc/26051/fd:
l-wx------    1 duanev   duanev         64 Jan 10 13:53 10 -> /dev/dsp
...

Pids 26050 and 26051 both have the device open.  From here
a 'ps' listing will match the pid to the application name/cmdline.


# ps ax | grep 260
...
26013 pts/2    S      0:00 java_vm
26014 pts/2    S      0:00 java_vm
26019 pts/2    S      0:00 /usr/local/netscape/mozilla-bin
26039 pts/2    S      0:00 /usr/local/netscape/mozilla-bin
26040 pts/2    S      0:00 /usr/local/netscape/mozilla-bin
26050 pts/1    S      0:00 xmms
26051 pts/1    S      0:00 xmms
...


duane


Reply via email to