how to know who use the sound device
Hello,
I develop a small application that has to know in a specific time, whether someone writes to the /dev/dsp or in other words, emits sounds. Now, contrary to windows, in linux there is no restriction for wrting at the same time to the same file, namely, you can have a file opened with two different applications for write purposes. The question is how can I track it, at least to know if there is an application which uses the sound card. If I run cat /dev/dsp - it doesn't show anything though I easily produce sound with echo "something" > /dev/dsp (I tried get the same effect as with cat /dev/mouse - where every movement of the mouse, prints jibbrish). Any Ideas? |
If an application has a file open it will show in the output of the lsof command. My Alsa audio device is /dev/snd/pcmC0D0p so if I want to check if an application is using it I can type lsof /dev/snd/pcmC0D0p, and lo and behold:
Code:
root@royne:~# lsof /dev/snd/pcmC0D0p Håkan |
All times are GMT -5. The time now is 03:19 AM. |