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

* Re: [9front] mixfs stutter
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Sigrid Solveig Haflínudóttir @ 2022-12-06  1:42 UTC (permalink / raw)
  To: 9front, qwx

Have you tried adjusting hda's delay instead?

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

* Re: [9front] mixfs stutter
  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
  1 sibling, 1 reply; 4+ messages in thread
From: qwx @ 2022-12-06  2:11 UTC (permalink / raw)
  To: 9front

Oops, replied off-list, sorry.

--
On Tue Dec  6 02:42:40 +0100 2022, sigrid@ftrv.se wrote:
> Have you tried adjusting hda's delay instead?

Yes, I've tried increasing it to 2048, 3528, and higher with latest
unmodified mixfs, while saturating load and having 3-4 concurrent
writers.  At 3528 and more, performance seems to drop (but would need
more testing), but latency starts to get high.  2048 improves
performance to similar levels as the patch, but the patch seems to
help slightly more.  It's harder to tell, I'm not sure how to test
this in a reproducible manner.

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

* Re: [9front] mixfs stutter
  2022-12-06  2:11 ` qwx
@ 2022-12-06  2:22   ` qwx
  0 siblings, 0 replies; 4+ messages in thread
From: qwx @ 2022-12-06  2:22 UTC (permalink / raw)
  To: 9front

On Tue Dec  6 03:11:51 +0100 2022, sigrid@ftrv.se wrote:
> Maybe setting pri 13 or something on mixfs? NOTE: am just mashing imaginary keys here, obviously.

No, doesn't change anything so far as I can tell.  play(1) and my
pplay(1) set pri 13 on themselves, I don't know that that helps here
either.

In any case the difference with and without mixfs on my system are
staggering :/

^ 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).