Sound card in use?

der.hans plug-discuss@lists.plug.phoenix.az.us
Fri, 19 Apr 2002 12:54:00 -0700 (MST)


Am 19. Apr, 2002 schwätzte George Toft so:

> How can I tell if an application is using the sound card?  I'm writing
> a script that needs to play a sound, but only if the sound card is not
> currently being used.  What I'm doing right now is:
>
> 	IN_USE=`lsof | grep dsp`
>
> Which works, but I know lsof can impose a performance hit.  Any ideas?

fuser /dev/dsp

You could then walk those proc numbers to see if it's esd or the sound
daemon that KDE is using and try to connect to that daemon.

ciao,

der.hans
-- 
#  https://www.LuftHans.com/
#  Don't step in front of speeding cars, don't eat explosives
#  and don't use m$ LookOut :). - der.hans