From 21f8635c982d4d86e88fcad8e7b94b087641fb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 3 Jan 2022 15:27:09 +0100 Subject: Mon Jan 3 03:27:09 PM CET 2022 --- .bin/sync-public-dotfiles | 1 + .config/pipewire/pipewire-pulse.conf | 37 ++++++++++++++++++++++++++++++++++++ .config/pipewire/pipewire-pulse.sh | 21 ++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100755 .config/pipewire/pipewire-pulse.conf create mode 100755 .config/pipewire/pipewire-pulse.sh diff --git a/.bin/sync-public-dotfiles b/.bin/sync-public-dotfiles index 7bff64f..5a6e795 100755 --- a/.bin/sync-public-dotfiles +++ b/.bin/sync-public-dotfiles @@ -19,6 +19,7 @@ allowed_patterns="-e ^.bin -e ^.config/nvim/ -e ^.config/qutebrowser/config.py -e ^.config/qutebrowser/greasemonkey/ + -e ^.config/pipewire/ -e ^.config/sway/config -e ^.config/systemd/*.service -e ^.config/user-dirs.dir diff --git a/.config/pipewire/pipewire-pulse.conf b/.config/pipewire/pipewire-pulse.conf new file mode 100755 index 0000000..a8f7dd3 --- /dev/null +++ b/.config/pipewire/pipewire-pulse.conf @@ -0,0 +1,37 @@ +context.properties = { +} + +context.spa-libs = { + audio.convert.* = audioconvert/libspa-audioconvert + support.* = support/libspa-support +} + +context.modules = [ + { name = libpipewire-module-rtkit + args = { + } + 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 = { + server.address = [ + "unix:native" + ] + vm.overrides = { + pulse.min.quantum = 1024/48000 # 22ms + } + } + } +] + +stream.properties = { +} + +context.exec = [ + { path = "/bin/sh" args = "/home/qwd/.config/pipewire/pipewire-pulse.sh" } +] diff --git a/.config/pipewire/pipewire-pulse.sh b/.config/pipewire/pipewire-pulse.sh new file mode 100755 index 0000000..aff3a23 --- /dev/null +++ b/.config/pipewire/pipewire-pulse.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +sleep 3 + +source_name="master-mono" + +source_index=$(pactl list short sources | + grep "input.*pci-" | + head -n 1 | + awk '{print $1;}') + +echo "${source_index}" + +pactl load-module module-remap-source \ + "source_name=${source_name}" \ + "master=${source_index}" \ + channels=1 \ + master_channel_map=front-left \ + channel_map=mono + +pactl set-default-source "${source_name}" -- cgit v1.2.3