Index | Thread | Search

From:
Benjamin Baier <programmer@netzbasis.de>
Subject:
Re: sndiod: Fix random restarts under load, please test
To:
pasta <pasta@pastatech.eu>
Cc:
Alexandre Ratchov <alex@caoua.org>, tech@openbsd.org
Date:
Thu, 30 Oct 2025 09:25:06 +0100

Download raw body.

Thread
On Wed, 29 Oct 2025 17:57:55 +0100
pasta <pasta@pastatech.eu> wrote:

> hi,
> 
> On Thu, Oct 23, 2025 at 11:26:39AM +0200, Alexandre Ratchov wrote:
> > Currently, upon an audio(4) buffer underrun, we compensate for the
> > inserted silence immediately, without stopping DMA. This is to make
> > the underrun sound less unpleasant. Unfortunately, after ~15 years and
> > many hacks this approach still doesn't work: sometimes the device just
> > stops working, a watchdog timer (another hack) disconnects all the
> > clients and closes the device.
> > 
> > This diff below is to use a simpler and more robust approach: upon an
> > underrun, stop DMA, restore the device state and restart. Underruns
> > will be more audible (because restarting inserts a full buffer of
> > silence) but this fixes the disconnects (and removes the need for all
> > the ugly hacks, that will be removed later).
> >
> > The code is very short but not trivial and all the upper layers depend
> > on it, so this diff is worth testing.
> 
> i've been running this diff for the last couple of days. the underruns
> are much more more audible, but this seems to otherwise work.
> 
> it seems to have fixed the disconnects, for me! that is nice,
> thank you :-)
> 

I also run this diff since it dropped. No negative effects.

Greetings Ben

OpenBSD 7.8-current (GENERIC.MP) #55: Fri Oct 24 08:15:07 CEST 2025
    ben@home:/usr/src/sys/arch/amd64/compile/GENERIC.MP

azalia0 at pci1 dev 0 function 1 vendor "ATI", unknown product 0xaaf0 rev 0x00: msi
azalia0: no supported codecs

azalia1 at pci0 dev 31 function 3 "Intel 300 Series cAVS" rev 0x10: msi
azalia1: codecs: Realtek ALC1220
audio0 at azalia1