NauTiluS1

pipewire-pulse.conf

Dec 4th, 2025
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.80 KB | None | 0 0
  1. # PulseAudio config file for PipeWire version "1.2.0" #
  2. #
  3. # Copy and edit this file in /etc/pipewire for system-wide changes
  4. # or in ~/.config/pipewire for local changes.
  5. #
  6. # It is also possible to place a file with an updated section in
  7. # /etc/pipewire/pipewire-pulse.conf.d/ for system-wide changes or in
  8. # ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
  9. #
  10.  
  11. context.properties = {
  12.     ## Configure properties in the system.
  13.     #mem.warn-mlock  = false
  14.     #mem.allow-mlock = true
  15.     #mem.mlock-all   = false
  16.     log.level       = 2
  17.  
  18.     #default.clock.quantum-limit = 8192
  19. }
  20.  
  21. context.spa-libs = {
  22.     audio.convert.* = audioconvert/libspa-audioconvert
  23.     support.*       = support/libspa-support
  24. }
  25.  
  26. context.modules = [
  27.     { name = libpipewire-module-rt
  28.         args = {
  29.            nice.level   = -11
  30.            rt.prio      = 90
  31.            rt.time.soft = 200000
  32.            rt.time.hard = 200000
  33.             #uclamp.min = 0
  34.             #uclamp.max = 1024
  35.         }
  36.         flags = [ ifexists nofail ]
  37.     }
  38.     { name = libpipewire-module-protocol-native }
  39.     { name = libpipewire-module-client-node }
  40.     { name = libpipewire-module-adapter }
  41.     { name = libpipewire-module-metadata }
  42.  
  43.     { name = libpipewire-module-protocol-pulse
  44.         args = {
  45.         # contents of pulse.properties can also be placed here
  46.         # to have config per server.
  47.         }
  48.     }
  49. ]
  50.  
  51. # Extra scripts can be started here. Setup in default.pa can be moved in
  52. # a script or in pulse.cmd below
  53. context.exec = [
  54.     #{ path = "pactl"        args = "load-module module-always-sink" }
  55.     #{ path = "pactl"        args = "upload-sample my-sample.wav my-sample" }
  56.     #{ path = "/usr/bin/sh"  args = "~/.config/pipewire/default.pw" }
  57. ]
  58.  
  59. # Extra commands can be executed here.
  60. #   load-module : loads a module with args and flags
  61. #      args = "<module-name> <module-args>"
  62. #      ( flags = [ nofail ] )
  63. pulse.cmd = [
  64.     { cmd = "load-module" args = "module-always-sink" flags = [ ] }
  65.     { cmd = "load-module" args = "module-device-manager" flags = [ ] }
  66.     { cmd = "load-module" args = "module-device-restore" flags = [ ] }
  67.     { cmd = "load-module" args = "module-stream-restore" flags = [ ] }
  68.     #{ cmd = "load-module" args = "module-switch-on-connect" }
  69.     #{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] }
  70. ]
  71.  
  72. stream.properties = {
  73.    node.latency          = 1024/96000
  74.    node.autoconnect      = true
  75.     #resample.quality      = 4
  76.     #channelmix.normalize  = false
  77.     #channelmix.mix-lfe    = true
  78.     channelmix.upmix      = true
  79.     channelmix.upmix-method = psd  # none, simple
  80.     channelmix.lfe-cutoff = 150
  81.     channelmix.fc-cutoff  = 12000
  82.     channelmix.rear-delay = 12.0
  83.     #channelmix.stereo-widen = 0.0
  84.     #channelmix.hilbert-taps = 0
  85.     dither.noise = 0
  86.     dither.method = 6
  87.     channels = 6
  88.     channel-map = [front-left,front-right,rear-left,rear-right,front-center,lfe]
  89. }
  90.  
  91. pulse.properties = {
  92.     # the addresses this server listens on
  93.     server.address = [
  94.         "unix:native"
  95.         #"unix:/tmp/something"              # absolute paths may be used
  96.         #"tcp:4713"                         # IPv4 and IPv6 on all addresses
  97.         #"tcp:[::]:9999"                    # IPv6 on all addresses
  98.         #"tcp:127.0.0.1:8888"               # IPv4 on a single address
  99.         #
  100.         #{ address = "tcp:4713"             # address
  101.         #  max-clients = 64                 # maximum number of clients
  102.         #  listen-backlog = 32              # backlog in the server listen queue
  103.         #  client.access = "restricted"     # permissions for clients
  104.         #}
  105.     ]
  106.      server.dbus-name       = "org.pulseaudio.Server"
  107.     #pulse.allow-module-loading = true
  108. # pulse.min.req          = 256/96000     # 2.7ms
  109.      pulse.min.req          = 64/96000
  110.     #pulse.default.req      = 960/48000     # 20 milliseconds
  111. #  pulse.min.frag         = 256/96000     # 2.7ms
  112. # Update on December 25th 2024
  113. #pulse.min.frag      = 2
  114.       pulse.min.frag      = 128
  115.       pulse.max.frag      = 256
  116. #  pulse.max.frag      = 4
  117.     #pulse.default.frag     = 96000/48000   # 2 seconds
  118.     #pulse.default.tlength  = 96000/48000   # 2 seconds
  119.     #pulse.min.quantum      = 128/48000     # 2.7ms
  120.     #pulse.idle.timeout     = 0             # don't pause after underruns
  121.      pulse.default.format   = F32 # High audio quality
  122.      pulse.default.position = [ FL FR RL RR RC LFE ]
  123. }
  124.  
  125. pulse.properties.rules = [
  126.     {   matches = [ { cpu.vm.name = !null } ]
  127.         actions = {
  128.             update-props = {
  129.             # These overrides are only applied when running in a vm.
  130.                 pulse.min.quantum = 1024/48000      # 22ms
  131.         }
  132.         }
  133.     }
  134. ]
  135.  
  136. # client/stream specific properties
  137. pulse.rules = [
  138.     {
  139.         matches = [
  140.             {
  141.                 # all keys must match the value. ! negates. ~ starts regex.
  142.                 #client.name                = "Firefox"
  143.                 #application.process.binary = "teams"
  144.                 #application.name           = "~speech-dispatcher.*"
  145.             }
  146.         ]
  147.         actions = {
  148.             update-props = {
  149.                 #node.latency = 512/48000
  150.             }
  151.             # Possible quirks:"
  152.             #    force-s16-info                 forces sink and source info as S16 format
  153.             #    remove-capture-dont-move       removes the capture DONT_MOVE flag
  154.             #    block-source-volume            blocks updates to source volume
  155.             #    block-sink-volume              blocks updates to sink volume
  156.             #quirks = [ ]
  157.         }
  158.     }
  159.     {
  160.         # skype does not want to use devices that don't have an S16 sample format.
  161.         matches = [
  162.              { application.process.binary = "teams" }
  163.              { application.process.binary = "teams-insiders" }
  164.              { application.process.binary = "skypeforlinux" }
  165.         ]
  166.         actions = { quirks = [ force-s16-info ] }
  167.     }
  168.     {
  169.         # firefox marks the capture streams as don't move and then they
  170.         # can't be moved with pavucontrol or other tools.
  171.         matches = [ { application.process.binary = "firefox" } ]
  172.         actions = { quirks = [ remove-capture-dont-move ] }
  173.     }
  174.     {
  175.         # speech dispatcher asks for too small latency and then underruns.
  176.         matches = [ { application.name = "~speech-dispatcher.*" } ]
  177.         actions = {
  178.             update-props = {
  179.                 pulse.min.req          = 512/48000      # 10.6ms
  180.                 pulse.min.quantum      = 512/48000      # 10.6ms
  181.                 pulse.idle.timeout     = 5              # pause after 5 seconds of underrun
  182.             }
  183.         }
  184.     }
  185.     #{
  186.     #    matches = [ { application.process.binary = "Discord" } ]
  187.     #    actions = { quirks = [ block-source-volume ] }
  188.     #}
  189. ]
  190.  
Advertisement
Add Comment
Please, Sign In to add comment