From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 20893 invoked from network); 6 Dec 2022 01:26:33 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 6 Dec 2022 01:26:33 -0000 Received: from wopr.sciops.net ([216.126.196.60]) by 9front; Mon Dec 5 20:24:51 -0500 2022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sciops.net; s=20210706; t=1670289871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Pq8JCcExJcMDbASZ73Q0DcqFR6ornxDthPnzWTTi3c=; b=wm9vWW+EpKc7m0sPk8s3DSxJlb+lSoJV3N3qPMV4vp41uPHGa9k7uw8AiqySBHnvqzjGcF Gysf/kDDenV6rLgEVB+JG4EPxNE1POM3X0Gl0Q5HyTNjDqFG0gW4nKdXbBX6W5hfJPVmpa yiWQK4DOoSMx9j8TKvlCxQHzqSyz8f0= Received: by wopr.sciops.net (OpenSMTPD) with ESMTPSA id 6571b5fd (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <9front@9front.org>; Mon, 5 Dec 2022 17:24:31 -0800 (PST) Message-ID: Date: Tue, 06 Dec 2022 02:24:38 +0100 From: qwx@sciops.net To: 9front@9front.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: RESTful converged base service Subject: [9front] mixfs stutter Reply-To: 9front@9front.org Precedence: bulk Hello, There's been quite some work on streaming audio and improving mixfs performance lately. I've always had problems with mixfs, but unsure what to do about them. Important note: my main computer is still a t61p, much slower than x220 and higher. There are relatively frequent stutters and underruns, esp. when the system is under heavier load. So far the best "fix" I found was to readjust buffer size and delay. I'm not sure whether this fixes the underlying issue or just a symptom though. The patch below aligns NDELAY and NBUF to the default delay (1764), and significantly improves performance, on intel hda at least, on my machines. What do you think? Does this make sense? Thanks, qwx diff 744053268d196e8c282d20243600fb33d4df0028 uncommitted --- a/sys/src/cmd/audio/mixfs/mixfs.c +++ b/sys/src/cmd/audio/mixfs/mixfs.c @@ -5,10 +5,10 @@ #include <9p.h> enum { - NBUF = 8*1024, - NDELAY = 2048, NCHAN = 2, FREQ = 44100, + NDELAY = FREQ / 25, + NBUF = NDELAY, }; typedef struct Stream Stream;