WIP: pipewire: trying to tune so lima doesnt crash

This commit is contained in:
Colin 2024-04-24 06:09:38 +00:00
parent 9d7816a1cd
commit 0cbb81cfea
3 changed files with 28 additions and 10 deletions

View File

@ -82,6 +82,24 @@ in
default.clock.max-quantum = ${builtins.toString cfg.config.max-quantum} default.clock.max-quantum = ${builtins.toString cfg.config.max-quantum}
} }
''; '';
fs.".config/pipewire/pipewire.conf.d/20-sane-rtkit.conf".symlink.text = ''
# documented inside <repo:pipewire/pipewire:/src/modules/module-rt.c>
context.modules = [{
name = libpipewire-module-rt
args = {
nice.level = 0
#rt.prio = 88
#rt.time.soft = -1
#rt.time.hard = -1
#rlimits.enabled = true
#rtportal.enabled = true
#rtkit.enabled = true
#uclamp.min = 0
#uclamp.max = 1024
}
flags = [ ifexists nofail ]
}]
'';
# see: <https://docs.pipewire.org/page_module_protocol_native.html> # see: <https://docs.pipewire.org/page_module_protocol_native.html>
# defaults to placing the socket in /run/user/$id/{pipewire-0,pipewire-0-manager,...} # defaults to placing the socket in /run/user/$id/{pipewire-0,pipewire-0-manager,...}

View File

@ -25,8 +25,8 @@ in
ExecStart = lib.escapeShellArgs [ ExecStart = lib.escapeShellArgs [
"${cfg.package}/libexec/rtkit-daemon" "${cfg.package}/libexec/rtkit-daemon"
"--scheduling-policy=FIFO" "--scheduling-policy=FIFO"
"--our-realtime-priority=89" "--our-realtime-priority=79"
"--max-realtime-priority=88" "--max-realtime-priority=78" # N.B.: setting this too aggressively can hang weak devices!
"--min-nice-level=-19" "--min-nice-level=-19"
"--rttime-usec-max=2000000" "--rttime-usec-max=2000000"
"--users-max=100" "--users-max=100"

View File

@ -2,10 +2,10 @@
{ {
sane.programs.wireplumber = { sane.programs.wireplumber = {
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.whitelistDbus = [ # sandbox.whitelistDbus = [
"system" #< so it can request better scheduling from rtkit # "system" #< so it can request better scheduling from rtkit
"user" #< TODO: is this needed? # # "user" #< TODO: is this needed?
]; # ];
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.extraPaths = [ sandbox.extraPaths = [
# i think these video inputs (for e.g. webcam) are optional. # i think these video inputs (for e.g. webcam) are optional.
@ -20,10 +20,10 @@
"/sys/class/video4linux" "/sys/class/video4linux"
"/sys/devices" "/sys/devices"
]; ];
sandbox.extraConfig = [ # sandbox.extraConfig = [
# needed if i want rtkit to grant this higher scheduling priority # # needed if i want rtkit to grant this higher scheduling priority
"--sane-sandbox-keep-namespace" "pid" # "--sane-sandbox-keep-namespace" "pid"
]; # ];
suggestedPrograms = [ "alsa-ucm-conf" ]; suggestedPrograms = [ "alsa-ucm-conf" ];