Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a way (other than rebooting) to clear the lock a program has on a resource if the program abnormally terminates?
From time to time, xine will crap out on me and when it does, it keeps its hold on my sound output device (/dev/dsp). At this point, I cannot re-launch xine or launch any application that uses sound without rebooting (just leaving the GUI and going back in via startx is not enough).
Since xine's crashing seems to be pretty regular unless all you do is watch a DVD with your hands completely off the keyboard and mouse and sit about 8 feet away from the monitor, re-booting is getting to be cumbersome. A quicker way to release all the resources that xine had would be great for me aside from getting xine to stop crashing.
The 'fuser' command is the one which tells you what programs are holding what files. Since in Linux every resource is represented by a file, as you have seen, this should therefore tell you what if anything is holding the sound device. You will probably find /dev/dsp is a symlink, so use ls -l to see where it points, then do eg:
fuser -vu /dev/dsp0
and see what that says - you will get the name and PID of any process holding the file.
If there is no such process, this could be a bug in the kernel where the device is not resetting itsself. RedHat 9 uses the old OSS drivers by default, so you may want to experiment with ALSA.
Xine may still have processes running in the background. You could enter 'killall -9 xine' to kill these processes. This works for me after Civilization bombs on me occassionally. I use 'killall -9 civctp' and the sound returns.
Thanks avarus and jschiwal for the useful suggestions.
I'll try them both. I've been thinking about experimenting with ALSA, so maybe this woudl be a good reason to try. It's just that now that I have everything pretty much working and fairly stable, I hate to mess it all up - but I will anyway.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.