summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-09-24 16:57:18 +0200
committerlassulus <lassulus@lassul.us>2021-09-24 16:57:18 +0200
commitf636869f26513deff75470d5e750a06d2b7b24e0 (patch)
tree94e6c903d3844265d86cf78a0705fa5ca0e59a0c
parent9472181f2880c3558fcc80439cd9b92ef2b3b086 (diff)
l: switch from pulse to pipewire
-rw-r--r--lass/2configs/baseX.nix11
-rw-r--r--lass/2configs/pipewire.nix72
2 files changed, 74 insertions, 9 deletions
diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix
index 655e7912f..23eaa2802 100644
--- a/lass/2configs/baseX.nix
+++ b/lass/2configs/baseX.nix
@@ -10,14 +10,7 @@ in {
./urxvt.nix
./xdg-open.nix
./yubikey.nix
- {
- hardware.pulseaudio = {
- enable = true;
- systemWide = true;
- };
- security.rtkit.enable = true;
- sound.enableOSSEmulation = false;
- }
+ ./pipewire.nix
./xmonad.nix
{
krebs.per-user.lass.packages = [
@@ -50,7 +43,7 @@ in {
}
];
- users.extraUsers.mainUser.extraGroups = [ "audio" "video" ];
+ users.users.mainUser.extraGroups = [ "audio" "video" ];
time.timeZone = "Europe/Berlin";
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;
+ };
+ };
+ };
+}