Problem with audio (stuttering/choppy) in every single distribution I’ve used

alsaaudiopulseaudio

VIDEO = https://www.youtube.com/watch?v=Hy-yntM2qvk&feature=youtu.be

Basically the audio (not matter what application) flickers and stutters. I have a video with the KDE desktop (because it has more information than the GNOME desktop in 19.10), that shows strange behavior in the audio settings, alsamixer and pavucontrol. I've tried a lot of solutions, but never occurred to me that I could get help if I showed directly the problem.

I didn't have any problems with older distributions, the only thing that happened was that in any sound settings, the sound icon or volume would flicker visually, but never affected practically. Now, every distro has flickery settings and the audio is choppy and stutters. And I've realized that if in those older (or stable) distributions I connected and HDMI monitor, the problem appears. I can't imagine what would happen if I tried a distribution with the problem and then connected and HDMI monitor. Maybe I would hear just crackling.

This issue renders the audio unusable, at least with hardware connected to jacks, because blutetooth works fine.

Apparently, it has something to do with something called S/PDIF, because it turns on and off while the audio cracks. Also, Pavucontrol frequently says "Establishing connection to pulseaudio" while this happens. With KDE, there is a constant message of changing devices, that says "Built-in-Audio" (has seen in the video).

[?] = Is unknown is the distro has that problem

[A] = The distro always has that problem. The audio config always flickers and the sound always stutters

[H] = The distro has that problem, but only when an HDMI monitor is connected. The audio doesn't stutter but the configuration flickers.
Distros

Ubuntu 19.04 = [?]

Manjaro (early 2019) = [?]

Linux Mint 19.2 = [H]

Arco Linux (late 2019) = [A]

Elementary OS = [?]

Arch Linux (late 2019) = [?]

Zorin OS 15 = [H]

Linux Mint 19.3 = [H]

Manjaro (late 2019) = [A]

Ubuntu 19.10 = [A]

Debian Buster = [H]

Fedora 31 = [A]

Ubuntu 18.04 = [H]

KDE Neon = [H]

My post in Ask Fedora

Some time ago, I made a post on Ask Fedora about the problem, there is a lot of information there. Maybe it will also give useful information. However, I think you can ignore most of it and just see what happens in the video. Take in consideration that although in that post I say that some distributions don't have the problem, later I discovered that if I connected and HDMI monitor, the problem will appear. Here it is:

#

This is something that has given me a lot of stress. It’s quite a long problem, so I’ll be very thankful if you could help. What is the basic description of the problem?

I cannot hear music and audio normally. On every application and site, would it be Rhythmbox, Audacious, YouTube, etc, the audio is choppy. What I mean by that is that the audio cuts itself every two or three seconds, and the sound icon on the bar of GNOME disappears for the moment in which the audio goes off. Is very infuriating. And the worst thing, it happens on almost any other Linux distro!

Info

#1) About the audio specifications,
lspci -nnk | grep -A2 Audio
shows:

00:1f.3 Audio device [0403]: Intel Corporation 200 Series PCH HD Audio [8086:a2f0]
DeviceName: Onboard - Sound
Subsystem: Biostar Microtech Int’l Corp Device [1565:824d]

#2) Trying to investigate the problem, I installed a plugin in GNOME that let me choose the audio output, and it showed lots of entries labeled «Dummy output». When I clicked on one of them, the shell crashed

#3) List of systems I have tried, and what I deduce from it. The [✗] means that the error is present, while the [✓] means that it is absent.

[✓] Ubuntu 19.04

[✓] Manjaro GNOME (early 2019)

[✓] Linux Mint 19.2

[✓] Zorin OS

[?] Elementary OS

[✗] Arco Linux (current)

[✗] Ubuntu 19.10

[✓] Debian 10 XFCE

[✓] Debian 10 Cinnamon

[✗] Manjaro XFCE (current)

[✗] Manjaro Cinnamon (current)

[✗] Fedora 31

And what do I deduce from that? All the distributions that have the [✗] are either newer releases (like Ubuntu 19.10) or rolling-release (like Manjaro or Arco Linux), while the ones with the [✓] are either released before June (Ubuntu 19.04, Mint 19.2 and the version of Manjaro I was using in May) or use old packages (Debian 10), so that, for me, means that maybe there was an update on alsa or pulseaudio that bugged some things. But there is one factor that could be crucial, and it is that both Linux Mint and Ubuntu enable third-party drivers, so that can change some things.

#4) I don’t think it is a problem related to the headphones, because the speakers I tried also were buggy, and the problem persist even if i unplug the headphones. I think it is a software-related issue, more on that later.

#5) The level of choppyness increases with the volume. At lower volumes, there is less stops in the audio, while at maximun volume, the audio is practically unusable. That only happens with the system volume, not the physical volume, so that’s another point for the software theory.

#6) When executing

alsamixer

in the terminal, I only can choose the input and output volumes, not any other options. If I press F6, and select HD Intel PCH, I can see the other options. More on that below.

#7) Disabling the «Auto-mute» option doesn’t change anything. This could be two things, either: it isn’t related to the problem, or, the system uses the «default» configuration, the one that doesn’t have the other options.

#8) Adding

load-module module-udev-detect tsched=0

to

/etc/pulse/default.pa

doesn’t work.

#9) Executing

echo "options snd-hda-intel model=generic" | sudo tee -a /etc/modprobe.d/alsa-base.conf

doesn’t work, but now it lets me choose between HDMI and Built-in Audio

#10) Opening the «Sound» tab in «Settings» shows something very interesting. Below the audio dispositive, there is a bar that shows the intensity of the sound. In the microphone section (the headset has a microphone) the bar changes according to the level of sound it is receiving. However, the output section doesn’t show any change.

Please, i’ll be really, really thankful if someone has the knowledge to identify and solve this problem. I can’t work normally without sound! Thanks, thanks, in advance. I maybe will come up with more details later.

Best Answer

It really is terrible that problems that were resolved back in 2008 are still haunting us in 2020 - 12 years on :(. I'm on Ubuntu 20.04.1 LTS.

To get rid of choppy / stuttering / skipping audio when listening to music, simply follow post #6 here. The top of that answer reckons the method described therein is obsolete but it worked perfectly on my Dell Precision M6700 with this audio:

$ lspci | egrep -i audio
00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller (rev 04)

Maybe it worked on my laptop being it's an older model.

UPDATE:

I just realized that I did not do the right thing in case the link above dies at some point in the future.

The solution is to edit /etc/pulse/daemon.conf and ensure the following is added/uncommented in the file:

high-priority = yes
nice-level = -15
default-sample-rate = 48000
default-fragments = 8
default-fragment-size-msec = 10

I had uncommented just the lines starting with default-... prior to this edit, but I found that occasionally I'd get the odd stutter/skip. I haven't had any issue since adding high-priority and nice-level as noted in later posts in the thread linked above.

Hopefully this is the last you'll see of me regarding this issue.

UPDATE - 2021/01/03:

Despite all these changes, I was still occasionally getting stuttering audio after laptop has been running for an extended period. I'm now trying the low latency kernel as supplied by Ubuntu. The only issue I've had so far is that I cannot access my ZFS formatted USB drive - I installed the low latency kernel manually and not via the HWE method as discussed in the linked article. I might change to the HWE method to see if I can access ZFS and then I'll be fully content.

There's a really good discussion about the benefits of using a low latency kernel where audio is concerned.

Also, see this article that details how to go about installing a low latency kernel on Ubuntu.

NOTE: Since the articles I've linked to in this article are all from Stack Exchange, I figured there's no need to duplicate the content.

UPDATE - 2021/05/18:

Okay - the stuttering has returned with a vengence - despite all the changes. Feels like the machine has perfected its AI on how to become a major PITA! I'm currently trying the changes below as suggested by this article [Solved] Mint 13 Mate 32 bit, Sound Skips from back in 2012 - just 6 days shy of 9 years today. Hopefully this turns out to be the ultimate fix and hence my last edit:

In /etc/pulse/default.pa, find and change:

from:

load-module module-udev-detect

to:

load-module module-udev-detect tsched=0

In /etc/pulse/daemon.conf, find, uncomment, then change:

from:

;realtime-scheduling = yes
...
;default-fragments = 4
;default-fragment-size-msec = 25

to:

realtime-scheduling = yes
...
default-fragments = 8
default-fragment-size-msec = 5
Related Question