37

I just upgraded to 18.04, and I noticed that the sound from my headphones, whether plugged into front or back port, was very crackling and slow/delayed. This issue didn't exist on 17.04/10. It also doesn't affect audio coming from HDMI via Radeon 560 GPU, just the headphone/onboard audio. The relevant device is:

00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)  

I tried a bunch of fixes for pulseaudio I found googling, including this one and this one. Neither of which helped.

I have found something that at least makes it listenable - changing "default-fragment-size-msec" from 25 to 5 in /etc/pulse/daemon.conf. It makes it much much better, but still a little crackly from time to time.

I've googled for 30 min or more now, and not finding anything else that seems recent and relevant, so wondering if I should maybe open a bug, or if there's something I'm overlooking here.

Pablo Bianchi
  • 15,657
jwinterm
  • 481

6 Answers6

53

I had the same problem. It seems related to speech-dispatcher (some text-to-speech utility).
try :

killall speech-dispatcher

If the sound comes back to normal you can remove it completely (if you don't need it) with :

sudo apt-get remove speech-dispatcher
Bithur
  • 631
32

I had the same issue and killing pulseaudio fixed it for me. I'm not sure why it would get into a bad state, but restarting pulseaudio might be something to try.

Try

killall pulseaudio
Pablo Bianchi
  • 15,657
Tommy
  • 321
  • This is some dark magic. Any idea on what's actually going on? (this works though, I think may be connected to suspend-awake process) – jave.web Jan 07 '21 at 16:55
  • After upgrade to 22.04, I had the sound cracking randomly. This answer help me fix the issue. – r0ng Apr 28 '22 at 04:53
26

Press Ctrl+Alt+T to go to a terminal and use your favourite editor to edit the file

nano /etc/pulse/default.pa

then find a line containing:

load-module module-udev-detect

modify this to become:

load-module module-udev-detect tsched=0

save and exit. Restart your computer or run:

pulseaudio -k

and you're all set!

H360
  • 369
  • 4
    you need to restart your laptop or run: pulseaudio -k after you change the configuration. – stason Nov 16 '18 at 03:05
  • all it does is makes the sound completely distorted – Display Name Nov 16 '18 at 13:12
  • 2
    This is the solution and it should be the accepted answer -- although it would be good to edit it and add the pulseaudio -k command – Merc Feb 15 '19 at 08:59
  • 5
    An explanation about what exactly this does would be helpful.

    It can be found at this Ask Ubuntu question

    – polynomial_donut Jun 04 '19 at 19:09
  • actually, on a newer ubuntu version this actually works. – Display Name Nov 01 '19 at 11:33
  • Note that my XPS laptop, tsched=1 is the solution for the internal audio chipset, but I checked too that with some USB audio sound cards, tsched=0 is better. So don't forget to test both, depending on your audio chipset. – ttoine Jan 07 '20 at 16:34
  • This actually fixed Android Emulator freezing up my laptop while using Spotify. Whenever two programs where trying to access the soundcard, the audio would began to crackle, delay and sound like with static. Then, while Android Studio would sync the app with the Emulator while another program was using the audio, the audio would hiccup and everything would begin to slow down until halt. Writing this comment for another poor soul that can't build/test his app due unknown reasons. – Sdlion Feb 03 '21 at 01:01
  • This helped me thank you – Gloat Mar 19 '21 at 04:00
3

I ran into the same issue (crackling sound) today on Ubuntu 18.10 on my Intel NUC Canyon Hades.

killall pulseaudio

only fixed it temporarily for some reason. After a few minutes the problem was back again.

What ultimately did the trick was the answer posted by Fabby in combination with the comment by statson to enter

pulseaudio -k
Claire
  • 148
  • 6
  • I think when you kill PulseAudio, the OS falls back to ALSA. Most likely your PulseAudio has some configuration issues. – user31389 Dec 15 '19 at 14:17
0

No matter what I did, I didn't get it to work with Pulseaudio (I'm using a Focusrite Scarlett USB Audio Interface)

I followed the steps from this link and use PipeWire - instantly everything works like a charm!

https://linuxconfig.org/how-to-install-pipewire-on-ubuntu-linux

-3

If you have Firefox or Chrome open when the sound starts distorting. Shut them browsers down and test the sound again. If it has stopped, then you need to use a different web browser. I installed Vivaldi yesterday and I haven't had a problem since. There are many browsers to choose from.

  • Or... Go to about:config in Firefox and search for "media.webspeech.synth.enabled" and set it to "false" (double clicking on the entry should do it) then close Firefox. Open it again and see if that makes audio better. For me it did. – mevdschee Jun 21 '21 at 01:40