16

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.

  • try Knoppix live DVD – jsotola Jan 06 '20 at 03:35
  • Apparently, the automatic detection for a plugged-in HDMI output does not work correctly. Which of the outputs do you actually want to use? – CL. Jan 06 '20 at 19:35
  • @CL., I was trying to use the stereo/headphones output. If I select the HDMI output, it sounds fine. I thought I discovered something in the video with the S/PDIF turning on and off, but I can't make anything out of it. – leoverkisto Jan 09 '20 at 01:19
  • It should be possible to tell PulseAudio to always ignore the HDMI. Or options snd-hda-intel enable=0,1 to ignore the first HDA device (which usually is the GPU). – CL. Jan 09 '20 at 09:52

4 Answers4

29

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

Note: Only edit the 3 lines shown above. The ... is there to indicate that the first line and the other 2 aren't close together.

to:

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

UPDATE - 2022/12/06:

I finally bit the bullet and decided to ditch PulseAudio in favor of PipeWire in Nov 2021. However, although the problem seemed to be less severe, it was still there. But just 3 days ago, I stumbled upon this GitHub issue where the OP stated that commenting one line in the default /etc/pipewire.conf file and adding 4 new lines, his skipping, stuttering, and choppy audio issues simply faded away. I did the same and what do you know - I've been listening to loads of music for the last 3 days and it is truly resolved.

So, here's what I did:

  1. Switch to PipeWire as shown here
  2. Copy default pipewire.conf to /etc/pipewire/
sudo mkdir /etc/pipewire
sudo cp /usr/share/pipewire/pipewire.conf /etc/pipewire/
sudo vi /etc/pipewire/pipewire.conf
  1. In section context.properties, comment out default.clock.rate
  2. Add the following 4 lines beneath the line commented out in step 3 above:

(UPDATE: Thanks to @evamvid eagle eyes - updated from 19200 to 192000 as stated in the Github issue)

default.clock.rate        = 192000
default.clock.quantum     = 512
default.clock.min-quantum = 32
default.clock.max-quantum = 4096
  1. Save the file and Restart Pipewire:
systemctl --user restart pipewire-media-session pipewire-pulse pipewire

Enjoy clean music!

This works for me on the following laptop:

$ inxi -SM
System:  Host: akk-m6700.anroet.com Kernel: 5.15.0-53-lowlatency x86_64 bits: 64 Desktop: Gnome 3.36.9 
         Distro: Ubuntu 20.04.5 LTS (Focal Fossa) 
Machine: Type: Laptop System: Dell product: Precision M6700 v: 01 serial: <superuser/root required> 
         Mobo: Dell model: 0JWMFY v: A00 serial: <superuser/root required> UEFI: Dell v: A20 date: 11/30/2018
AnthonyK
  • 569
  • 1
    @MateusMatucumaTeixeira - I've just updated the post. Forgot to post after I made some recent modification. Much much better now with a low latency kernel. Only issue I now get is that my Bluetooth speaker will occasionally stutter but not a single issue when on my wired headset. – AnthonyK Jan 03 '21 at 04:56
  • You are truely my savior!!!! – user3032481 Jun 25 '21 at 06:51
  • This is an excellent answer and solved my problem in Ubuntu 20.04.3. Thank you so much. – C26 Oct 15 '21 at 16:01
  • @AnthonyK should I uncomment all lines between realtime-scheduling and default-fragment-size-msec? – Farhood ET Oct 26 '21 at 20:26
  • 1
    @FarhoodET No. Just the lines shown. I used the dots to indicate that the settings are not close together and now I see that could be construed as changing them all. I'll add a note. – AnthonyK Oct 26 '21 at 22:22
  • Changed the files as described above, then pulseaudio -k. Works like a charm. Thank you! – netbrain Dec 15 '21 at 19:38
  • The problem occurred out of a sudden on my Ubuntu 20.04.4. No updates installed, started stuttering today. The only line I needed to add was default-sample-rate = 48000. Strangely the stuttering only occurred on my external soundcard (PCM2902), not on the internal one. – Konrad Mar 25 '22 at 17:23
  • It is sad that in 2022 linux is still stuck with the worst sound-system in history.... The fix unfortunately didn't work for me. – dstibbe Jul 18 '22 at 20:25
  • Hey @dstibbe, can you try this instead apt remove speech-dispatcher*. Let me know if that fixes it for you. – AnthonyK Jul 19 '22 at 02:57
  • @AnthonyK Just tried it. Even restarted the bluetooth service. But still not working – dstibbe Jul 20 '22 at 20:44
  • @AnthonyK I found my cause. The case itself was disturbing the bluetooth communication. Had to connect the antenna's to my wifi connector.. this solved it for me. – dstibbe Jul 31 '22 at 11:00
  • @dstibbe Good to hear you resolved it. Any chance you can share the bluetooth device you are using in case someone comes along and has the same one? – AnthonyK Aug 02 '22 at 01:20
  • Thanks for sharing PipeWire update! Nothing else worked on my Debian 11 with a HDMI monitor sound. – ARA1307 Feb 17 '23 at 20:43
  • Thank you for the PipeWire update. It fixed my problem most of the time. I change the clock.rate back to 48000 because the sound quality was just too bad with 19200. The problem still happens, but very rarely so its not an issue. – Magnus Westin Apr 19 '23 at 09:23
  • Update, its not really solved. If I run something that uses 100% CPU the problem is still really bad – Magnus Westin Apr 19 '23 at 13:43
  • @MagnusWestin: Maybe try a low latency kernel that will give you a better interactive experience on your desktop. – AnthonyK Apr 21 '23 at 05:48
  • 1
    FYI, you have a typo -- the clock rate should be 192000, not 19200 (from the original github issue you linked). Setting it to 19200 fixes the HDMI audio issue but breaks easyeffects. – evamvid Mar 29 '24 at 14:06
  • Thanks @evamvid. That's most likely a remnant from my previous experimentation. Thanks for catching it - Article updated. – AnthonyK Mar 31 '24 at 10:16
  • Interestingly, that 19200 setting did not affect PulseEffects - which is what I have on Ubuntu 22.04 as they don't offer EasyEffects. – AnthonyK Mar 31 '24 at 10:26
2

This worked for me from a response in askubuntu - I am running pulseaudio 13

None of the above fixes worked for me (pulseaudio 11.1); what solved it for me was going into /etc/pulse/daemon.conf and turning off realtime-scheduling by adding in the line realtime-scheduling = no beneath the line reading ;realtime-scheduling = yes like so:

;realtime-scheduling = yes
realtime-scheduling = no

Link here

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
2

I'll add my solution, for those that haven't found a solution in software configuration (I figured it out after two linux distros and one windows installation).

The cause for the audio from my bluetooth headphone to be choppy was actually my PC case. It was interfering with the bluetooth communication.

Even though I wasn't using wifi (it was actually disabled), I had to connect the antenna's to my wifi connector.

This solved the choppy sound for me.

dstibbe
  • 121
1

i had skipping problems in Debian and fedora.
(Mother Gigabyte B450 Gaming X and Behringer Um2) I was able to solve it by uninstalling all audio drivers and installing pipewire, pipewire-jack, pipewire-alsa, pipewire-pulse, etc. Now everything works perfect, I spent a lot of time trying to solve this and I finally got it. I hope it works for you!

Simba
  • 11
  • 1