Refactor sound card config
This commit is contained in:
parent
8380969c95
commit
0d015ac418
45
hosts/odyssey/audio.nix
Normal file
45
hosts/odyssey/audio.nix
Normal file
@ -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;
|
||||
};
|
||||
}
|
@ -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
|
||||
|
@ -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" ];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user