Source-Changes-HG archive

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

[src/trunk]: src hw.driverN.saturate bool->integer (default 16).



details:   https://anonhg.NetBSD.org/src/rev/8c6c992f5ad3
branches:  trunk
changeset: 823278:8c6c992f5ad3
user:      nat <nat%NetBSD.org@localhost>
date:      Mon Apr 17 20:17:08 2017 +0000

description:
hw.driverN.saturate bool->integer (default 16).

This means for a greater number than 16 (or user set value) the saturate
function is turned off.  Results in better listening if a large number of
channels are in use.

diffstat:

 share/man/man4/audio.4 |   8 ++++----
 sys/dev/audio.c        |  12 ++++++------
 sys/dev/audiovar.h     |   4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diffs (91 lines):

diff -r 41d44837c29f -r 8c6c992f5ad3 share/man/man4/audio.4
--- a/share/man/man4/audio.4    Mon Apr 17 19:51:11 2017 +0000
+++ b/share/man/man4/audio.4    Mon Apr 17 20:17:08 2017 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: audio.4,v 1.76 2017/03/21 07:04:29 nat Exp $
+.\"    $NetBSD: audio.4,v 1.77 2017/04/17 20:17:08 nat Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -129,13 +129,13 @@
 .Xr sysctl 8
 variable controls how the samples are combined, hw.driverN.saturate.
 .Pp
-By default it is set to true.
-This means that volumes are not adjusted for each channel to be mixed.
+By default is set to 16.
+This means that volumes are not adjusted for the first 16 channels to be mixed.
 All virtual channels will use the
 .Em maximum
 set master volume unless the virtual channel volume is lowered by the user.
 .Pp
-If set to false the channels are
+If a greater number of channels are opened all channels are
 .Em divided
 evenly in volume with respect to the master volume.
 .Pp
diff -r 41d44837c29f -r 8c6c992f5ad3 sys/dev/audio.c
--- a/sys/dev/audio.c   Mon Apr 17 19:51:11 2017 +0000
+++ b/sys/dev/audio.c   Mon Apr 17 20:17:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.324 2017/04/14 00:05:46 nat Exp $  */
+/*     $NetBSD: audio.c,v 1.325 2017/04/17 20:17:08 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.324 2017/04/14 00:05:46 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.325 2017/04/17 20:17:08 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -641,7 +641,7 @@
        }
 
        sc->sc_lastgain = 128;
-       sc->sc_saturate = true;
+       sc->sc_saturate = 16;
        sc->sc_multiuser = false;
        mutex_exit(sc->sc_lock);
 
@@ -837,8 +837,8 @@
 
                sysctl_createv(&sc->sc_log, 0, NULL, NULL,
                        CTLFLAG_READWRITE,
-                       CTLTYPE_BOOL, "saturate",
-                       SYSCTL_DESCR("saturate to max. volume"),
+                       CTLTYPE_INT, "saturate",
+                       SYSCTL_DESCR("saturate to max. volume this many channels"),
                        NULL, 0,
                        &sc->sc_saturate, 0,
                        CTL_HW, node->sysctl_num,
@@ -3786,7 +3786,7 @@
                                sc->schedule_rih = true;
        }
        mutex_enter(sc->sc_intr_lock);
-       if (sc->sc_saturate == true && sc->sc_opens > 1)
+       if (sc->sc_opens < sc->sc_saturate && sc->sc_opens > 1)
                saturate_func(sc);
 
        vc = SIMPLEQ_FIRST(&sc->sc_audiochan)->vc;
diff -r 41d44837c29f -r 8c6c992f5ad3 sys/dev/audiovar.h
--- a/sys/dev/audiovar.h        Mon Apr 17 19:51:11 2017 +0000
+++ b/sys/dev/audiovar.h        Mon Apr 17 20:17:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audiovar.h,v 1.51 2017/02/27 23:31:00 mrg Exp $        */
+/*     $NetBSD: audiovar.h,v 1.52 2017/04/17 20:17:08 nat Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -290,7 +290,7 @@
        int             sc_channels;
        int             sc_precision;
        int             sc_iffreq;
-       bool            sc_saturate;
+       int             sc_saturate;
        struct audio_info       sc_ai;          /* Recent info for  dev sound */
        bool                    sc_aivalid;
 #define VAUDIO_NFORMATS        1



Home | Main Index | Thread Index | Old Index