Crackling/static in Discord with default audio output port (PulseAudio)

46,501

Solution 1

I fixed it by modify /etc/pulse/default.pa. Find and replace:

load-module module-udev-detect

by

load-module module-udev-detect tsched=0

Then restart PulseAudio using this command:

pulseaudio -k && sudo alsa force-reload

Solution 2

I had a similar issue with Skyrim on Linux via. Steam Play. I tried all kinds of stuff; these were the only things that actually worked, so they must be important.


To get music and voices working, this is what worked for me:

  1. enable Steam Beta client, restart
  2. Settings > Steam Play > Enable Steam Play for all titles
  3. install Skyrim through Steam
  4. install winetricks (i.e. apt install winetricks)
  5. find the directory steamapps/compatdata/489830 and ensure it has a pfx directory. cd into it.
  6. execute WINEPREFIX=$PWD/pfx winetricks --force xact
  7. execute WINEPREFIX=$PWD/pfx winecfg
  8. in the Libraries tab create overrides for the properties xaudio2_6 and xaudio2_7, setting both to native

You'll know it works, if you hear the introductory music on the title screen.

Source: https://www.reddit.com/r/linux_gaming/comments/99i4se/skyrim_on_linux_steam_play_no_voiceno_music_audio/

----------------------------------------------------------------------------------------------------

I also had some kind of popping, crackling, or distortion of the audio after I got music and voices working. This is what worked for me:

Laggy sound

This issue is due to incorrect buffer sizes. First verify that the variables default-fragments and default-fragment-size-msec are not being set to non default values in the file /etc/pulse/daemon.conf. If the issue is still present, try setting them to the following values:

/etc/pulse/daemon.conf

default-fragments = 5

default-fragment-size-msec = 2

----------------------------------------------------------------------------------------------------

Choppy/distorted sound

This can result from an incorrectly set sample rate. Try the following setting:

/etc/pulse/daemon.conf

avoid-resampling = yes #(Needs PA11 or higher)

default-sample-rate = 48000

and restart the PulseAudio server.


If one experiences choppy sound in applications using OpenAL, change the sample rate in /etc/openal/alsoft.conf:

/etc/openal/alsoft.conf

frequency = 48000


Setting the PCM volume above 0 dB can cause clipping. Running alsamixer will allow you to see if this is the problem and if so fix it. Note that ALSA may not correctly export the dB information to PulseAudio. Try the following:

/etc/pulse/default.pa

load-module module-udev-detect ignore_dB=1

and restart the PulseAudio server.

Source: https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Laggy_sound

Share:
46,501

Related videos on Youtube

Miqued
Author by

Miqued

Updated on September 18, 2022

Comments

  • Miqued
    Miqued over 1 year

    I installed Ubuntu 18.04 less than a week ago and 99% of what I need to work has been no problem. When I first installed Discord, from the instructions on their website, everything was fine. The Snap package had problems starting and refused to go past the update sequence, as if it had no internet connection. However, the first time I join a voice chat after a reboot, I get loud crackling anytime someone speaks. It fixes itself if I change the output of my headphones from Line Out to Headphones or vice versa (headphones setting sounds better to me).

    I initially thought it was the Line Out setting being the issue, so I changed it using this as a guide. That did not fix it and no matter which one I set as default, the crackling returns equally as bad in Discord until I change it. After that, either port sounds just fine. I'm trying to figure out how I can have it sound good without having to flip the setting in PulseAudio, but I'm clueless.

    All other audio seems fine. Even in games like CSGO there isn't this problem with voice chat, and I'm able to play other games, watch video, and listen to spotify just fine. It only seems to be affecting discord.

    If it matters, the exact settings are "Line Out (plugged in)" and "Headphones (unplugged)" although despite the forum in the link above, I was able to set the Headphones as default anyway and it recognizes that port. I'm using the PulseAudio Volume Control (pavucontrol) app from Ubuntu Software to change these settings, and the terminal to set the default port.

    My only connected audio devices are my headphones for output, plugged into the motherboard port; my mixer and headphones are listed in input (headphone mic muted), both also plugged into the motherboard. Mixer is a USB interface. My webcam was listed at one point, but I'm not sure where it has gone and if that can affect things somehow.

    If anyone knows of a fix, please let me know! Thank you

  • Miqued
    Miqued over 5 years
    That was it exactly. What does that do/why does that work?
  • Jared Chu
    Jared Chu over 5 years
    I think it's the conflict between Discord and PulseAudio. Refs askubuntu.com/questions/371595/…