Ubuntu 12.04 (Precise Pangolin) – Clicking sound from speakers

With a recent kernel update (to linux-image-3.2.0.26), I suddenly found my speakers clicking almost every second.  It was a small clicking noise, but a big annoyance.

In a Google search, I found several answers to this problem, all pointing to the power save option of the snd-hda-intel driver.

The proposed solution was to comment out the line “power_save=10″ in the file /etc/modprobe.d/alsa-base.conf.  However, this did nothing for me, running Ubuntu 12.04 (Precise Pangolin) as the alsa-base.conf file did not have any lines dealing with power_save, so there was nothing to comment out.

I found the solution for 12.04 in another file.

gksu gedit /usr/lib/pm-utils/power.d/intel-audio-powersave

Find the line:

INTEL_AUDIO_POWERSAVE=${INTEL_AUDIO_POWERSAVE:-true}

Comment it out (using #) and add the line:

INTEL_AUDIO_POWERSAVE=false

Reboot and the clicking should be gone.

UPDATE 1… As pointed out in the comments, the above solution may not work for everyone.  The following is specific to those w/ Intel HDA sound cards.
You can use the following to turn off power_save on your sound card:

sudo echo 0 > /sys/module/snd_hda_intel/parameters/power_save
sudo echo N > /sys/module/snd_hda_intel/parameters/power_save_controller

UPDATE 2… As reported in the comments by Ariel, this change can be made permanent by removing write permissions on these files. I have not tested this myself to confirm.

sudo chmod 550 /sys/module/snd_hda_intel/parameters/power_save
sudo chmod 550 /sys/module/snd_hda_intel/parameters/power_save_controller

The content below is the originally posted solution ….


You’ll have to type this in every time you reboot.

 

To avoid typing this in every time, you could try the follow (see warning at the bottom):

Create a file to store the script:

sudo gedit stopClicking.sh

Add the following text to this file:

#!/bin/bash echo "yourPassword" | sudo -S echo 0 > /sys/module/snd_hda_intel/parameters/power_save echo "yourPassword" | sudo -S echo N > /sys/module/snd_hda_intel/parameters/power_save_controller

Now go to your Dash (press the Windows / Super key) and search for Startup Applications.  Click Add and give the path to your script.

/path/to/stopClicking.sh

 

Now, make sure your script is executable.

chmod 700 stopClicking.sh

WARNING:  Unfortunately, this solution requires you to save your password in plain text in the script.   Because of that alone, I recommend that you do not use this method.  But, if you are a risk taker and you REALLY hate that clicking noise, this might be the route for you.

Let me know in the comments if you have success or troubles with this.

This entry was posted in Computers and Technology, Ubuntu. Bookmark the permalink.

19 Responses to Ubuntu 12.04 (Precise Pangolin) – Clicking sound from speakers

  1. Ross Fleming says:

    Thanks a lot mate!

  2. The Fox says:

    No problem, Ross. Glad it helped you out.

  3. Claudio says:

    Thanks, this almost works perfectly. However when I start Google Chrome the clicking sound starts again. I don’t know why, but found a (temporary) solution [1] and since your post is the first useful hit on Google I thought I share it here if it’s ok.

    In your terminal:
    sudo su
    echo 0 > /sys/module/snd_hda_intel/parameters/power_save

    You have to type it in again after a restart.

    [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/381201?comments=all
    Comment #71

  4. The Fox says:

    Sorry to hear it didn’t work for you. Thanks for providing the additional tip. I’ll take a look at it and add it to the main page if necessary.

  5. Alex says:

    thanks for pointing this out. You could also set a cronjob as root to do this every x minutes (excessive) but you wouldn’t need to leave your password as plaintext.

  6. SmallWorld says:

    I had the same problem on a HP dv6. After booting or unsuspending my computer while on battery power, the speakers would make a regular clicking / popping / cracking sound. I noticed after reading other postings that this only occured when I was running Chrome and left certain websites such as GMail running.

    Rather than mess Ubuntu’s speaker settings, I followed the solution at http://ubuntu-with-wubi.blogspot.com/2012/07/weird-clicking-noise-in-chrome.html which is to disable the PepperFlash plugin in Chrome.

    After disabling the PepperFlash plugin Chrome is still able to view Flash-powered pages just fine.

  7. Mikhail says:

    Thanks a lot! It worked and now I’m quite satisfied with silence :)
    Gear: Asus P81IJ running XUbuntu 12.04.

  8. Andrés says:

    That worked like a charm, thanks!

  9. Ariel says:

    i found a different, permanent workaround a lot simpler. type “echo 0 > /sys/module/snd_hda_intel/parameters/power_save” in terminal. then change the permission to read only for all and you will never have this problem again.

  10. The Fox says:

    Thanks, Ariel. I have updated the main page to reflect this option.

  11. jifu says:

    Big thanks, works with Asus x73e as well. I was already worried for my hard drive, until I realised that the noise only appears when I used Chrome, there was no other sound coming out (no clicking when playing videos) and I was on battery power.

  12. Tuukka says:

    If pm-utils is the reason for the clicking sound then wouldn’t it be better to just add configuration disabling the powersave. So just add file with “INTEL_AUDIO_POWERSAVE=false” in /etc/pm/config.d/. Somebody correct me if the syntax is wrong. For some services configuration filenames need to end in ‘.conf’ but I don’t know if that is the case for pm-utils.

  13. Luis Ardila says:

    Thanks a lot, works perfect the first solution using 12.04, don’t forget to restart!

  14. Daniel Doron says:

    Thanks, seems to work.

  15. mahyar says:

    Hi

    I tried to solve a similar problem but ubuntu 12 does not give the permission
    this is what i got:
    bash: /sys/module/snd_hda_intel/parameters/power_save: Permission denied

    thanks for help

  16. Allen says:

    WOW, I’ve been trying to solve this all evening! I eventually figured out that it was snd_hda_intel’s power_save being funny, but for the love of god can’t get the parameter to stay 0.

    pm_utils is indeed the culprit. How did you manage to find that?

    I’ve tried the methods you outlined in Update 1 and Update 2. Neither works for me because of either Permission Denied, or Failure to Sync.

  17. Pingback: Constant Crackling/Popping Sound on Ubuntu 13.10 | Ubuntu InfoUbuntu Info

  18. Clint says:

    I did some troubleshooting and found that if I turned off the wireless ethernet card the clicking sounds stopped. The speakers I had been using were cheap USB-powered units from Staples. I suspect that either the speaker wires were picking up the radiated wifi transmissions and translating them into clicking sounds, or it was conducted noise was coming over the USB power wire. I changed the speakers to a different, higher quality set, powered from a wall-wort, and problem solved. Darnit, as a hardware engineer, I (once again) can’t blame the software on this one. Long Live Linux! :-)

  19. Pingback: Fix annoying high-pitched sound | The Linux Experiment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>