N
The current sndiod latency (minimum time between when the program
plays something and when sound reaches Joe's ears) is too large and
makes OpenBSD unpleasant to use for telephony, games, and makes
controls of video players slugish.
The defaut latency (of 160ms) was set ~10 years ago to workaround
various problems: KERNEL_LOCK used to block audio processing for very
long, azalia(4) and uaudio(4) were unable to recover after an error,
which aggravated the problem.
The kernel improved a lot the last decade and such large buffers are
not necessary anymore. I think something between 20ms and 40ms is a
better default for the average OpenBSD system:
* audio-conferencing software and games requires no sndiod_flags
tweaks anymore
* on modern machines (like my 7 years old i5-2500K) building a kernel
doesn't make audio stutterer
* sndiod_flags tweaks will still be needed for:
- very slow or overloaded machines used for audio
- machines running heavy/bogus SMM code
- real-time synths & effects (20ms is still too small)
Please try to switch you system to 40ms buffers (i.e. 1920 samples at
the default 48kHz rate), for instance either apply diff below or
simply do:
rcctl set sndiod flags -z 480 -b 1920
rcctl restart sndiod
then report any significant increase of stuttering, and what
software/hardware triggers it. If you think 20ms or 30ms (i.e. 960 and
1440 sample buffers) are better, let me know as well.
Note that OpenBSD is not real-time (neither are programs we run) so
audio may stutter no matter how large the buffers are. The goal here
is to get a ballance between disconfort caused by latency and
probability of stuttering for the average OpenBSD system.
If we reach a consensus, here's the diff to make above settings the
default.