Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

1.2 KB
Raw Blame
# LordOS: more audio headroom in virtual machines (docs/SOUND.md, "Virtual machines").
#
# An emulated sound card is fed by the host's timers, and on a busy host those arrive late. Debian's
# WirePlumber already gives VM cards 1024-frame periods and 2048 frames of headroom
# (/usr/share/wireplumber/wireplumber.conf.d/alsa-vm.conf), and the output still ran dry: YouTube
# in Chromium stuttered on VMware (pw-top: ERR on the ALSA sink kept growing). These outputs get
# 8 periods of 1024 frames, 8192 frames (~170 ms at 48 kHz) of headroom and no timer-based
# scheduling (the card's interrupts drive PipeWire). With it, ERR stayed at 0.
#
# Matches only when WirePlumber runs in a VM (cpu.vm.name is set, the same test alsa-vm.conf uses);
# on real hardware it doesn't apply and the latency stays low. Its name sorts after alsa-vm.conf, so
# its rule runs later and these values win.
monitor.alsa.rules = [
  {
    matches = [
      {
        node.name = "~alsa_output.*"
        cpu.vm.name = "~.*"
      }
    ]
    actions = {
      update-props = {
        api.alsa.period-size   = 1024
        api.alsa.period-num    = 8
        api.alsa.headroom      = 8192
        api.alsa.disable-tsched = true
      }
    }
  }
]