Low latency for sdac

This commit is contained in:
Natsu Kagami 2023-12-08 01:14:08 +01:00
parent adf3aeadfa
commit 91a5ee5df5
Signed by: nki
GPG key ID: 55A032EB38B49ADB
5 changed files with 31 additions and 0 deletions

View file

@ -111,6 +111,7 @@
./modules/common/linux
(common-nix stable)
inputs.secrets.nixosModules.common
inputs.nix-gaming.nixosModules.pipewireLowLatency
];
};

View file

@ -153,6 +153,14 @@ in
alsa.support32Bit = true;
pulse.enable = true;
lowLatency = {
# enable this module
enable = true;
# defaults (no need to be set unless modified)
quantum = 64;
rate = 48000;
};
};
# udev configurations
services.udev.packages = with pkgs; [

View file

@ -0,0 +1,5 @@
{ config, pkgs, lib, ... }: {
environment.etc = {
"wireplumber/main.lua.d/51-sdac.lua".source = ./sdac.lua;
};
}

16
nki-home/audio/sdac.lua Normal file
View file

@ -0,0 +1,16 @@
rule = {
matches = {
{
{ "node.name", "matches", "alsa_output.usb-Grace_Design_SDAC-00.*" },
},
},
apply_properties = {
["audio.format"] = "S24_3LE",
["audio.rate"] = 96000,
["api.alsa.period-size"] = 2,
["api.alsa.headroom"] = 0,
["api.alsa.disable-batch"] = true
},
}
table.insert(alsa_monitor.rules, rule)

View file

@ -7,6 +7,7 @@
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
./audio
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];