From 6042f660fb3af2a52f5cf350cb9e1a164f5a8332 Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Tue, 21 Nov 2023 02:31:28 +0100 Subject: [PATCH] siwtched form small, add motu m4 for pipewire --- configs/thilo-pc/nixos.nix | 2 +- home-manager/dotfiles/motu-m4.conf | 104 +++++++++++++++++++++++++++++ home-manager/modules/machine.nix | 1 + 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 home-manager/dotfiles/motu-m4.conf diff --git a/configs/thilo-pc/nixos.nix b/configs/thilo-pc/nixos.nix index 0c776c6..4e90aab 100644 --- a/configs/thilo-pc/nixos.nix +++ b/configs/thilo-pc/nixos.nix @@ -20,7 +20,7 @@ boot.loader.systemd-boot.extraInstallCommands = '' ${pkgs.gnused}/bin/sed -i "/default/c\default @saved" /boot/loader/loader.conf ''; - # boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; networking.hostName = "thilo-pc"; diff --git a/home-manager/dotfiles/motu-m4.conf b/home-manager/dotfiles/motu-m4.conf new file mode 100644 index 0000000..041dbf3 --- /dev/null +++ b/home-manager/dotfiles/motu-m4.conf @@ -0,0 +1,104 @@ +context.modules = [ + { + name = libpipewire-module-loopback + args = { + node.name = "OBS" + node.description = "OBS" + capture.props = { + media.class = "Audio/Sink" + audio.position = [ FL FR ] + } + playback.props = { + audio.position = [ FL FR ] + node.target = "alsa_output.usb-MOTU_M4_M4AE167AEJ-00.analog-surround-40" + stream.dont-remix = true + node.passive = true + } + } + } + { + name = libpipewire-module-loopback + args = { + node.name = "M4 Stereo (1&2) -- Monitor & Headphones" + node.description = "M4 Stereo (1&2) -- Monitor & Headphones" + capture.props = { + media.class = "Audio/Sink" + audio.position = [ FL FR ] + } + playback.props = { + audio.position = [ FL FR ] + node.target = "alsa_output.usb-MOTU_M4_M4AE167AEJ-00.analog-surround-40" + stream.dont-remix = true + node.passive = true + } + } + } + { + name = libpipewire-module-loopback + args = { + node.name = "M4 Stereo (3&4) -- Line Out" + node.description = "M4 Stereo (3&4) -- Line Out" + capture.props = { + media.class = "Audio/Sink" + audio.position = [ FL FR ] + } + playback.props = { + audio.position = [ RR RL ] + node.target = "alsa_output.usb-MOTU_M4_M4AE167AEJ-00.analog-surround-40" + stream.dont-remix = true + node.passive = true + } + } + } + { + name = libpipewire-module-loopback + args = { + node.name = "M4 Input 1" + node.description = "M4 Input 1" + capture.props = { + audio.position = [ FL ] + stream.dont-remix = true + node.target = "alsa_input.usb-MOTU_M4_M4AE167AEJ-00.analog-surround-40" + node.passive = true + } + playback.props = { + media.class = "Audio/Source" + audio.position = [ MONO ] + } + } + } + { + name = libpipewire-module-loopback + args = { + node.name = "M4 Input 2" + node.description = "M4 Input 2" + capture.props = { + audio.position = [ FR ] + stream.dont-remix = true + node.target = "alsa_input.usb-MOTU_M4_M4AE167AEJ-00.analog-surround-40" + node.passive = true + } + playback.props = { + media.class = "Audio/Source" + audio.position = [ MONO ] + } + } + } + { + name = libpipewire-module-loopback + args = { + node.name = "M4 Input (3&4) -- Line In" + node.description = "M4 Input (3&4) -- Line In" + capture.props = { + audio.position = [ RL RR ] + stream.dont-remix = true + node.target = "alsa_input.usb-MOTU_M4_M4AE167AEJ-00.analog-surround-40" + node.passive = true + } + playback.props = { + media.class = "Audio/Source" + audio.position = [ FL FR ] + } + } + } +] \ No newline at end of file diff --git a/home-manager/modules/machine.nix b/home-manager/modules/machine.nix index 2bd9dd3..6da41ff 100644 --- a/home-manager/modules/machine.nix +++ b/home-manager/modules/machine.nix @@ -68,6 +68,7 @@ with lib; ''; ".ssh/config".source = ./../dotfiles/ssh-config; ".gitignore".source = ./../dotfiles/.gitignore; + ".config/pipewire/pipewire.conf.d/98-motu-m4.conf".source = ./../dotfiles/motu-m4.conf; ".config/pipewire/pipewire.conf.d/99-noise-suppression.conf".text = '' context.modules = [{ name = libpipewire-module-filter-chain