Annoying click/popping sound on Ubuntu 20.04

After installing Ubuntu 20.04 on my desktop computer (Realtek onboard sound card, codec ALC887), I am experiencing a very annoying click (popping sound) every time I open any content with audio.


Solution 1:

It was happening because Ubuntu turned on the sound card power-saving capabilities. Turning it off can be the only way to get rid of the annoying sound:

  1. Verify how is your sound card's power_save parameter:

    cat /sys/module/snd_hda_intel/parameters/power_save
    
  2. If it returns 1, do the following to change it temporally:

    echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save
    
  3. If the previous step worked for you, persist that configuration (otherwise the problem will continue after reboot):

    echo "options snd_hda_intel power_save=0" | sudo tee -a /etc/modprobe.d/audio_disable_powersave.conf
    
  4. (Optional) You can also do the same for power_save_controller parameter following the steps 1, 2 and 3 replacing power_save by power_save_controller also changing 0 to N.

    Note: using the first step will probably return Y for this parameter, instead of 1.

Solution 2:

You can suspend power saving via PulseAudio instead of via the sound card and comment out the following line in /etc/pulse/default.pa to look like this:

### Automatically suspend sinks/sources that become idle for too long
#load-module module-suspend-on-idle

Then restart PulseAudio:

systemctl restart --user pulseaudio

If that doesn't work then just kill it and it will restart:

pulseaudio --kill