From 9c97905bb69c9ea11e978fd1e8d7af4a5163121e Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sun, 10 Dec 2023 11:17:41 +0000 Subject: [PATCH 1/3] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'firefox-gnome-theme': 'github:rafaelmardojai/firefox-gnome-theme/ec9421f82d922b7293ffd45a47f7abdee80038c6' (2023-11-30) → 'github:rafaelmardojai/firefox-gnome-theme/d2e6cfdd63651ae8168e5905d94138f406580dd6' (2023-12-09) • Updated input 'home-manager': 'github:nix-community/home-manager/aeb2232d7a32530d3448318790534d196bf9427a' (2023-11-24) → 'github:nix-community/home-manager/6761b8188b860f374b457eddfdb05c82eef9752f' (2023-12-10) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 511a1b6..6d1907e 100644 --- a/flake.lock +++ b/flake.lock @@ -45,11 +45,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1701370547, - "narHash": "sha256-pCtPIcRnMMJOwAlNh5qTO00uw/PBThIIzjMCRcCyHYw=", + "lastModified": 1702138393, + "narHash": "sha256-2jRm1yzX+gKpSCtdpYt1olIgWVEkJnS7FeK00o9X1ko=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "ec9421f82d922b7293ffd45a47f7abdee80038c6", + "rev": "d2e6cfdd63651ae8168e5905d94138f406580dd6", "type": "github" }, "original": { @@ -86,11 +86,11 @@ ] }, "locked": { - "lastModified": 1700814205, - "narHash": "sha256-lWqDPKHRbQfi+zNIivf031BUeyciVOtwCwTjyrhDB5g=", + "lastModified": 1702195709, + "narHash": "sha256-+zRjWkm5rKqQ57PuLZ3JF3xi3vPMiOJzItb1m/43Cq4=", "owner": "nix-community", "repo": "home-manager", - "rev": "aeb2232d7a32530d3448318790534d196bf9427a", + "rev": "6761b8188b860f374b457eddfdb05c82eef9752f", "type": "github" }, "original": { From 8380969c953431be2b833013f544f993c497b9aa Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sun, 10 Dec 2023 18:44:42 +0000 Subject: [PATCH 2/3] Remove FC from Studio 1824c channel map --- ...-Update-device-ID-for-PreSonus-1824c.patch | 20 ++++++++++++++++--- hosts/odyssey/default.nix | 4 ++-- hosts/odyssey/hardware-configuration.nix | 7 ++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/hosts/odyssey/0001-Update-device-ID-for-PreSonus-1824c.patch b/hosts/odyssey/0001-Update-device-ID-for-PreSonus-1824c.patch index c3f7cf5..4bcb484 100644 --- a/hosts/odyssey/0001-Update-device-ID-for-PreSonus-1824c.patch +++ b/hosts/odyssey/0001-Update-device-ID-for-PreSonus-1824c.patch @@ -1,4 +1,4 @@ -From c16be6b3b4da5a55e3ff4258ada123b5f03757e5 Mon Sep 17 00:00:00 2001 +From daebf42bd955f6f8d971af967c675e4e339cb0b2 Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sun, 12 Nov 2023 12:13:39 +0000 Subject: [PATCH] Update device ID for PreSonus 1824c @@ -6,8 +6,9 @@ Subject: [PATCH] Update device ID for PreSonus 1824c --- sound/usb/format.c | 4 ++-- sound/usb/mixer_quirks.c | 2 +- + sound/usb/mixer_s1810c.c | 2 +- sound/usb/quirks.c | 4 ++-- - 3 files changed, 5 insertions(+), 5 deletions(-) + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/usb/format.c b/sound/usb/format.c index ab5fed9f55b6..da50a4782414 100644 @@ -37,6 +38,19 @@ index 898bc3baca7b..c3135459c38c 100644 err = snd_sc1810_init_mixer(mixer); break; case USB_ID(0x2a39, 0x3fb0): /* RME Babyface Pro FS */ +diff --git a/sound/usb/mixer_s1810c.c b/sound/usb/mixer_s1810c.c +index fac4bbc6b275..5bc2e66d452c 100644 +--- a/sound/usb/mixer_s1810c.c ++++ b/sound/usb/mixer_s1810c.c +@@ -552,7 +552,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer) + return 0; + + dev_info(&dev->dev, +- "Presonus Studio 1810c, device_setup: %u\n", chip->setup); ++ "Presonus Studio 1824c, device_setup: %u\n", chip->setup); + if (chip->setup == 1) + dev_info(&dev->dev, "(8out/18in @ 48kHz)\n"); + else if (chip->setup == 2) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index ab2b938502eb..b86832edaaa0 100644 --- a/sound/usb/quirks.c @@ -53,5 +67,5 @@ index ab2b938502eb..b86832edaaa0 100644 -- -2.40.1 +2.42.0 diff --git a/hosts/odyssey/default.nix b/hosts/odyssey/default.nix index 88eec37..2c99e59 100644 --- a/hosts/odyssey/default.nix +++ b/hosts/odyssey/default.nix @@ -28,11 +28,11 @@ with lib.my; capture.props = { node.name = "1824c_Speakers" media.class = "Audio/Sink" - audio.position = [ FL FR FC SL SR LFE ] + audio.position = [ FL FR SL SR LFE ] } playback.props = { node.name = "playback.1824c_Speakers" - audio.position = [ AUX0 AUX1 AUX2 AUX3 AUX4 AUX5 ] + audio.position = [ AUX0 AUX1 AUX3 AUX4 AUX5 ] target.object = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output" stream.dont-remix = true node.passive = true diff --git a/hosts/odyssey/hardware-configuration.nix b/hosts/odyssey/hardware-configuration.nix index bf70cfe..a2deb1e 100644 --- a/hosts/odyssey/hardware-configuration.nix +++ b/hosts/odyssey/hardware-configuration.nix @@ -5,13 +5,14 @@ let kernel = config.boot.kernelPackages.kernel; }; in { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; + boot.kernelPackages = pkgs.linuxPackages; boot.extraModulePackages = [ (snd-usb-audio-module.overrideAttrs (_: { patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ]; From 0d015ac41801c70ace24856876d4a515c5a980ba Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sun, 10 Dec 2023 19:45:31 +0000 Subject: [PATCH 3/3] Refactor sound card config --- hosts/odyssey/audio.nix | 45 ++++++++++++++++++++++++ hosts/odyssey/default.nix | 25 +------------ hosts/odyssey/hardware-configuration.nix | 11 +----- 3 files changed, 47 insertions(+), 34 deletions(-) create mode 100644 hosts/odyssey/audio.nix diff --git a/hosts/odyssey/audio.nix b/hosts/odyssey/audio.nix new file mode 100644 index 0000000..3b4c3ee --- /dev/null +++ b/hosts/odyssey/audio.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: +let + snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix { + kernel = config.boot.kernelPackages.kernel; + }; + upmixConfig = '' + stream.properties = { + channelmix.upmix = true + channelmix.upmix-method = psd + } + ''; +in { + boot.extraModulePackages = [ + (snd-usb-audio-module.overrideAttrs (_: { + patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ]; + })) + ]; + + environment.etc = { + "pipewire/pipewire.conf.d/surround.conf".text = '' + context.modules = [ + { + name = libpipewire-module-loopback + args = { + node.description = "Genelec 4.1 Surround" + capture.props = { + node.name = "Genelec_Speakers" + media.class = "Audio/Sink" + audio.position = [ FL FR SL SR LFE ] + } + playback.props = { + node.name = "playback.Genelec_Speakers" + audio.position = [ AUX0 AUX1 AUX3 AUX4 AUX5 ] + target.object = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output" + stream.dont-remix = true + node.passive = true + } + } + } + ] + ''; + "pipewire/pipewire-pulse.conf.d/40-upmix.conf".text = upmixConfig; + "pipewire/client-rt.conf.d/40-upmix.conf".text = upmixConfig; + }; + } diff --git a/hosts/odyssey/default.nix b/hosts/odyssey/default.nix index 2c99e59..775bd96 100644 --- a/hosts/odyssey/default.nix +++ b/hosts/odyssey/default.nix @@ -4,6 +4,7 @@ with lib.my; { imports = [ ./hardware-configuration.nix + ./audio.nix ../desktop.nix ]; @@ -16,32 +17,8 @@ with lib.my; networking.hostName = "odyssey"; networking.hostId = "c5e68d78"; - networking.networkmanager.enable = true; - environment.etc."pipewire/pipewire.conf.d/surround.conf".text = '' - context.modules = [ - { - name = libpipewire-module-loopback - args = { - node.description = "1824c Surround" - capture.props = { - node.name = "1824c_Speakers" - media.class = "Audio/Sink" - audio.position = [ FL FR SL SR LFE ] - } - playback.props = { - node.name = "playback.1824c_Speakers" - audio.position = [ AUX0 AUX1 AUX3 AUX4 AUX5 ] - target.object = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output" - stream.dont-remix = true - node.passive = true - } - } - } - ] - ''; - nix.package = pkgs.nixFlakes; nix.extraOptions = '' experimental-features = nix-command flakes diff --git a/hosts/odyssey/hardware-configuration.nix b/hosts/odyssey/hardware-configuration.nix index a2deb1e..d30c646 100644 --- a/hosts/odyssey/hardware-configuration.nix +++ b/hosts/odyssey/hardware-configuration.nix @@ -1,10 +1,6 @@ { config, lib, pkgs, modulesPath, ... }: -let - snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix { - kernel = config.boot.kernelPackages.kernel; - }; -in { +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -13,11 +9,6 @@ in { boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.kernelPackages = pkgs.linuxPackages; - boot.extraModulePackages = [ - (snd-usb-audio-module.overrideAttrs (_: { - patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ]; - })) - ]; boot.supportedFilesystems = [ "ntfs" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];