diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index 04fe1123..48ef421f 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -63,6 +63,33 @@ sane.programs.epiphany.env.BROWSER = "epiphany"; sane.programs.firefox.enableFor.user.colin = false; # use epiphany instead + # note the .conf.d approach: using ~/.config/pipewire/pipewire.conf directly breaks all audio, + # presumably because that deletes the defaults entirely whereas the .conf.d approach selectively overrides defaults + sane.user.fs.".config/pipewire/pipewire.conf.d/10-fix-dino-mic-cutout.conf".symlink.text = '' + # config docs: + # useful to run `pw-top` to see that these settings are actually having effect, + # and `pw-metadata` to see if any settings conflict (e.g. max-quantum < min-quantum) + # + # restart pipewire after editing these files: + # - `systemctl --user restart pipewire` + # - pipewire users will likely stop outputting audio until they are also restarted + # + # there's seemingly two buffers for the mic: + # 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. + # the former defaults low (e.g. 512 samples) + # this default configuration causes the mic to regularly drop out entirely for a couple seconds at a time during a call, + # presumably because the system can't keep up (pw-top shows incrementing counter in ERR column). + # `pw-metadata -n settings 0 clock.force-quantum 1024` reduces to about 1 error per second. + # `pw-metadata -n settings 0 clock.force-quantum 2048` reduces to 1 error every < 10s. + # pipewire default config includes `clock.power-of-two-quantum = true` + context.properties = { + default.clock.min-quantum = 2048 + default.clock.max-quantum = 8192 + } + ''; + # sane.programs.mpv.enableFor.user.colin = true; boot.loader.efi.canTouchEfiVariables = false; diff --git a/hosts/common/programs/dino.nix b/hosts/common/programs/dino.nix index 638e1e56..7568c044 100644 --- a/hosts/common/programs/dino.nix +++ b/hosts/common/programs/dino.nix @@ -12,6 +12,14 @@ # # dino can be autostarted on login -- useful to ensure that i always receive calls and notifications -- # but at present it has no "start in tray" type of option: it must render a window. +# +# outstanding bugs: +# - mic is sometimes disabled at call start despite presenting as enabled +# - fix is to toggle it off -> on in the Dino UI +# - once per 1-2 minutes dino will temporarily drop mic input: +# - `rtp-WRNING: plugin.vala:148: Warning in pipeline: Can't record audio fast enough +# - this was *partially* fixed by bumping the pipewire mic buffer to 2048 samples (from ~512) +# - that fix can't extend to Dino itself except by patching its code (perhaps) { config, lib, ... }: let cfg = config.sane.programs.dino; @@ -39,7 +47,8 @@ in Restart = "always"; RestartSec = "20s"; }; - environment.G_MESSAGES_DEBUG = "all"; + # 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"; }; }; }