Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I hear noise in my speakers and headphones after waking up my PC. To fix this, I have to reload ALSA. Is there a way to fix, or at least to reload ALSA automatic after suspend ?

Oh I forgot, I'm running Ubuntu 11.04 and my soundcard is Creative X-Fi ExtremeGamer.

share|improve this question
add comment

1 Answer 1

You could add a script to /etc/pm/sleep.d/ to run things when the computer wakes up. The scripts in this directory run at both sleep and wake so in order to detect which are which, the scripts are passed an argument to say what's going on. In your case, it doesn't really matter, but I'll code for it anyway.

Run gksu gedit /etc/pm/sleep.d/20_restart-alsa and then paste the following into it. You'll want to make edits because I'm not sure how you're restarting the sound system. Just add what works for you.

#!/bin/sh

case "${1}" in
    hibernate|suspend)
        # we don't need to do anything when it's going to sleep       
        ;;
    resume|thaw)
        # this is coming back from sleep/hibernate
        # ** ADD YOUR ALSA-RESTART CODE ON THE NEXT LINE **

        ;;
esac
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.