pipewire/src/daemon/pipewire-pulse.conf.in
Wim Taymans 13c5e3c756 pulse-server: add a pulse.zeroramp.gap property
Add a new pulse.zeroramp.gap property that will enable gap detection and
fade-in/fade-out on gaps on playback streams.

Make a rule to enable this on chrome, which does not do a cork/pause
when a stream is paused but sends out silence. With the gap detection
enabled, this allows the audioconvert to perform fades to avoid pops and
clocks from sudden DC changes at the gaps.

Fixes #4745
2026-06-17 17:17:54 +02:00

222 lines
8.4 KiB
Text

# PulseAudio config file for PipeWire version @VERSION@ #
#
# Copy and edit this file in @PIPEWIRE_CONFIG_DIR@ for system-wide changes
# or in ~/.config/pipewire for local changes.
#
# It is also possible to place a file with an updated section in
# @PIPEWIRE_CONFIG_DIR@/pipewire-pulse.conf.d/ for system-wide changes or in
# ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
#
context.properties = {
## Configure properties in the system.
#mem.warn-mlock = false
#mem.allow-mlock = true
#mem.mlock-all = false
#log.level = 2
#rlimit.nofile = -1
#library.use-fallback = true
#default.clock.quantum-limit = 8192
}
context.spa-libs = {
support.* = support/libspa-support
audio.convert.* = audioconvert/libspa-audioconvert
audio.adapt = audioconvert/libspa-audioconvert
audio.mixer = audiomixer/libspa-audiomixer
audio.aec = aec/libspa-aec-webrtc
# because the pulse server allows dynamic loading of streams and modules
# inside the server, we must be careful with the filter-graph.
#filter.graph.plugin.ffmpeg = filter-graph/libspa-filter-graph-plugin-ffmpeg
#filter.graph.plugin.onnx = filter-graph/libspa-filter-graph-plugin-onnx
#filter.graph.plugin.ebur128 = filter-graph/libspa-filter-graph-plugin-ebur128
#filter.graph.plugin.sofa = filter-graph/libspa-filter-graph-plugin-sofa
filter.graph.plugin.ladspa = filter-graph/libspa-filter-graph-plugin-ladspa
#filter.graph.plugin.lv2 = filter-graph/libspa-filter-graph-plugin-lv2
filter.graph.plugin.builtin = filter-graph/libspa-filter-graph-plugin-builtin
filter.graph = filter-graph/libspa-filter-graph
}
context.modules = [
{ name = libpipewire-module-rt
args = {
nice.level = -11
#rt.prio = @rtprio_client@
#rt.time.soft = -1
#rt.time.hard = -1
#rlimits.enabled = true
rtportal.enabled = false
#rtkit.enabled = true
#uclamp.min = 0
#uclamp.max = 1024
}
flags = [ ifexists nofail ]
}
{ name = libpipewire-module-protocol-native }
{ name = libpipewire-module-client-node }
{ name = libpipewire-module-adapter }
{ name = libpipewire-module-metadata }
{ name = libpipewire-module-protocol-pulse
args = {
# contents of pulse.properties can also be placed here
# to have config per server.
}
}
]
# Extra scripts can be started here. Setup in default.pa can be moved in
# a script or in pulse.cmd below
context.exec = [
#{ path = "pactl" args = "load-module module-always-sink" }
#{ path = "pactl" args = "upload-sample my-sample.wav my-sample" }
#{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" }
]
# Extra commands can be executed here.
# load-module : loads a module with args and flags
# args = "<module-name> <module-args>"
# ( flags = [ nofail ] )
# ( condition = [ { <key1> = <value1>, ... } ... ] )
# conditions will check the pulse.properties key/values.
pulse.cmd = [
{ cmd = "load-module" args = "module-always-sink" flags = [ ]
condition = [ { pulse.cmd.always-sink = !false } ] }
{ cmd = "load-module" args = "module-device-manager" flags = [ ]
condition = [ { pulse.cmd.device-manager = !false } ] }
{ cmd = "load-module" args = "module-device-restore" flags = [ ]
condition = [ { pulse.cmd.device-restore = !false } ] }
{ cmd = "load-module" args = "module-stream-restore" flags = [ ]
condition = [ { pulse.cmd.stream-restore = !false } ] }
#{ cmd = "load-module" args = "module-switch-on-connect" }
#{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] }
]
stream.properties = {
#node.latency = 1024/48000
#node.autoconnect = true
#resample.quality = 4
#channelmix.normalize = false
#channelmix.mix-lfe = true
#channelmix.upmix = true
#channelmix.upmix-method = psd # none, simple
#channelmix.lfe-cutoff = 150
#channelmix.fc-cutoff = 12000
#channelmix.rear-delay = 12.0
#channelmix.stereo-widen = 0.0
#channelmix.center-level = 0.707106781
#channelmix.surround-level = 0.707106781
#channelmix.lfe-level = 0.5
#channelmix.hilbert-taps = 0
#dither.noise = 0
#zeroramp.gap = 0
#zeroramp.duration = 0.005
}
pulse.properties = {
# the addresses this server listens on
server.address = [
"unix:native"
#"unix:/tmp/something" # absolute paths may be used
#"tcp:4713" # IPv4 and IPv6 on all addresses
#"tcp:[::]:9999" # IPv6 on all addresses
#"tcp:127.0.0.1:8888" # IPv4 on a single address
#
#{ address = "tcp:4713" # address
# max-clients = 64 # maximum number of clients
# listen-backlog = 32 # backlog in the server listen queue
# client.access = "restricted" # permissions for clients
#}
]
#server.dbus-name = "org.pulseaudio.Server"
#pulse.allow-module-loading = true
#pulse.min.req = 256/48000 # 5.3ms
#pulse.default.req = 960/48000 # 20 milliseconds
#pulse.min.frag = 256/48000 # 5.3ms
#pulse.default.frag = 96000/48000 # 2 seconds
#pulse.default.tlength = 96000/48000 # 2 seconds
#pulse.min.quantum = 256/48000 # 5.3ms
#pulse.idle.timeout = 0 # don't pause after underruns
#pulse.max-streams = 64 # max streams per client
#pulse.max-sample-cache = 67108864 # max total sample cache size (64MB)
#pulse.default.format = F32
#pulse.default.position = [ FL FR ]
#pulse.zeroramp.gap = 0 # detect silence of N samples and fade-in/out
}
pulse.properties.rules = [
{ matches = [ { cpu.vm.name = !null } ]
actions = {
update-props = {
# These overrides are only applied when running in a vm.
pulse.min.quantum = 1024/48000 # 22ms
}
}
}
]
# client/stream specific properties
pulse.rules = [
{
matches = [
{
# all keys must match the value. ! negates. ~ starts regex.
#client.name = "Firefox"
#application.process.binary = "teams"
#application.name = "~speech-dispatcher.*"
}
]
actions = {
update-props = {
#node.latency = 512/48000
}
# Possible quirks:"
# force-s16-info forces sink and source info as S16 format
# remove-capture-dont-move removes the capture DONT_MOVE flag
# block-source-volume blocks updates to source volume
# block-sink-volume blocks updates to sink volume
#quirks = [ ]
}
}
{
# skype does not want to use devices that don't have an S16 sample format.
matches = [
{ application.process.binary = "teams" }
{ application.process.binary = "teams-insiders" }
{ application.process.binary = "teams-for-linux" }
{ application.process.binary = "skypeforlinux" }
]
actions = { quirks = [ force-s16-info ] }
}
{
# firefox marks the capture streams as don't move and then they
# can't be moved with pavucontrol or other tools.
matches = [ { application.process.binary = "firefox" } ]
actions = { quirks = [ remove-capture-dont-move ] }
}
{
# speech dispatcher asks for too small latency and then underruns.
matches = [ { application.name = "~speech-dispatcher.*" } ]
actions = {
update-props = {
pulse.min.req = 512/48000 # 10.6ms
pulse.min.quantum = 512/48000 # 10.6ms
pulse.idle.timeout = 5 # pause after 5 seconds of underrun
}
}
}
#{
# matches = [ { application.process.binary = "Discord" } ]
# actions = { quirks = [ block-source-volume ] }
#}
{
matches = [ { application.process.binary = "chrome" } ]
actions = {
update-props = {
pulse.zeroramp.gap = 8
}
}
}
]