87 lines
2.1 KiB
Nix
87 lines
2.1 KiB
Nix
{pkgs, ...}: let
|
|
cb-ucm-conf = with pkgs;
|
|
alsa-ucm-conf.overrideAttrs {
|
|
wttsrc = fetchFromGitHub {
|
|
owner = "WeirdTreeThing";
|
|
repo = "alsa-ucm-conf-cros";
|
|
rev = "a4f0ed6cf59163fb571c33a81a6b40b6f53ed57d";
|
|
hash = "sha256-H0BsRzHSEJ6XCZB/Rvb3w+uGCzr+kAvAwcHWqYEtp6w=";
|
|
};
|
|
unpackPhase = ''
|
|
runHook preUnpack
|
|
tar xf "$src"
|
|
runHook postUnpack
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out/share/alsa
|
|
cp -r alsa-ucm*/ucm2 $out/share/alsa
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
in {
|
|
environment = {
|
|
systemPackages = [pkgs.sof-firmware];
|
|
sessionVariables.ALSA_CONFIG_UCM2 = "${cb-ucm-conf}/share/alsa/ucm2";
|
|
etc = {
|
|
"wireplumber/main.lua.d/51-increase-headroom.lua".text = ''
|
|
rule = {
|
|
matches = {
|
|
{
|
|
{ "node.name", "matches", "alsa_output.*" },
|
|
},
|
|
},
|
|
apply_properties = {
|
|
["api.alsa.headroom"] = 4096,
|
|
},
|
|
}
|
|
|
|
table.insert(alsa_monitor.rules,rule)
|
|
'';
|
|
};
|
|
};
|
|
|
|
system.replaceDependencies.replacements = [
|
|
{
|
|
original = pkgs.alsa-ucm-conf;
|
|
replacement = cb-ucm-conf;
|
|
}
|
|
];
|
|
|
|
boot.extraModprobeConfig = ''
|
|
options snd-intel-dspcfg dsp_driver=3
|
|
'';
|
|
|
|
services.pipewire.wireplumber.configPackages = [
|
|
(pkgs.writeTextDir "share/wireplumber/main.lua.d/51-increase-headroom.lua" ''
|
|
rule = {
|
|
matches = {
|
|
{
|
|
{ "node.name", "matches", "alsa_output.*" },
|
|
},
|
|
},
|
|
apply_properties = {
|
|
["api.alsa.headroom"] = 4096,
|
|
},
|
|
}
|
|
|
|
table.insert(alsa_monitor.rules,rule)
|
|
'')
|
|
(pkgs.writeTextDir "share/wireplumber/main.lua.d/51-avs-dmic.lua" ''
|
|
rule = {
|
|
matches = {
|
|
{
|
|
{ "node.nick", "equals", "Internal Microphone" },
|
|
},
|
|
},
|
|
apply_properties = {
|
|
["audio.format"] = "S16LE",
|
|
},
|
|
}
|
|
|
|
table.insert(alsa_monitor.rules, rule)
|
|
'')
|
|
];
|
|
}
|