9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] mixfs stutter
@ 2022-12-06  1:24 qwx
  2022-12-06  1:42 ` Sigrid Solveig Haflínudóttir
  2022-12-06  2:11 ` qwx
  0 siblings, 2 replies; 4+ messages in thread
From: qwx @ 2022-12-06  1:24 UTC (permalink / raw)
  To: 9front

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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-06  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06  1:24 [9front] mixfs stutter qwx
2022-12-06  1:42 ` Sigrid Solveig Haflínudóttir
2022-12-06  2:11 ` qwx
2022-12-06  2:22   ` qwx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).