Crackling audio

I haven't been listening to online radio recently, but now when I do I get a crackling when I browse the web or use editors. I am using an AMD Ryzen 3 1200 Quad-Core Processor. Any advice for resolving the problem will be appreciated.

Device...

:~> arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 2: ALC892 Alt Analog [ALC892 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Software...

# zypper se pipewire
Loading repository data...
Reading installed packages...

S  | Name                           | Summary                                                                  | Type
---+--------------------------------+--------------------------------------------------------------------------+-----------
   | gstreamer-plugin-pipewire      | Gstreamer Plugin for PipeWire                                            | package
   | kpipewire-devel                | Development files for kpipewire                                          | package
   | kpipewire-imports              | QtQuick bindings for kpipewire                                           | package
   | libKPipeWire5                  | PipeWire integration for KDE Plasma - main library                       | package
   | libKPipeWire5-lang             | Translations for package libKPipeWire5                                   | package
   | libKPipeWireDmaBuf5            | PipeWire integration for KDE Plasma - DMA-BUF support                    | package
   | libKPipeWireRecord5            | PipeWire integration for KDE Plasma - recording support                  | package
i  | libpipewire-0_3-0              | A Multimedia Framework designed to be an audio and video server and more | package
   | libpipewire-0_3-0-32bit        | A Multimedia Framework designed to be an audio and video server and more | package
i+ | pipewire                       | A Multimedia Framework designed to be an audio and video server and more | package
i+ | pipewire-alsa                  | PipeWire media server ALSA support                                       | package
   | pipewire-alsa-32bit            | PipeWire media server ALSA support                                       | package
i+ | pipewire-aptx                  | PipeWire Bluetooth aptX codec plugin                                     | package
   | pipewire-aptx                  | PipeWire Bluetooth aptX codec plugin                                     | srcpackage
   | pipewire-aptx-debuginfo        | Debug information for package pipewire-aptx                              | package
   | pipewire-aptx-debugsource      | Debug sources for package pipewire-aptx                                  | package
   | pipewire-devel                 | Development Files For PipeWire, A Multimedia Framework                   | package
   | pipewire-doc                   | PipeWire media server documentation                                      | package
   | pipewire-jack                  | PipeWire JACK implementation                                             | package
   | pipewire-lang                  | Translations for package pipewire                                        | package
i+ | pipewire-libjack-0_3           | PipeWire libjack replacement libraries                                   | package
   | pipewire-libjack-0_3-32bit     | PipeWire libjack replacement libraries                                   | package
   | pipewire-libjack-0_3-devel     | Development files for pipewire-libjack-0_3                               | package
   | pipewire-module-x11-0_3        | X11 support For PipeWire, A Multimedia Framework                         | package
   | pipewire-module-xrdp           | Enable xrdp to generate sound with pipewire                              | package
i+ | pipewire-modules-0_3           | Modules For PipeWire, A Multimedia Framework                             | package
   | pipewire-modules-0_3-32bit     | Modules For PipeWire, A Multimedia Framework                             | package
   | pipewire-pulseaudio            | PipeWire PulseAudio implementation                                       | package
i+ | pipewire-spa-plugins-0_2       | Plugins For PipeWire SPA                                                 | package
   | pipewire-spa-plugins-0_2-32bit | Plugins For PipeWire SPA                                                 | package
i+ | pipewire-spa-tools             | The PipeWire SPA Tools                                                   | package
i+ | pipewire-tools                 | The PipeWire Tools                                                       | package

and...

# zypper se pulseaudio*
Loading repository data...
Reading installed packages...

S  | Name                        | Summary                                                         | Type
---+-----------------------------+-----------------------------------------------------------------+-----------
i+ | pulseaudio                  | A Networked Sound Server                                        | package
   | pulseaudio-bash-completion  | PulseAudio Bash completion                                      | package
   | pulseaudio-dlna             | A DLNA server which brings DLNA/UPnP support to PulseAudio      | package
   | pulseaudio-dlna             | A DLNA server which brings DLNA/UPnP support to PulseAudio      | srcpackage
   | pulseaudio-equalizer        | PulseAudio's LADSPA plugin graphical user interface             | package
   | pulseaudio-lang             | Translations for package pulseaudio                             | package
   | pulseaudio-module-bluetooth | Bluetooth support for the PulseAudio sound server               | package
   | pulseaudio-module-gsettings | GSettings module for PulseAudio                                 | package
   | pulseaudio-module-jack      | JACK support for the PulseAudio sound server                    | package
   | pulseaudio-module-lirc      | LIRC module for PulseAudio                                      | package
   | pulseaudio-module-x11       | X11 module for PulseAudio                                       | package
   | pulseaudio-module-zeroconf  | Zeroconf module for PulseAudio                                  | package
   | pulseaudio-qt-devel         | Development files for pulseaudio-qt, Qt bindings for PulseAudio | package
i  | pulseaudio-setup            | Set-up script for PulseAudio                                    | package
   | pulseaudio-system-wide      | Support for running PulseAudio daemon system wide               | package
i+ | pulseaudio-utils            | PulseAudio utilities                                            | package
   | pulseaudio-utils-32bit      | PulseAudio utilities                                            | package
   | pulseaudio-zsh-completion   | PulseAudio zsh completion                                       | package

Check that your mic is not live as a first step…
https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture/Troubleshooting#Crackling_sound_through_mini-jack_(headphones_connector)

You do not need a pulsaudio sound server if you use pipewire. There is a compatible layer that works like pulseaudio on pipewire. So remove pulseaudio and install pipewire-pulseaudio.

Once done it should look like this when you run “pactl info”

$ pactl info | grep "Server Name"
Server Name: PulseAudio (on PipeWire 0.3.79)

No microphone being used.

As already suggested, install ‘pipewire-pulseaudio’ (it will want to remove pulseaudio as part of the installation)…

zypper in pipewire-pulseaudio

FWIW, there are a number of things that could cause unwanted crackling/noise. I have seen similar crackling issues reported in cases where the wrong default sample rate was in use.

Two examples:

https://www.reddit.com/r/ValveIndex/comments/iavw77/does_anyone_else_have_audio_cracklingpopping_on/

Anyway start by removing PulseAudio and report back.

Done as suggested. Nothing changed. Moving on to your link.

# zypper se pulseaudio
Loading repository data...
Reading installed packages...

S  | Name                               | Summary                                                         | Type
---+------------------------------------+-----------------------------------------------------------------+-----------
   | bumblebee-status-module-pulseaudio | Widget for pulseaudio                                           | package
   | libKF5PulseAudioQt3                | Qt bindings for PulseAudio                                      | package
i+ | pipewire-pulseaudio                | PipeWire PulseAudio implementation                              | package
   | pulseaudio                         | A Networked Sound Server                                        | package
   | pulseaudio-bash-completion         | PulseAudio Bash completion                                      | package
   | pulseaudio-dlna                    | A DLNA server which brings DLNA/UPnP support to PulseAudio      | package
   | pulseaudio-dlna                    | A DLNA server which brings DLNA/UPnP support to PulseAudio      | srcpackage
   | pulseaudio-equalizer               | PulseAudio's LADSPA plugin graphical user interface             | package
   | pulseaudio-lang                    | Translations for package pulseaudio                             | package
   | pulseaudio-module-bluetooth        | Bluetooth support for the PulseAudio sound server               | package
   | pulseaudio-module-gsettings        | GSettings module for PulseAudio                                 | package
   | pulseaudio-module-jack             | JACK support for the PulseAudio sound server                    | package
   | pulseaudio-module-lirc             | LIRC module for PulseAudio                                      | package
   | pulseaudio-module-x11              | X11 module for PulseAudio                                       | package
   | pulseaudio-module-zeroconf         | Zeroconf module for PulseAudio                                  | package
   | pulseaudio-qt-devel                | Development files for pulseaudio-qt, Qt bindings for PulseAudio | package
i  | pulseaudio-setup                   | Set-up script for PulseAudio                                    | package
   | pulseaudio-system-wide             | Support for running PulseAudio daemon system wide               | package
i+ | pulseaudio-utils                   | PulseAudio utilities                                            | package
   | pulseaudio-utils-32bit             | PulseAudio utilities                                            | package
   | pulseaudio-zsh-completion          | PulseAudio zsh completion                                       | package
i+ | xfce4-pulseaudio-plugin            | Pulseaudio Volume Control Plugin for the Xfce Panel             | package
   | xfce4-pulseaudio-plugin-lang       | Translations for package xfce4-pulseaudio-plugin                | package

Followed your link but the suggested fix depends on using PulseAudio, and the two files referred to do not exist. What if I revert to not using pipewire at all?

This Manjaro “How To” may be worth reviewing. In particular, section 3 describes changing the default sample rate. You can create ~/.config/pipewire/piprewire.conf (copy /usr/share/pipewire/pipewire.conf and edit if desired), find the entry

#default.clock.allowed-rates = [ 48000 ]

and change to

default.clock.allowed-rates = [ 44100 48000 ]

then restart pipewire with

systemctl --user restart pipewire

See how that goes.

If that makes no difference, you can try section 4 of that guide next. The ‘api.alsa.headroom’ entry in the pipewire.conf can be changed from the default value to a different value. Again, I suggest making changes in the user’s ~/.config/pipewire/pipewire.conf only. Restart the user pipewire.service when done (as before).

Another thing you can do is run alsa-info.sh and send it to paste.opensuse.org so we can see how your audio is set up. And paste the link.

Like so:
alsa-info.sh --stdout | EXPIRE=10080 TITLE=“alsa-info.sh” NICK=“ionmich” SYNTAX=“text” susepaste

Done as suggested. No change.

This is what I got…nothing to paste.

# alsa-info.sh --stdout | EXPIRE=10080 TITLE=“alsa-info.sh” NICK=“ionmich” SYNTAX=“text” 
Box2:/home/ion #

Ok. Don’t know why it didn’t work. It works for me 100% of the time. But you can run alsa-info.sh without pipeing. In the end you get a question to save the info locally. Upload that to paste.opensuse.org and post the link.

Ok, thanks for reporting back. Try executing the following

su -c "echo 2048 > /sys/class/rtc/rtc0/max_user_freq"
su -c "echo 2048 > /proc/sys/dev/hpet/max-user-freq"

This won’t survive a reboot, but worth a shot to see if it helps in any way.

https://paste.opensuse.org/pastes/15772ed8f035

Still no change.

I see you have jackd and jackdbus installed. Even if they weren’t running when you ran alsa-info.sh, you didn’t happen to run one of them when you were listening to something?

You can check by starting something you listen to and wait for crackling noise and then run this in a terminal:
jack_control status && jack_control dg && jack_control dp && jack_control ep

This too:
ps waux | grep -i jack

If you are not using jackd or jackdbus, try uninstalling them. Misconfigured Jack can definitely be a source of crackling noise.

!!Sound Servers on this system
!!----------------------------

PipeWire:
Installed - Yes (/usr/bin/pipewire)
Running - Yes

Jack:
Installed - Yes (/usr/bin/jackd)
Running - No

Jack2:
Installed - Yes (/usr/bin/jackdbus)
Running - No

Removed jackd and jackdbus. Still no change. I’m giving up on this quest. Thanks for the help.

Okay. I understand. If you happen to want to test one more thing. Create another user on your machine and log in as that user. This way you get a completely untouched installation for your personal desktop environment (DE). If that solves the problem, you have a problem with your DE setup and that narrows down the error sources to your own setup.

As I mentioned at the start this thread, there could be a number of reasons that cause such an issue (including hardware connections). Along with aggplanta’s advice, perhaps review the following…