From 7a75cad65f126f5afb201975ea960fe8c6d2e549 Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 7 Oct 2023 08:09:50 +0000 Subject: [PATCH] Dino: bump input latency to 20ms --- hosts/by-name/moby/default.nix | 2 +- hosts/common/programs/dino.nix | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index 138a559a..16be298b 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -69,7 +69,7 @@ # - `systemctl --user restart pipewire` # - pipewire users will likely stop outputting audio until they are also restarted # - # there's seemingly two buffers for the mic: + # there's seemingly two buffers for the mic (see: ) # 1. Pipewire buffering out of the driver and into its own member. # 2. Pipewire buffering into Dino. # the latter is fixed at 10ms by Dino, difficult to override via runtime config. diff --git a/hosts/common/programs/dino.nix b/hosts/common/programs/dino.nix index 5456557a..fa4aea1e 100644 --- a/hosts/common/programs/dino.nix +++ b/hosts/common/programs/dino.nix @@ -51,6 +51,14 @@ in Restart = "always"; RestartSec = "20s"; }; + + # audio buffering; see: + # dino defaults to 10ms mic buffer, which causes underruns, which Dino handles *very* poorly + # as in, the other end of the call will just not receive sound from us for a couple seconds. + # pipewire uses power-of-two buffering for the mic itself. that would put us at 21.33 ms, but this env var supports only whole numbers (21ms ends up not power-of-two). + # also, Dino's likely still doing things in 10ms batches internally anyway. + environment.PULSE_LATENCY_MSEC = "20"; + # note that debug logging during calls produces so much journal spam that it pegs the CPU and causes dropped audio # environment.G_MESSAGES_DEBUG = "all"; };