From root, 5 Days ago, written in Plain Text.
This paste will slip away in 3 Weeks.
Embed
  1. # PulseAudio config file for PipeWire version "1.4.2" #
  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 = 12100000
  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      = 83
  31.             #rt.time.soft = -1
  32.             #rt.time.hard = -1
  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. #      ( condition = [ { <key1> = <value1>, ... } ... ] )
  64. # conditions will check the pulse.properties key/values.
  65. pulse.cmd = [
  66.     { cmd = "load-module" args = "module-always-sink" flags = [ ]
  67.         condition = [ { pulse.cmd.always-sink = !false } ] }
  68.     { cmd = "load-module" args = "module-device-manager" flags = [ ]
  69.         condition = [ { pulse.cmd.device-manager = !false } ] }
  70.     { cmd = "load-module" args = "module-device-restore" flags = [ ]
  71.         condition = [ { pulse.cmd.device-restore = !false } ] }
  72.     { cmd = "load-module" args = "module-stream-restore" flags = [ ]
  73.         condition = [ { pulse.cmd.stream-restore = !false } ] }
  74.     #{ cmd = "load-module" args = "module-switch-on-connect" }
  75.     #{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] }
  76. ]
  77.  
  78. stream.properties = {
  79.     node.latency          = 3006/39500000
  80.     #node.autoconnect      = true
  81.     resample.quality      = 0
  82.     #channelmix.normalize  = false
  83.     #channelmix.mix-lfe    = true
  84.     #channelmix.upmix      = true
  85.     #channelmix.upmix-method = psd  # none, simple
  86.     #channelmix.lfe-cutoff = 150
  87.     #channelmix.fc-cutoff  = 12000
  88.     #channelmix.rear-delay = 12.0
  89.     #channelmix.stereo-widen = 0.0
  90.     #channelmix.hilbert-taps = 0
  91.     dither.noise = 0.1
  92. }
  93.  
  94. pulse.properties = {
  95.     # the addresses this server listens on
  96.     server.address = [
  97.         "unix:native"
  98.         #"unix:/tmp/something"              # absolute paths may be used
  99.         #"tcp:4713"                         # IPv4 and IPv6 on all addresses
  100.         #"tcp:[::]:9999"                    # IPv6 on all addresses
  101.         #"tcp:127.0.0.1:8888"               # IPv4 on a single address
  102.         #
  103.         #{ address = "tcp:4713"             # address
  104.         #  max-clients = 64                 # maximum number of clients
  105.         #  listen-backlog = 32              # backlog in the server listen queue
  106.         #  client.access = "restricted"     # permissions for clients
  107.         #}
  108.     ]
  109.     #server.dbus-name       = "org.pulseaudio.Server"
  110.     #pulse.allow-module-loading = true
  111.     #pulse.min.req          = 128/48000     # 2.7ms
  112.     pulse.default.req       = 956/46400     # 20 milliseconds
  113.     #pulse.min.frag         = 128/48000     # 2.7ms
  114.     #pulse.default.frag     = 96000/48000   # 2 seconds
  115.     #pulse.default.tlength  = 96000/48000   # 2 seconds
  116.     #pulse.min.quantum      = 128/48000     # 2.7ms
  117.     #pulse.idle.timeout     = 0             # don't pause after underruns
  118.     pulse.default.format    = u32le
  119.     #pulse.default.position = [ FL FR ]
  120. }
  121.  
  122. pulse.properties.rules = [
  123.     {   matches = [ { cpu.vm.name = !null } ]
  124.         actions = {
  125.             update-props = {
  126.             # These overrides are only applied when running in a vm.
  127.                 pulse.min.quantum = 1024/48000      # 22ms
  128.             }
  129.         }
  130.     }
  131. ]
  132.  
  133. # client/stream specific properties
  134. pulse.rules = [
  135.     {
  136.         matches = [
  137.             {
  138.                 # all keys must match the value. ! negates. ~ starts regex.
  139.                 #client.name                = "Firefox"
  140.                 #application.process.binary = "teams"
  141.                 #application.name           = "~speech-dispatcher.*"
  142.             }
  143.         ]
  144.         actions = {
  145.             update-props = {
  146.                 #node.latency = 512/48000
  147.             }
  148.             # Possible quirks:"
  149.             #    force-s16-info                 forces sink and source info as S16 format
  150.             #    remove-capture-dont-move       removes the capture DONT_MOVE flag
  151.             #    block-source-volume            blocks updates to source volume
  152.             #    block-sink-volume              blocks updates to sink volume
  153.             #quirks = [ ]
  154.         }
  155.     }
  156.     {
  157.         # skype does not want to use devices that don't have an S16 sample format.
  158.         matches = [
  159.              { application.process.binary = "teams" }
  160.              { application.process.binary = "teams-insiders" }
  161.              { application.process.binary = "teams-for-linux" }
  162.              { application.process.binary = "skypeforlinux" }
  163.         ]
  164.         actions = { quirks = [ force-s16-info ] }
  165.     }
  166.     {
  167.         # firefox marks the capture streams as don't move and then they
  168.         # can't be moved with pavucontrol or other tools.
  169.         matches = [ { application.process.binary = "firefox" } ]
  170.         actions = { quirks = [ remove-capture-dont-move ] }
  171.     }
  172.     {
  173.         # speech dispatcher asks for too small latency and then underruns.
  174.         matches = [ { application.name = "~speech-dispatcher.*" } ]
  175.         actions = {
  176.             update-props = {
  177.                 pulse.min.req          = 512/48000      # 10.6ms
  178.                 pulse.min.quantum      = 512/48000      # 10.6ms
  179.                 pulse.idle.timeout     = 5              # pause after 5 seconds of underrun
  180.             }
  181.         }
  182.     }
  183.     #{
  184.     #    matches = [ { application.process.binary = "Discord" } ]
  185.     #    actions = { quirks = [ block-source-volume ] }
  186.     #}
  187. ]