workstation perf tweaks

This commit is contained in:
notgne2 2025-11-20 12:15:48 -07:00
parent 349cdd047d
commit e70c974289
No known key found for this signature in database
5 changed files with 325 additions and 288 deletions

View file

@ -96,12 +96,20 @@ in {
wireplumber.extraConfig."99-alsa-lowlatency"."alsa_monitor.rules" = [
{
matches = [ { "node.name" = "matches:alsa_output.*"; } ];
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" = if cfg.batch then "false" else "true"; # generally, USB soundcards use the batch mode
"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" =
if cfg.batch
then "false"
else "true"; # generally, USB soundcards use the batch mode
};
}
];

View file

@ -72,9 +72,30 @@ in {
# Make battery usage and performance sane
# hardware.system76.power-daemon.enable = lib.mkDefault true;
zramSwap.enable = true;
services.tlp.enable = false;
services.power-profiles-daemon.enable = lib.mkDefault false;
services.system76-scheduler.enable = lib.mkDefault true;
services.system76-scheduler = {
enable = lib.mkDefault true;
exceptions = lib.mkDefault [
"include descends=\"schedtool\""
"include descends=\"nice\""
"include descends=\"chrt\""
"include descends=\"taskset\""
"include descends=\"ionice\""
"schedtool"
"nice"
"chrt"
"ionice"
"dbus"
"dbus-broker"
"rtkit-daemon"
"taskset"
"systemd"
];
};
services.tuned = {
enable = lib.mkDefault true;
settings.dynamic_tuning = lib.mkDefault true;
@ -153,6 +174,7 @@ in {
extraGroups = [
"adbusers" # run ADB commands
"audio" # soundcard access
"rtkit" # realtime stuff?
"video" # webcam access (and maybe wayland too?)
"libvirtd" # run VMs through libvirt
"kvm" # run KVM VMs