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 = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./audio.nix
|
||||||
../desktop.nix
|
../desktop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -16,32 +17,8 @@ with lib.my;
|
|||||||
|
|
||||||
networking.hostName = "odyssey";
|
networking.hostName = "odyssey";
|
||||||
networking.hostId = "c5e68d78";
|
networking.hostId = "c5e68d78";
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
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.package = pkgs.nixFlakes;
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
let
|
{
|
||||||
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
|
||||||
kernel = config.boot.kernelPackages.kernel;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
@ -13,11 +9,6 @@ in {
|
|||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.kernelPackages = pkgs.linuxPackages;
|
boot.kernelPackages = pkgs.linuxPackages;
|
||||||
boot.extraModulePackages = [
|
|
||||||
(snd-usb-audio-module.overrideAttrs (_: {
|
|
||||||
patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ];
|
|
||||||
}))
|
|
||||||
];
|
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
boot.supportedFilesystems = [ "ntfs" ];
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user