You are not logged in.
I've noticed crackling/popping with my audio, especially when my CPU is under load. I can recreate the noise consistenly when I'm playing youtube on chromium and when streaming from mpd when I hold down the left and right arrow keys while viewing a pdf using qpdfview. I do not have a default.pa in my home directory for my user. I have the line "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1" to run mpd as its own user (see Arch Wiki). I added "tsched=0" to "load-module module-udev-detect" to try to solve the issue since the Arch Wiki recommended it. The only instance of the line is within an if statement, so I'm not sure if I should have the line outside of it. I want audio to have a very high priority to prevent skipping. My etc/pulse/default.pa is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
## tsched=0 added by mjd119 to disable timer-based scheduling
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#Added by mjd119 (commenting out was source of problem when attempting to run mpd as own user)
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish
# Added by mjd119 (Arch Wiki)
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
EDIT:
I forgot to mention that I did open alsamixer and made sure loopback is disabled (recommended by wiki).
Last edited by mjd119 (2020-05-31 00:00:56)
Offline
I had similar issues with crackling on a rpi. You can try to raise the buffer that is used by the pulseaudio instance that is doing the actual playback to ALSA:
pacmd update-sink-proplist "alsa_output.platform-soc_audio.analog-stereo" device.buffering.buffer_size=1048576
... just change the device name to your playback device and the buffer-size. The default buffer size was 128k, changing to 1M made it work. I am telling this because I also played with the "tsched" parameter but it had no effect, it actually made it worse.
The proposed command is just raising the buffer temporarily, a reboot and all is back to what it was before, so it is safe to play with.
Offline
I wasn't sure whether the problem was the same, worse, or better after I changed the tsched parameter. Is there a file to edit that will make the change permanent? Or do you just recommend changing the buffer every time you reboot?
EDIT: Also, how do I found out what my device is?
Last edited by mjd119 (2020-05-21 18:04:07)
Offline
If it works you can add the working update-sink-proplist command without the pacmd to the end of your /etc/pulse/default.pa to have it applied automatically each time. To identify the device to apply (and to check the buffer sizes) to look at
pacmd list-sinks
Last edited by V1del (2020-05-21 19:09:41)
Online
Running "pacmd list-sinks" and then running the pacmd update-sink-proplist appeared to fix the problem but I'll have to do more tests. I see more memory and cpu usage from pulseaudio and mpd, but that's too be expected since I increased the buffer. I play lossless music almost exclusively so the extra buffer probably helps prevent skips more so than with mp3. I'll try to set the change permanently as suggested by V1del. Thank you to V1del and coolion!
Last edited by mjd119 (2020-05-22 19:15:48)
Offline
After some tests, I still have crackling/popping after adding the command to my default.pa file. I can reproduce it consistently if I page through a large pdf file (3682 pages). It is not as bad as it was before but it still bothers me and I get the noise if I am doing something where there is a bump in cpu usage. I have tried it with and without the tsched=0 argument. My /etc/pulse/default.pa file is now:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
## tsched=0 added by mjd119 to disable timer-based scheduling
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#Added by mjd119 (commenting out was source of problem when attempting to run mpd as own user)
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish
# Added by mjd119 (Arch Wiki)
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
# Added by mjd119 to increase buffer for pulseaudio
update-sink-proplist alsa_output.pci-0000_0b_00.4.analog-stereo device.buffering.buffer_size=1048576
and pacmd list-sinks returns:
2 sink(s) available.
index: 0
name: <alsa_output.pci-0000_09_00.1.hdmi-stereo-extra4>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9030
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: yes
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 100.14 ms
card: 0 <alsa_card.pci-0000_09_00.1>
module: 6
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "HDMI 4"
alsa.id = "HDMI 4"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "10"
alsa.card = "0"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfcca0000 irq 103"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:09:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:07:00.0/0000:08:00.0/0000:09:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "1002"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
device.product.id = "ab38"
device.product.name = "Navi 10 HDMI Audio"
device.string = "hdmi:0,4"
device.buffering.buffer_size = "17664"
device.buffering.fragment_size = "2944"
device.access_mode = "mmap"
device.profile.name = "hdmi-stereo-extra4"
device.profile.description = "Digital Stereo (HDMI 5)"
device.description = "Navi 10 HDMI Audio Digital Stereo (HDMI 5)"
alsa.mixer_name = "ATI R6xx HDMI"
alsa.components = "HDA:1002aa01,00aa0100,00100700"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "U2879G6"
active port: <hdmi-output-4>
* index: 1
name: <alsa_output.pci-0000_0b_00.4.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9039
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 100.14 ms
card: 1 <alsa_card.pci-0000_0b_00.4>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC887-VD Analog"
alsa.id = "ALC887-VD Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfcb00000 irq 104"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:0b:00.4"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0b:00.4/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "1487"
device.product.name = "Starship/Matisse HD Audio Controller"
device.string = "front:1"
device.buffering.buffer_size = "1048576"
device.buffering.fragment_size = "2944"
device.access_mode = "mmap"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "Starship/Matisse HD Audio Controller Analog Stereo"
alsa.mixer_name = "Realtek ALC887-VD"
alsa.components = "HDA:10ec0887,1458a184,00100302"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
properties:
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-headphones>
I do not believe the AMD Navi sink works (I plug a aux cord into my desktop which connects to my motherboard, not GPU. Turning on audio for NAVI when I'm using KDE Plasma, for example, gives no audio output.
It looks like the line added to default.pa resulted in a change to the buffer size, but I still get the noise. Is completely eliminating it possible? Should I increase the fragment size as well? I'm not sure what the difference is between the buffer size and the fragment size. My CPU is a Ryzen 3600 so I should be able to manage the extra load from keeping a larger cache for audio. I want audio to be prioritized over everything else (skips in the audio takes me out of the immersion).
EDIT:
I'm doing this in i3 which should be the best situation for trying this due to how lightweight i3 is, unless there's a quirk with audio I'm missing (issue happened in KDE Plasma too).
ADDITIONAL INFO:
Running pacmd list-sinks|egrep -i 'index:|name:' (according to Arch Wiki) gives me:
index: 0
name: <alsa_output.pci-0000_09_00.1.hdmi-stereo-extra4>
* index: 1
name: <alsa_output.pci-0000_0b_00.4.analog-stereo>
so I know I adjusted the correct sink.
Last edited by mjd119 (2020-05-22 23:58:13)
Offline
Hmm Ryzens seem to be notorious for sound issues linked to CPU activity, there have been quite a few threads were disabling/unloading the CPU temp module (k8temp I believe) helped with audio dropouts. Maybe also check for vendor UEFI/BIOS updates.
Online
I updated my bios about a month ago so I don't think that's the issue. Could you link to threads about audio dropouts with Ryzen?
Offline
Check if you have an option to disable low idle/C-States/power saving in the BIOS/UEFI options. I'd also suggest you revert all of these config adjustments, they often have detrimental effects for little real benefit (other than the buffer increase). So reenable tsched uncomment the fragment size adjustments. Make sure your microcode updates are set up.
Online
I have only been able to somewhat mitigate the problems. I followed the troubleshooting guide on the Arch Wiki but I still get pops and crackles, especially when I flip through images with GwenView. I am using the KDE Plasma Desktop Environment. My system.pa file is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started in system
# mode.
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev/hal support)
load-module module-detect
.endif
### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent cracks/pops when opening/closing windows (Arch Wiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### Enable positioned event sounds
load-module module-position-event-sounds
my default.pa file is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
## tsched=0 added by mjd119 to disable timer-based scheduling
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
#load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-zeroconf-publish
# Added by mjd119 for pulse workaround for mpd (Arch Wiki)
#load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
# Added by mjd119 to allow audio access from everywhere (Arch Wiki)
load-module module-native-protocol-tcp auth-anonymous=true
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent pop when opening and closing windows (ArchWiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
# Added by mjd119 to increase buffer for pulseaudio
#update-sink-proplist alsa_output.pci-0000_0b_00.4.analog-stereo device.buffering.buffer_size=1048576
daemon.conf is:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 9
; exit-idle-time = 20
; scache-idle-time = 20
; dl-search-path = (depends on architecture)
; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa
; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0
; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0
flat-volumes = no
; flat-volumes = yes
; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
rlimit-rtprio = 9
; rlimit-rttime = 200000
; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right
default-fragments = 3
default-fragment-size-msec = 5
; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0
and client.conf is:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for PulseAudio clients. See pulse-client.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; default-sink =
; default-source =
; default-server =
; default-dbus-server =
autospawn = no
; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog
; cookie-file =
; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; auto-connect-localhost = no
; auto-connect-display = no
I changed my daemon.conf file to increase the scheduling priority according to this guide: https://medium.com/@gamunu/enable-high- … 16f3fe7e1f (just the "Scheduling configuration of pulse daemon" section)
but I still had the problem before anyway. I followed this guide on the Arch Wiki to eliminate the pops/crackles: https://wiki.archlinux.org/index.php/Pu … leshooting
I followed the "Glitches, skips or crackling," "Setting the default fragment number and buffer size in PulseAudio," and "Pops when starting and stopping playback" sections to try to solve the issue.
Also, my output for pacmd list-sinks is:
2 sink(s) available.
index: 0
name: <alsa_output.pci-0000_09_00.1.hdmi-stereo-extra4>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY
state: IDLE
suspend cause: (none)
priority: 9030
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: yes
current latency: 15.24 ms
max request: 2 KiB
max rewind: 2 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 15.24 ms
card: 0 <alsa_card.pci-0000_09_00.1>
module: 6
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "HDMI 4"
alsa.id = "HDMI 4"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "10"
alsa.card = "0"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfcca0000 irq 103"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:09:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:07:00.0/0000:08:00.0/0000:09:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "1002"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
device.product.id = "ab38"
device.product.name = "Navi 10 HDMI Audio"
device.string = "hdmi:0,4"
device.buffering.buffer_size = "2688"
device.buffering.fragment_size = "896"
device.access_mode = "mmap"
device.profile.name = "hdmi-stereo-extra4"
device.profile.description = "Digital Stereo (HDMI 5)"
device.description = "Navi 10 HDMI Audio Digital Stereo (HDMI 5)"
alsa.mixer_name = "ATI R6xx HDMI"
alsa.components = "HDA:1002aa01,00aa0100,00100700"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "U2879G6"
active port: <hdmi-output-4>
* index: 1
name: <alsa_output.pci-0000_0b_00.4.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
state: IDLE
suspend cause: (none)
priority: 9039
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 15.98 ms
max request: 2 KiB
max rewind: 2 KiB
monitor source: 1
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 15.24 ms
card: 1 <alsa_card.pci-0000_0b_00.4>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC887-VD Analog"
alsa.id = "ALC887-VD Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfcb00000 irq 104"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:0b:00.4"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0b:00.4/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "1487"
device.product.name = "Starship/Matisse HD Audio Controller"
device.string = "front:1"
device.buffering.buffer_size = "2688"
device.buffering.fragment_size = "896"
device.access_mode = "mmap"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "Starship/Matisse HD Audio Controller Analog Stereo"
alsa.mixer_name = "Realtek ALC887-VD"
alsa.components = "HDA:10ec0887,1458a184,00100302"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
properties:
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-headphones>
Any help is appreciated. The noise is driving me crazy. I am not concerned with power consumption if getting rid of or almost eliminating the noise requires more power. I am using a Ryzen 5 3600. Someone mentioned Ryzen CPUs have issues with audio dropouts with Pulse Audio. I originally made a new topic but now I am just posting the content of that here and marking this topic unsolved.
Last edited by mjd119 (2020-05-30 22:51:09)
Offline
Check if you have an option to disable low idle/C-States/power saving in the BIOS/UEFI options. I'd also suggest you revert all of these config adjustments, they often have detrimental effects for little real benefit (other than the buffer increase). So reenable tsched uncomment the fragment size adjustments. Make sure your microcode updates are set up.
So I should keep the line with tsched=0? When you're talking about the fragment size adjustments, are you talking about these lines?
default-fragments = 3
default-fragment-size-msec = 5
My latest config files I just posted. What should be reverted now? The fragment values were originally 4 and 25 (lines commented out) when I installed Arch.
EDIT: The amd-ucode package is installed and up to date. It was one of the first things I did when I installed Arch. Is it not enabled by default? The wiki seems to be saying the package needs to be installed and then you have to explicitly add the location of the microcode to the bootloader config file. I was not aware of this. When I run sudo grub-mkconfig -o /boot/grub/grub.cfg I get this output:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux-lts
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux-lts.img
Found fallback initrd image(s) in /boot: initramfs-linux-lts-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
done
Does this mean it's enabled? I only use GRUB as my bootloader.
Last edited by mjd119 (2020-05-30 22:50:28)
Offline
no remove the tsched=0 (that disables tsched, so to enable tsched you have to remove that) the fragments don't matter that much if that is the case but you would either way want to set them higher rather than lower if you want to prevent dropouts, if you really feel the need to set them manually, but I doubt that this is really the underlying issue here. Maybe also try changing your cpu scheduler to performance: https://wiki.archlinux.org/index.php/CP … _governors
Regarding the microcode that should be fine.
Last edited by V1del (2020-05-31 01:12:12)
Online
no remove the tsched=0 (that disables tsched, so to enable tsched you have to remove that) the fragments don't matter that much if that is the case but you would either way want to set them higher rather than lower if you want to prevent dropouts, if you really feel the need to set them manually, but I doubt that this is really the underlying issue here. Maybe also try changing your cpu scheduler to performance: https://wiki.archlinux.org/index.php/CP … _governors
Regarding the microcode that should be fine.
What is the default CPU scheduler profile on a fresh install? I haven't installed the cpupower package. Is it normal for the pop to happen at all? I can't recall if I had this issue when I was on Debian. It would sometimes happen on Windows when my CPU was really overloaded but the audio would stutter and it was much more obvious. Should I not set the default-fragments or default-fragment-size-msec? Would setting the priority high and real-time scheduling on in daemon.conf still help? I've noticed a difference when I increased the priority and turned on real time scheduling but it's hard to quantify. I'm running the LTS kernel if that makes a difference.
Last edited by mjd119 (2020-05-31 01:32:03)
Offline
I installed cpupower and didn't set any parameters. The output for "cpu power frequency-info" is:
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: Cannot determine or is not supported.
hardware limits: 2.20 GHz - 3.60 GHz
available frequency steps: 3.60 GHz, 2.80 GHz, 2.20 GHz
available cpufreq governors: performance schedutil
current policy: frequency should be within 2.20 GHz and 3.60 GHz.
The governor "schedutil" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 2.02 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: no
and "cpupower idle-info" is:
CPUidle driver: acpi_idle
CPUidle governor: menu
analyzing CPU 0:
Number of idle states: 3
Available idle states: POLL C1 C2
POLL:
Flags/Description: CPUIDLE CORE POLL IDLE
Latency: 0
Usage: 79517
Duration: 185683
C1:
Flags/Description: ACPI FFH MWAIT 0x0
Latency: 1
Usage: 2184845
Duration: 598674095
C2:
Flags/Description: ACPI IOPORT 0x414
Latency: 400
Usage: 1239991
Duration: 10150078778
My new daemon.conf is:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no
; high-priority = yes
; nice-level = -11
; realtime-scheduling = yes
; realtime-priority = 9
; exit-idle-time = 20
; scache-idle-time = 20
; dl-search-path = (depends on architecture)
; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa
; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0
; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0
flat-volumes = no
; flat-volumes = yes
; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000
; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right
; default-fragments = 3
; default-fragment-size-msec = 5
; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0
the new default.pa is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
## tsched=0 added by mjd119 to disable timer-based scheduling
.ifexists module-udev-detect.so
#load-module module-udev-detect tsched=0
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-zeroconf-publish
# Added by mjd119 for pulse workaround for mpd (Arch Wiki)
#load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
# Added by mjd119 to allow audio access from everywhere (Arch Wiki)
load-module module-native-protocol-tcp auth-anonymous=true
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent pop when opening and closing windows (ArchWiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
# Added by mjd119 to increase buffer for pulseaudio
#update-sink-proplist alsa_output.pci-0000_0b_00.4.analog-stereo device.buffering.buffer_size=1048576
and system.pa is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started in system
# mode.
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev/hal support)
load-module module-detect
.endif
### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent cracks/pops when opening/closing windows (Arch Wiki)
# Commenting out prevents pulseaudio from suspending sinks
load-module module-suspend-on-idle
### Enable positioned event sounds
load-module module-position-event-sounds
I changed back to the defaults I believe for each file based on comparing to the backups I had and commenting out my changes. I cannot reliably reproduce the pop when switching between windows, spamming direction keys in a pdf thousands of pages long or in a photo album on Gwenview. I think I still hear it sometimes but it could be in my head or part of the music. I mostly have the issue when I listen to FLAC files through mpd. I'm not sure if reverting back to the defaults or installing cpupower reduced the issue, but I'll have to do more tests. When I was playing with the settings, the pop would occur in different situations and at varying frequencies. Not sure if it's a pulseaudio issue cpu issue, or both.
EDIT:
I started FoldingAtHome to put stress on cpu (my configuration is just to use the GPU, some CPU is still necessary for scheduling) and I can reproduce the nosie more consistently. Holding the left arrow key on a pdf file in qpdf produces the sound at a fairly consistent tempo. Would adding tsched=0 and adjusting the fragment parameters be useful in this case? I would rather not change my CPU governor profile unless it's the only option.
Last edited by mjd119 (2020-05-31 04:05:32)
Offline
Switching the governor to performance is to test if there is a relation between frequency scaling and the stutter you are hearing. Maybe try to cut out pulseaudio (switch mpd to directly access hw:1 via ALSA or so, if you want to ensure pulse isn't running you can use
systemctl --user mask pulseaudio.{service,socket} --now #unmask to revert
) if you can reproduce this on ALSA we have a lower level to look at but from what you are telling so far and from what I'm reading it seems to be a known problem with specific ryzen models that there can be audio interference on high cpu exhaustion (I do remember a thread here but I haven't been able to dig that up, but googling leads quite a few results, e.g.: https://www.reddit.com/r/MSI_Gaming/com … l_fix_for/ ).
You can definitely play with the niceness/rtprio values. fragments don't matter at all when timer based scheduling is used and timer based scheduling tends to work quite well with supported chips. If it's more consistently reproducible when paging through a big PDF file that might also be an issue with how CFS operates in it's default configuration, you might want to give something like linux-zen a shot that's more tuned towards desktop usecases.
Online
Switching the governor to performance is to test if there is a relation between frequency scaling and the stutter you are hearing. Maybe try to cut out pulseaudio (switch mpd to directly access hw:1 via ALSA or so, if you want to ensure pulse isn't running you can use
systemctl --user mask pulseaudio.{service,socket} --now #unmask to revert
) if you can reproduce this on ALSA we have a lower level to look at but from what you are telling so far and from what I'm reading it seems to be a known problem with specific ryzen models that there can be audio interference on high cpu exhaustion (I do remember a thread here but I haven't been able to dig that up, but googling leads quite a few results, e.g.: https://www.reddit.com/r/MSI_Gaming/com … l_fix_for/ ).
You can definitely play with the niceness/rtprio values. fragments don't matter at all when timer based scheduling is used and timer based scheduling tends to work quite well with supported chips. If it's more consistently reproducible when paging through a big PDF file that might also be an issue with how CFS operates in it's default configuration, you might want to give something like linux-zen a shot that's more tuned towards desktop usecases.
What should I do if I want to revert back to the Gove or profile I had before? It's difficult for me to tell from the output from cpupower frequency-info and cpupower idle-info what the default setting is.
Offline
The default is schedutil, if you just install cpupower nothing changes, you have to actively switch that between performance or schedutil (there might be some other knobs to make the older ondemand scheduler available as well, but from the frequency-info output currently just schedutil is active.
Online
The default is schedutil, if you just install cpupower nothing changes, you have to actively switch that between performance or schedutil (there might be some other knobs to make the older ondemand scheduler available as well, but from the frequency-info output currently just schedutil is active.
I have the same fairly consistent popping when I change the governor from schedutil to performance (sudo cpupower frequency-set -g performance). I am unsure how to directly acess hw:1 via ALSA. Right now I run mpd systemwide using the workaround in the wiki to run mpd as its own user and to stream to 127.0.0.1 using pulseaudio. I'll install the linux-zen kernel and see if that helps.
EDIT:
Sound can be reproduced consistently by holding down the left and right arrow keys in a large pdf on qpdfview in both governor settings. Can be reproduced more successfully if I hold the left arrow key on the first page. Same procedure as before.
EDIT 2:
I installed the linux-zen kernel and I get the same thing. The output of uname -a is:
Linux Arch 5.6.15-zen2-1-zen #1 ZEN SMP PREEMPT Thu, 28 May 2020 16:49:25 +0000 x86_64 GNU/Linux
so I know I'm using it. Should I start changing the settings in the pulseaudio config files like tsched=0, fragment-size, priority, real-time scheduling etc. again? I have not changed those settings since my last post with the contents of the files.
EDIT 3:
Sorry for all the edits, but it appears that the popping/crackling is less frequent (less predictable) with the Zen Kernel while playing a song and paging through a large pdf. Sometimes it is difficult to tell the difference between interference and the mastering of a song. I'll keep this post up as unsolved as I do more tests.
Last edited by mjd119 (2020-06-01 18:33:32)
Offline
I am still having the issue but after doing some tests, I found that the issue is most pronounced and reproducible when I click back and forth between windows which does seem to increase CPU usage according to htop, but it doesn't seem like such a large jump to cause the pops/crackles but I am still unsure. I followed this guide: https://wiki.archlinux.org/index.php/Pu … g_playback to always keep sinks on since I am running KDE Plasma 5. I did not do the step where I edited the home directory file since that file does not exist and I want to run mpd systemwide as its own user (used workaround for Pulse Audio in Arch Wiki). My /etc/pulse/client.conf is now:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for PulseAudio clients. See pulse-client.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; default-sink =
; default-source =
; default-server =
; default-dbus-server =
autospawn = no
; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog
; cookie-file =
; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; auto-connect-localhost = no
; auto-connect-display = no
/etc/pulse/daemon.conf is:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no
; high-priority = yes
; nice-level = -11
; realtime-scheduling = yes
; realtime-priority = 9
; exit-idle-time = 20
; scache-idle-time = 20
; dl-search-path = (depends on architecture)
; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa
; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0
; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0
flat-volumes = no
; flat-volumes = yes
; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000
; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right
; default-fragments = 4
; default-fragment-size-msec = 25
; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0
/etc/pulse/default.pa is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
## tsched=0 added by mjd119 to disable timer-based scheduling
.ifexists module-udev-detect.so
#load-module module-udev-detect tsched=0
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-zeroconf-publish
# Added by mjd119 for pulse workaround for mpd (Arch Wiki)
#load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
# Added by mjd119 to allow audio access from everywhere (Arch Wiki)
load-module module-native-protocol-tcp auth-anonymous=true
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent pop when opening and closing windows (ArchWiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
## Commenting out prevents interruption of sound output from already runnning app (mjd119 Arch Wiki)
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
# Added by mjd119 to increase buffer for pulseaudio
#update-sink-proplist alsa_output.pci-0000_0b_00.4.analog-stereo device.buffering.buffer_size=1048576
and my /etc/pulse/system.pa is:
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started in system
# mode.
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev/hal support)
load-module module-detect
.endif
### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent cracks/pops when opening/closing windows (Arch Wiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### Enable positioned event sounds
load-module module-position-event-sounds
This most often occurs when I play FLAC files with mpd (will sometimes occur with audio from a web browser like Chromium but less common) so I'll include the /etc/mpd.conf to be safe:
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
# Modified from example (see https://www.youtube.com/watch?v=Jk8hn8xAgzo&t=58s [provided on Debian Buster])
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory "/home/{MY_USERNAME}/Music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory "/var/lib/mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file "/var/lib/mpd/tag_cache"
#
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog.
#
log_file "/var/log/mpd/mpd.log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file "/run/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server
# state will be reset on server start up.
#
state_file "/var/lib/mpd/state"
#
# The location of the sticker database. This is a database which
# manages dynamic information attached to songs.
#
sticker_file "/var/lib/mpd/sticker.sql"
#
###############################################################################
# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
user "mpd"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
group "mpd"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Not effective if
# systemd socket activiation is in use.
#
# For network
bind_to_address "0.0.0.0"
#
# And for Unix Socket
bind_to_address "/run/mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
port "6600"
#
# This setting controls the type of information which is logged. Available
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
log_level "default"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists "no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This example just enables the "comment" tag without disabling all
# the other supported tags:
#metadata_to_use "+comment"
#
# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
#auto_update "yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself. There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################
# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links outside of the configured music_directory.
#
follow_outside_symlinks "yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
follow_inside_symlinks "yes"
#
###############################################################################
# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled "yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network. %h will be replaced with the hostname.
#
#zeroconf_name "Music Player @ %h"
#
###############################################################################
# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# setting can be specified multiple times for different password profiles.
#
#password "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions "read,add,control,admin"
#
###############################################################################
# Database #######################################################################
#
#database {
# plugin "proxy"
# host "other.mpd.host"
# port "6600"
#}
# Input #######################################################################
#
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
#
###############################################################################
# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
#audio_output {
# type "alsa"
# name "My ALSA Device"
## device "hw:0,0" # optional
## mixer_type "hardware" # optional
## mixer_device "default" # optional
## mixer_control "PCM" # optional
## mixer_index "0" # optional
#}
#
# An example of an OSS output:
#
#audio_output {
# type "oss"
# name "My OSS Device"
## device "/dev/dsp" # optional
## mixer_type "hardware" # optional
## mixer_device "/dev/mixer" # optional
## mixer_control "PCM" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
# type "shout"
# encoder "vorbis" # optional
# name "My Shout Stream"
# host "localhost"
# port "8000"
# mount "/mpd.ogg"
# password "hackme"
# quality "5.0"
# bitrate "128"
# format "44100:16:1"
## protocol "icecast2" # optional
## user "source" # optional
## description "My Stream Description" # optional
## url "http://example.com" # optional
## genre "jazz" # optional
## public "no" # optional
## timeout "2" # optional
## mixer_type "software" # optional
#}
#
# An example of a recorder output:
#
#audio_output {
# type "recorder"
# name "My recorder"
# encoder "vorbis" # optional, vorbis or lame
# path "/var/lib/mpd/recorder/mpd.ogg"
## quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
# format "44100:16:1"
#}
#
# An example of a httpd output (built-in HTTP streaming server):
#
#audio_output {
# type "httpd"
# name "My HTTP Stream"
# # optional, vorbis or lame
# encoder "lame"
# port "8000"
# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
## quality "5.0" # do not define if bitrate is defined
# do not define if quality is defined
# bitrate "320"
# format "44100:16:1"
# max_clients "0" # optional 0=no limit
#}
#
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
#
audio_output {
type "pulse"
name "My Pulse Output"
server "127.0.0.1" # optional
## sink "remote_server_sink" # optional
}
#
# An example of a winmm output (Windows multimedia API).
#
#audio_output {
# type "winmm"
# name "My WinMM output"
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
# or
## device "0" # optional
## mixer_type "hardware" # optional
#}
#
# An example of an openal output.
#
#audio_output {
# type "openal"
# name "My OpenAL output"
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
#}
#
# An example of an sndio output.
#
#audio_output {
# type "sndio"
# name "sndio output"
# mixer_type "hardware"
#}
#
# An example of an OS X output:
#
#audio_output {
# type "osx"
# name "My OS X Device"
## device "Built-in Output" # optional
## channel_map "-1,-1,0,1" # optional
#}
#
## Example "pipe" output:
#
#audio_output {
# type "pipe"
# name "my pipe"
# command "aplay -f cd 2>/dev/null"
## Or if you're want to use AudioCompress
# command "AudioCompress -m | aplay -f cd 2>/dev/null"
## Or to send raw PCM stream through PCM:
# command "nc example.org 8765"
# format "44100:16:2"
#}
#
## An example of a null output (for no audio output):
#
#audio_output {
# type "null"
# name "My Null Output"
# mixer_type "none" # optional
#}
#
# Added by mjd119 for visualization (Arch Wiki)
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
###############################################################################
# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
# chooses between "track" and "album" depending on the current state of
# random playback. If random playback is enabled then "track" mode is used.
# See <http://www.replaygain.org> for more details about ReplayGain.
# This setting is off by default.
#
#replaygain "album"
#
# This setting sets the pre-amp used for files that have ReplayGain tags. By
# default this setting is disabled.
#
#replaygain_preamp "0"
#
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
# By default this setting is disabled.
#
#replaygain_missing_preamp "0"
#
# This setting enables or disables ReplayGain limiting.
# MPD calculates actual amplification based on the ReplayGain tags
# and replaygain_preamp / replaygain_missing_preamp setting.
# If replaygain_limit is enabled MPD will never amplify audio signal
# above its original level. If replaygain_limit is disabled such amplification
# might occur. By default this setting is enabled.
#
#replaygain_limit "yes"
#
# This setting enables on-the-fly normalization volume adjustment. This will
# result in the volume of all playing audio to be adjusted so the output has
# equal "loudness". This setting is disabled by default.
#
#volume_normalization "no"
#
###############################################################################
# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you
# may need to modify this setting.
#
#filesystem_charset "UTF-8"
#
###############################################################################
Would enabling the tsched=0 option in default.pa to disable timer-based scheduling be useful? Or changing the fragment or buffer options? It doesn't always occur when there is high cpu usage.
Offline
After more tests, I find I still have problems. I did the steps in this section of the wiki here https://wiki.archlinux.org/index.php/Pu … PulseAudio and here https://wiki.archlinux.org/index.php/Pu … g_playback (excluding the .config part) but I still get that dreaded popping sound. I get it most often when I switch between windows and virtual desktops in KDE. It seems to happen more often when I switch to an open qpdfview window but it's hard to tell. It sounds like there is static electricity that interrupts the playing audio. I am running the Zen kernel now as suggested by a user here, but I'll try the LTS kernel again and see if there's any benefit. At this point, I can't tell if it's software-related or hardware-related. Is the sound due to the sudden jump in cpu usage more so than the total percentage? Is it frequency related? I tried using cpupower and setting the governor to performance but it keeps coming back. Is it possible that qpdfview is the problem? Is it possible audio another application is "interrupting" pulseaudio? I'm running out of ideas. These are my settings at the moment with cpupower governor set to performance running the LTS kernel. Maybe there is some optimal mix of changes I may have missed. I kind of feel like I tried everything.
client.conf:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for PulseAudio clients. See pulse-client.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; default-sink =
; default-source =
; default-server =
; default-dbus-server =
autospawn = no
; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog
; cookie-file =
; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; auto-connect-localhost = no
; auto-connect-display = no
daemon.conf:
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out. Use either ; or # for
## commenting.
; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no
; high-priority = yes
; nice-level = -11
; realtime-scheduling = yes
; realtime-priority = 9
; exit-idle-time = 20
; scache-idle-time = 20
; dl-search-path = (depends on architecture)
; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa
; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0
; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0
flat-volumes = no
; flat-volumes = yes
; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000
; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right
; default-fragments = 3
; default-fragment-size-msec = 5
; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0
default.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
## tsched=0 added by mjd119 to disable timer-based scheduling
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-zeroconf-publish
# Added by mjd119 for pulse workaround for mpd (Arch Wiki)
#load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
# Added by mjd119 to allow audio access from everywhere (Arch Wiki)
load-module module-native-protocol-tcp auth-anonymous=true
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent pop when opening and closing windows (ArchWiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
## Commenting out prevents interruption of sound output from already runnning app (mjd119 Arch Wiki)
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
# Added by mjd119 to increase buffer for pulseaudio
#update-sink-proplist alsa_output.pci-0000_0b_00.4.analog-stereo device.buffering.buffer_size=1048576
system.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started in system
# mode.
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev/hal support)
load-module module-detect
.endif
### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Automatically suspend sinks/sources that become idle for too long
# Commented out by mjd119 to prevent cracks/pops when opening/closing windows (Arch Wiki)
# Commenting out prevents pulseaudio from suspending sinks
#load-module module-suspend-on-idle
### Enable positioned event sounds
load-module module-position-event-sounds
Last edited by mjd119 (2020-06-09 03:40:06)
Offline
To test one of my initial theories, what's your output for
lsmod
Online
To test one of my initial theories, what's your output for
lsmod
Module Size Used by
tun 57344 2
ip_set 57344 0
nfnetlink 16384 1 ip_set
iptable_security 16384 0
iptable_raw 16384 0
iptable_mangle 16384 0
iptable_nat 16384 0
msr 16384 0
uas 32768 0
usb_storage 86016 2 uas
cfg80211 905216 0
rfkill 32768 4 cfg80211
8021q 40960 0
garp 20480 1 8021q
mrp 20480 1 8021q
stp 16384 1 garp
llc 16384 2 stp,garp
amdgpu 5971968 47
nls_iso8859_1 16384 1
nls_cp437 20480 1
vfat 24576 1
fat 90112 1 vfat
edac_mce_amd 32768 0
fuse 151552 7
kvm_amd 122880 0
snd_hda_codec_realtek 151552 1
snd_hda_codec_generic 110592 1 snd_hda_codec_realtek
kvm 905216 1 kvm_amd
ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_codec_hdmi 81920 1
irqbypass 16384 1 kvm
gpu_sched 40960 1 amdgpu
snd_hda_intel 53248 9
i2c_algo_bit 16384 1 amdgpu
ttm 126976 1 amdgpu
snd_intel_dspcfg 28672 1 snd_hda_intel
crct10dif_pclmul 16384 1
snd_hda_codec 180224 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
crc32_pclmul 16384 0
wmi_bmof 16384 0
ghash_clmulni_intel 16384 0
drm_kms_helper 262144 1 amdgpu
snd_hda_core 114688 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
aesni_intel 368640 0
snd_hwdep 16384 1 snd_hda_codec
snd_pcm 163840 6 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
crypto_simd 16384 1 aesni_intel
cec 81920 1 drm_kms_helper
cryptd 28672 2 crypto_simd,ghash_clmulni_intel
glue_helper 16384 1 aesni_intel
r8169 126976 0
rc_core 61440 1 cec
snd_timer 45056 2 snd_pcm
joydev 28672 0
mousedev 24576 0
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
realtek 24576 1
sp5100_tco 20480 0
pcspkr 16384 0
fb_sys_fops 16384 1 drm_kms_helper
i2c_piix4 28672 0
k10temp 20480 0
ccp 118784 1 kvm_amd
libphy 151552 2 r8169,realtek
snd 114688 23 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm
soundcore 16384 1 snd
rng_core 20480 1 ccp
wmi 36864 1 wmi_bmof
pinctrl_amd 32768 0
acpi_cpufreq 28672 0
evdev 28672 19
input_leds 16384 0
mac_hid 16384 0
nf_log_ipv6 16384 0
ip6t_REJECT 16384 0
nf_reject_ipv6 20480 1 ip6t_REJECT
xt_hl 16384 0
ip6t_rt 20480 0
nf_log_ipv4 16384 0
nf_log_common 16384 2 nf_log_ipv4,nf_log_ipv6
ipt_REJECT 16384 0
nf_reject_ipv4 16384 1 ipt_REJECT
xt_LOG 20480 0
xt_limit 16384 0
xt_addrtype 16384 0
xt_tcpudp 20480 6
xt_conntrack 16384 7
ip6table_filter 16384 1
ip6_tables 36864 1 ip6table_filter
nf_conntrack_netbios_ns 16384 0
nf_conntrack_broadcast 16384 1 nf_conntrack_netbios_ns
nf_nat_ftp 20480 0
nf_nat 53248 2 nf_nat_ftp,iptable_nat
nf_conntrack_ftp 24576 1 nf_nat_ftp
nf_conntrack 180224 6 xt_conntrack,nf_nat,nf_nat_ftp,nf_conntrack_netbios_ns,nf_conntrack_broadcast,nf_conntrack_ftp
nf_defrag_ipv6 24576 1 nf_conntrack
nf_defrag_ipv4 16384 1 nf_conntrack
libcrc32c 16384 2 nf_conntrack,nf_nat
iptable_filter 16384 1
vboxnetflt 32768 0
vboxnetadp 28672 0
drm 626688 15 gpu_sched,drm_kms_helper,amdgpu,ttm
vboxdrv 548864 2 vboxnetadp,vboxnetflt
i2c_dev 24576 0
crypto_user 16384 0
agpgart 53248 2 ttm,drm
ip_tables 36864 5 iptable_filter,iptable_security,iptable_raw,iptable_nat,iptable_mangle
x_tables 57344 16 ip6table_filter,xt_conntrack,iptable_filter,iptable_security,xt_LOG,xt_tcpudp,xt_addrtype,ip6t_rt,ip6_tables,ipt_REJECT,iptable_raw,ip_tables,xt_limit,xt_hl,ip6t_REJECT,iptable_mangle
ext4 823296 3
crc32c_generic 16384 0
crc16 16384 1 ext4
mbcache 16384 1 ext4
jbd2 143360 1 ext4
hid_generic 16384 0
usbhid 65536 0
hid 151552 2 usbhid,hid_generic
crc32c_intel 24576 7
xhci_pci 20480 0
xhci_hcd 303104 1 xhci_pci
Offline
sudo modprobe -r k10temp
Also when the error occurs do you get any messages in dmesg and/or
journalctl -b --user-unit=pulseaudio
Last edited by V1del (2020-06-09 19:39:56)
Online
sudo modprobe -r k10temp
I ran that and restarted pulseaudio and there's a loud popping sound when I click back and forth between a terminal window (termite) and qpdfview while playing audio from mpd. It's arguably worse. Should I restart the computer? Cpupower is set to performance if that's relevant.
Offline
sudo modprobe -r k10temp
Also when the error occurs do you get any messages in dmesg and/or
journalctl -b --user-unit=pulseaudio
I get this:
-- Logs begin at Wed 2020-05-06 12:43:56 EDT, end at Tue 2020-06-09 16:47:25 EDT. --
Jun 09 16:27:26 Arch systemd[895]: Starting Sound Service...
Jun 09 16:27:26 Arch systemd[895]: Started Sound Service.
I replicated the pops multiple times clicking back and forth between termite and qpdfview while mpd plays music.
EDIT:
It also happens when playing audio on chromium through youtube.
Last edited by mjd119 (2020-06-09 23:40:29)
Offline