summaryrefslogtreecommitdiffstats
path: root/lass/2configs/pipewire.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-09-28 22:48:17 +0200
committertv <tv@krebsco.de>2021-09-28 22:48:17 +0200
commited2c6bd9792afbc433ae4eb23f40e17b90420f99 (patch)
tree289de32dd7f58f46accf7ad25ed184db5aa45198 /lass/2configs/pipewire.nix
parent20e358043546482acfa8c6134f095c1a64ef144d (diff)
parente151cfd3298120ec541987d4beb155e18335a0d8 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/2configs/pipewire.nix')
-rw-r--r--lass/2configs/pipewire.nix72
1 files changed, 72 insertions, 0 deletions
diff --git a/lass/2configs/pipewire.nix b/lass/2configs/pipewire.nix
new file mode 100644
index 000000000..8fdcff4e3
--- /dev/null
+++ b/lass/2configs/pipewire.nix
@@ -0,0 +1,72 @@
+{ config, lib, pkgs, ... }:
+# TODO test `alsactl init` after suspend to reinit mic
+{
+ security.rtkit.enable = true;
+
+ hardware.bluetooth = {
+ enable = true;
+ powerOnBoot = true;
+ };
+
+ # autostart with login
+ systemd.user.services.pipewire-pulse = {
+ wantedBy = [ "graphical-session.target" ];
+ };
+
+ environment.systemPackages = with pkgs; [
+ alsaUtils
+ pulseaudioLight
+ ];
+
+ environment.variables.PULSE_SERVER = "localhost:4713";
+ services.pipewire = {
+ enable = true;
+ socketActivation = false;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ jack.enable = true;
+ # https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Migrate-PulseAudio#module-native-protocol-tcp
+ config.pipewire-pulse = {
+ "context.properties" = {
+ "log.level" = 2;
+ };
+ "context.modules" = [
+ {
+ name = "libpipewire-module-rtkit";
+ # args = {
+ # "nice.level" = -15;
+ # "rt.prio" = 88;
+ # "rt.time.soft" = 200000;
+ # "rt.time.hard" = 200000;
+ # };
+ 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 = {
+ "vm.overrides" = {
+ # "pulse.min.req" = "32/48000";
+ # "pulse.default.req" = "32/48000";
+ # "pulse.max.req" = "32/48000";
+ "pulse.min.quantum" = "1024/48000";
+ # "pulse.max.quantum" = "32/48000";
+ };
+ "server.address" = [
+ "unix:native"
+ "tcp:4713"
+ ];
+ };
+ }
+ ];
+ "stream.properties" = {
+ # "node.latency" = "32/48000";
+ # "resample.quality" = 1;
+ };
+ };
+ };
+}