Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Start as half as many transfers for recording. ...



details:   https://anonhg.NetBSD.org/src/rev/cfa07472a1df
branches:  trunk
changeset: 824579:cfa07472a1df
user:      nat <nat%NetBSD.org@localhost>
date:      Fri Jun 09 10:11:20 2017 +0000

description:
Start as half as many transfers for recording.  This fixes recording and
play back when uaudio is used in full duplex mode.
The transfer scheduling probably is to blame.

Ok skrll@.

diffstat:

 sys/dev/usb/uaudio.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 0f36ac2af4f9 -r cfa07472a1df sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Fri Jun 09 08:23:45 2017 +0000
+++ b/sys/dev/usb/uaudio.c      Fri Jun 09 10:11:20 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uaudio.c,v 1.153 2017/06/01 02:45:12 chs Exp $ */
+/*     $NetBSD: uaudio.c,v 1.154 2017/06/09 10:11:20 nat Exp $ */
 
 /*
  * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.153 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.154 2017/06/09 10:11:20 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2610,8 +2610,11 @@
        ch->intr = intr;
        ch->arg = arg;
 
-        /* XXX -1 shouldn't be needed */
-       for (i = 0; i < UAUDIO_NCHANBUFS - 1; i++) {
+       /*
+        * Start as half as many channels for recording as for playback.
+        * This stops playback from stuttering in full-duplex operation.
+        */
+       for (i = 0; i < UAUDIO_NCHANBUFS / 2; i++) {
                uaudio_chan_rtransfer(ch);
        }
 
@@ -2663,8 +2666,7 @@
        ch->intr = intr;
        ch->arg = arg;
 
-       /* XXX -1 shouldn't be needed */
-       for (i = 0; i < UAUDIO_NCHANBUFS - 1; i++)
+       for (i = 0; i < UAUDIO_NCHANBUFS; i++)
                uaudio_chan_ptransfer(ch);
        mutex_enter(&sc->sc_lock);
        mutex_enter(&sc->sc_intr_lock);



Home | Main Index | Thread Index | Old Index