fix pipewire stuff
This commit is contained in:
parent
7d954a61ef
commit
baf94ae575
@ -59,6 +59,8 @@ inputs: all: {
|
|||||||
|
|
||||||
iotop
|
iotop
|
||||||
htop
|
htop
|
||||||
|
|
||||||
|
corefonts
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
|
@ -207,7 +207,8 @@ in {
|
|||||||
"org/gnome/shell" = {
|
"org/gnome/shell" = {
|
||||||
disable-user-extensions = false;
|
disable-user-extensions = false;
|
||||||
disabled-extensions = [""];
|
disabled-extensions = [""];
|
||||||
enabled-extensions = [
|
enabled-extensions =
|
||||||
|
[
|
||||||
"rrc@ogarcia.me"
|
"rrc@ogarcia.me"
|
||||||
"native-window-placement@gnome-shell-extensions.gcampax.github.com"
|
"native-window-placement@gnome-shell-extensions.gcampax.github.com"
|
||||||
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||||
@ -224,7 +225,8 @@ in {
|
|||||||
"gsconnect@andyholmes.github.io"
|
"gsconnect@andyholmes.github.io"
|
||||||
# "desktop-cube@schneegans.github.com"
|
# "desktop-cube@schneegans.github.com"
|
||||||
"sound-output-device-chooser@kgshank.net"
|
"sound-output-device-chooser@kgshank.net"
|
||||||
] ++ (lib.optional cfg.tiling "forge@jmmaranan.com");
|
]
|
||||||
|
++ (lib.optional cfg.tiling "forge@jmmaranan.com");
|
||||||
};
|
};
|
||||||
"org/gnome/desktop/peripherals/touchpad" = {
|
"org/gnome/desktop/peripherals/touchpad" = {
|
||||||
natural-scroll = false;
|
natural-scroll = false;
|
||||||
|
@ -38,7 +38,7 @@ in {
|
|||||||
quantum = mkOption {
|
quantum = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
description = "Pipewire quantum in low latency mode";
|
description = "Pipewire quantum in low latency mode";
|
||||||
default = 64;
|
default = 32;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,31 +64,62 @@ in {
|
|||||||
pulseaudio
|
pulseaudio
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" = mkIf cfg.lowLatency {
|
services.pipewire.extraConfig.pipewire."92-low-latency" = mkIf cfg.lowLatency {
|
||||||
text = ''
|
context.properties = {
|
||||||
alsa_monitor.properties = {
|
default.clock.rate = cfg.rate;
|
||||||
["audio.rate"] = ${
|
default.clock.quantum = cfg.quantum;
|
||||||
toString (cfg.rate
|
default.clock.min-quantum = cfg.quantum;
|
||||||
* (
|
default.clock.max-quantum = cfg.quantum;
|
||||||
if cfg.usbSoundcard
|
};
|
||||||
then 2
|
|
||||||
else 1
|
|
||||||
))
|
|
||||||
},
|
|
||||||
["audio.format"] = "S32LE",
|
|
||||||
["api.alsa.headroom"] = 512,
|
|
||||||
["api.alsa.period-size"] = ${toString cfg.periodSize}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
|
services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = mkIf cfg.lowLatency {
|
||||||
|
context.modules = [
|
||||||
|
{
|
||||||
|
name = "libpipewire-module-protocol-pulse";
|
||||||
|
args = {
|
||||||
|
pulse.min.req = qr;
|
||||||
|
pulse.default.req = qr;
|
||||||
|
pulse.max.req = qr;
|
||||||
|
pulse.min.quantum = qr;
|
||||||
|
pulse.max.quantum = qr;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
stream.properties = {
|
||||||
|
node.latency = qr;
|
||||||
|
resample.quality = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.pipewire.wireplumber.configPackages =
|
||||||
|
[
|
||||||
|
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
|
||||||
bluez_monitor.properties = {
|
bluez_monitor.properties = {
|
||||||
["bluez5.enable-sbc-xq"] = true,
|
["bluez5.enable-sbc-xq"] = true,
|
||||||
["bluez5.enable-msbc"] = true,
|
["bluez5.enable-msbc"] = true,
|
||||||
["bluez5.enable-hw-volume"] = true,
|
["bluez5.enable-hw-volume"] = true,
|
||||||
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
|
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
|
||||||
}
|
}
|
||||||
'';
|
'')
|
||||||
|
]
|
||||||
|
++ optional cfg.lowLatency (pkgs.writeTextDir "share/wireplumber/main.lua.d/99-alsa-lowlatency.lua" ''
|
||||||
|
alsa_monitor.rules = {
|
||||||
|
{
|
||||||
|
matches = {{{ "node.name", "matches", "alsa_output.*" }}};
|
||||||
|
apply_properties = {
|
||||||
|
["audio.format"] = "S32LE",
|
||||||
|
["audio.rate"] = "${toString (cfg.rate
|
||||||
|
* (
|
||||||
|
if cfg.usbSoundcard
|
||||||
|
then 2
|
||||||
|
else 1
|
||||||
|
))}", -- for USB soundcards it should be twice your desired rate
|
||||||
|
["api.alsa.period-size"] = ${toString cfg.periodSize}, -- defaults to 1024, tweak by trial-and-error
|
||||||
|
-- ["api.alsa.disable-batch"] = true, -- generally, USB soundcards use the batch mode
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
consoleLogLevel = lib.mkDefault (if cfg.fancyBoot then 0 else 3);
|
consoleLogLevel = lib.mkDefault (
|
||||||
|
if cfg.fancyBoot
|
||||||
|
then 0
|
||||||
|
else 3
|
||||||
|
);
|
||||||
initrd.verbose = lib.mkDefault (!cfg.fancyBoot);
|
initrd.verbose = lib.mkDefault (!cfg.fancyBoot);
|
||||||
plymouth.enable = lib.mkDefault cfg.fancyBoot;
|
plymouth.enable = lib.mkDefault cfg.fancyBoot;
|
||||||
kernelParams = lib.mkIf cfg.fancyBoot [
|
kernelParams = lib.mkIf cfg.fancyBoot [
|
||||||
|
Loading…
Reference in New Issue
Block a user