[pulseaudio-discuss] crackling audio while connected to discord voice channel

4DJ furdiejungs at gmail.com
Tue Nov 28 22:14:21 UTC 2017

i'm trying to pin down a crackling audio issue that, the more i dig
into, the more things i find that are possibly at fault and the more
it confuses me. firstly i should mention that i run gentoo and all
packages are compiled with gcc 6.4/7.2 -march=znver1. i haven't yet
tried to reproduce the issue on another distro but i will try and do
so when i find the time. my cpu is a ryzen 5 1600 and the codec is a
realtek alc892. pulseaudio is compiled with +realtime for rtkit.

usually pulse sound output works fine in firefox, spotify, mpv, but
when i join a voice channel in the linux native version of discord all
output and, i am told, the input heard on the other end, sounds
crackly and horrific and the crackling rises and falls with the actual
sound. if you aren't familiar with discord, it's a proprietary chat
service of which the desktop client is a web application that uses
webrtc and uses electron which through chromium i believe uses
libpulse directly. when i stop the audio by either leaving the channel
or pausing music, the last heard sound plays twice. when i leave the
channel though all audio returns to normal. i set the loglevel to
debug in daemon.conf and i saw pulse crying out about buffer
underruns. however, the crackling only persists temporarily, and
resolves itself in a few minutes. adding tsched=0 to
module-udev-detect removed the initial crackling but introduced a
staticky noise in the microphone input.

interestingly the amount of time it took to resolve itself depended on
the running kernel. very unscientifically after a couple of kernel
upgrades i noticed that a linux-ck kernel seemed to resolve itself in
more time than a mainline kernel, and that changing the tickrate to
1000hz reduced the amount of time to less than either of the last two
kernels. this and that it works with tsched=0 caused me to suspect
timer scheduling was possibly an issue. the other thing that i thought
of is that activating resampling causes the crackling since pulse logs
that resampling gets activated when i join the channel and the
crackling stops when i leave.

finally i decided to instead try running discord inside chromium, and
it works perfectly. at this point i believe the root of the issue
could be in either pulse, libpulse, discord, discord's version of
electron or in fact revert to the alsa driver, and i'm leaning more
towards an issue with build options/configuration of pulse. i'm happy
to provide any more logs and run any more tests if needed.

More information about the pulseaudio-discuss mailing list