Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Revert commit rev 1.419 to audio.c. This should add...



details:   https://anonhg.NetBSD.org/src/rev/c401d24413c0
branches:  trunk
changeset: 827545:c401d24413c0
user:      nat <nat%NetBSD.org@localhost>
date:      Thu Nov 02 02:08:02 2017 +0000

description:
Revert commit rev 1.419 to audio.c.  This should address PR kern/52685.

This also means that drivers that have a static block size will have more
latency at lower sample rates/precision/channels.  Also audio drivers that
do more than supply rounded blocksizes in their round_blocksize functions
will have to be changed.

diffstat:

 sys/dev/audio.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (42 lines):

diff -r 6c1e723813e2 -r c401d24413c0 sys/dev/audio.c
--- a/sys/dev/audio.c   Wed Nov 01 23:00:05 2017 +0000
+++ b/sys/dev/audio.c   Thu Nov 02 02:08:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.421 2017/10/31 21:18:02 nat Exp $  */
+/*     $NetBSD: audio.c,v 1.422 2017/11/02 02:08:02 nat Exp $  */
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.421 2017/10/31 21:18:02 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.422 2017/11/02 02:08:02 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2005,21 +2005,9 @@
                blksize = rp->s.bufsize / AUMINNOBLK;
        ROUNDSIZE(blksize);
        DPRINTF(("audio_init_ringbuffer: MI blksize=%d\n", blksize));
-
-       struct virtual_channel *hwvc = sc->sc_hwvc;
-       if (sc->hw_if->round_blocksize &&
-           (rp == &hwvc->sc_mpr || rp == &hwvc->sc_mrr)) {
+       if (sc->hw_if->round_blocksize)
                blksize = sc->hw_if->round_blocksize(sc->hw_hdl, blksize,
-                   mode, &rp->s.param);
-       } else {
-               int tmpblksize = 1;
-               /* round blocksize to a power of 2 */
-               while (tmpblksize < blksize)
-                       tmpblksize <<= 1;
-
-               blksize = tmpblksize;
-       }
-
+                                                    mode, &rp->s.param);
        if (blksize <= 0)
                panic("audio_init_ringbuffer: blksize=%d", blksize);
        nblks = rp->s.bufsize / blksize;



Home | Main Index | Thread Index | Old Index