[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to get sound back?



Hugh Lawson wrote:
Marc Shapiro <mshapiro_42@yahoo.com> writes:

My system occasionally loses sound.  In my case, it is invariably a
runaway firefox process that was trying to play flash and something
went wrong.  I find the offending process (this is normally an extra
process, separate from any currently active firefox process) and kill
it and that will generally bring sound back without any more drastic
actions.


That could have been the problem.
Would you mind explaining a little more how you isolate the offending
process?  Or post a reference URL that covers this issue?

Since, in my case, it is almost alway Firefox that has caused the problem, I run the following script. All it does is parse the output of 'ps' and lists all Firefox processes that it finds. Usually there should be three: one each for myself, my wife and my daughter. Anything beyond that is suspect. If you should only have a single instance of Firefox then shut it down and run this script. If it finds anything then it probably needs to be killed. I also use this script to find which of the three Firefox processes is hogging all of the memory, or CPU time when the system grinds to a standstill.


#!/usr/bin/perl

&check_ps;

exit();

# Subroutines #

sub check_ps {
        @message=`ps -eo pid,uid,%cpu,%mem,comm`;
        $message_text='';

        foreach (@message) {
                ($pid, $uid, $cpu, $mem, $comm) = split(' ', $_, 5);
                chomp $comm;
                if ($uid >= 1000) {
                        if ($comm eq 'firefox-bin') {
                                print $_;
                        }
                }

        }

}


--
Marc Shapiro
mshapiro_42@yahoo.com



Reply to: