Skip to content

Instantly share code, notes, and snippets.

@leleobhz
Created February 16, 2023 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leleobhz/020b154df4116aae6688eb62d95ba78b to your computer and use it in GitHub Desktop.
Save leleobhz/020b154df4116aae6688eb62d95ba78b to your computer and use it in GitHub Desktop.
Pipewire to respect board sample-rates and realtime.
--- /dev/null 2023-02-16 09:56:49.926039011 -0300
+++ ~/.config/pipewire/pipewire.conf.d/client.conf 2023-02-16 11:24:56.594194607 -0300
@@ -0,0 +1,25 @@
+# Client config file for PipeWire version "0.3.65" #
+#
+# Copy and edit this file in /etc/pipewire for system-wide changes
+# or in ~/.config/pipewire for local changes.
+#
+# It is also possible to place a file with an updated section in
+# /etc/pipewire/client.conf.d/ for system-wide changes or in
+# ~/.config/pipewire/client.conf.d/ for local changes.
+#
+
+stream.properties = {
+ #node.latency = 1024/48000
+ #node.autoconnect = true
+ resample.quality = 15
+ #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.hilbert-taps = 0
+ #dither.noise = 0
+}
--- /dev/null 2023-02-16 09:56:49.926039011 -0300
+++ ~/.config/pipewire/pipewire.conf.d/pipewire.conf 2023-02-16 11:36:27.950698779 -0300
@@ -0,0 +1,46 @@
+# Simple daemon config file for PipeWire version "0.3.65" #
+#
+# Copy and edit this file in /etc/pipewire for system-wide changes
+# or in ~/.config/pipewire for local changes.
+#
+# It is also possible to place a file with an updated section in
+# /etc/pipewire/minimal.conf.d/ for system-wide changes or in
+# ~/.config/pipewire/minimal.conf.d/ for local changes.
+#
+
+context.properties = {
+ ## Properties for the DSP configuration.
+ default.clock.rate = 192000
+ # Get hardware rates with
+ # grep -A1 Default\ PCM: /proc/asound/card*/codec#0 | awk -F: '{print $2}'
+ default.clock.allowed-rates = [ 32000 44100 48000 88200 96000 192000 ]
+ #default.clock.rate = 48000
+ #default.clock.allowed-rates = [ 48000 ]
+ #default.clock.quantum = 1024
+ #default.clock.min-quantum = 32
+ #default.clock.max-quantum = 2048
+ #default.clock.quantum-limit = 8192
+ #default.video.width = 640
+ #default.video.height = 480
+ #default.video.rate.num = 25
+ #default.video.rate.denom = 1
+ #
+ settings.check-quantum = true
+ settings.check-rate = true
+}
+
+
+context.modules = [
+ # Uses realtime scheduling to boost the audio thread priorities. This uses
+ # RTKit if the user doesn't have permission to use regular realtime
+ # scheduling.
+ { name = libpipewire-module-rt
+ args = {
+ nice.level = -11
+ rt.prio = 88
+ rt.time.soft = -1
+ rt.time.hard = -1
+ }
+ flags = [ ifexists nofail ]
+ }
+]
--- /dev/null 2023-02-16 09:56:49.926039011 -0300
+++ ~/.config/pipewire/pipewire.conf.d/pipewire-pulse.conf 2023-02-16 11:25:04.156079840 -0300
@@ -0,0 +1,25 @@
+# PulseAudio config file for PipeWire version "0.3.65" #
+#
+# Copy and edit this file in /etc/pipewire for system-wide changes
+# or in ~/.config/pipewire for local changes.
+#
+# It is also possible to place a file with an updated section in
+# /etc/pipewire/pipewire-pulse.conf.d/ for system-wide changes or in
+# ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
+#
+
+stream.properties = {
+ #node.latency = 1024/48000
+ #node.autoconnect = true
+ resample.quality = 15
+ #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.hilbert-taps = 0
+ #dither.noise = 0
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment