Thu Jun 7 18:24:16 2018 UTC ()
Pull up following revision(s) (requested by nat in ticket #848):

	share/man/man9/Makefile: revision 1.422
	distrib/sets/lists/comp/mi: revision 1.2198
	share/man/man7/Makefile: revision 1.33
	share/man/man9/audio.9: revision 1.47
	share/man/man7/audio.7: file removal
	sys/dev/audio.c: revision 1.456
	sys/dev/audio.c: revision 1.457
	distrib/sets/lists/man/mi: revision 1.1591
	share/man/man9/intro.9: revision 1.20
	share/man/man7/audio.7: revision 1.3
	share/man/man9/audio_system.9: revision 1.1
	share/man/man7/intro.7: revision 1.26
	share/man/man4/audio.4: revision 1.86

Fix a typo with sc_out/inports when setting the hardware recording gain on the
mix ring.  Found by mrg@
XXX pullup-8

Using audioctl without the -p switch defaults to the mix ring.  This allows
setting the hardware gain etc.

Update the audio spec in audio.7 to reflect these changes.
Addresses PR kern/52781.

Move the audio specification to section 9 under audio_system.
Ok wiz@


(martin)
diff -r1.2138.2.5 -r1.2138.2.6 src/distrib/sets/lists/comp/mi
diff -r1.1557.2.4 -r1.1557.2.5 src/distrib/sets/lists/man/mi
diff -r1.79.2.2 -r1.79.2.3 src/share/man/man4/audio.4
diff -r1.31.8.1 -r1.31.8.2 src/share/man/man7/Makefile
diff -r1.2.2.2 -r0 src/share/man/man7/audio.7
diff -r1.23.24.1 -r1.23.24.2 src/share/man/man7/intro.7
diff -r1.414 -r1.414.2.1 src/share/man/man9/Makefile
diff -r1.44.16.1 -r1.44.16.2 src/share/man/man9/audio.9
diff -r0 -r1.1.2.2 src/share/man/man9/audio_system.9
diff -r1.18 -r1.18.2.1 src/share/man/man9/intro.9
diff -r1.357.2.12 -r1.357.2.13 src/sys/dev/audio.c

cvs diff -r1.2138.2.5 -r1.2138.2.6 src/distrib/sets/lists/comp/mi (expand / switch to unified diff)

--- src/distrib/sets/lists/comp/mi 2018/02/11 21:17:33 1.2138.2.5
+++ src/distrib/sets/lists/comp/mi 2018/06/07 18:24:15 1.2138.2.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: mi,v 1.2138.2.5 2018/02/11 21:17:33 snj Exp $ 1# $NetBSD: mi,v 1.2138.2.6 2018/06/07 18:24:15 martin Exp $
2# 2#
3# Note: don't delete entries from here - mark them as "obsolete" instead. 3# Note: don't delete entries from here - mark them as "obsolete" instead.
4./etc/mtree/set.comp comp-sys-root 4./etc/mtree/set.comp comp-sys-root
5./usr/bin/addr2line comp-debug-bin binutils 5./usr/bin/addr2line comp-debug-bin binutils
6./usr/bin/ar comp-util-bin binutils 6./usr/bin/ar comp-util-bin binutils
7./usr/bin/as comp-util-bin binutils 7./usr/bin/as comp-util-bin binutils
8./usr/bin/asa comp-fortran-bin 8./usr/bin/asa comp-fortran-bin
9./usr/bin/atf-compile comp-obsolete obsolete 9./usr/bin/atf-compile comp-obsolete obsolete
10./usr/bin/c++ comp-cxx-bin gcccmds 10./usr/bin/c++ comp-cxx-bin gcccmds
11./usr/bin/c++filt comp-cxx-bin binutils 11./usr/bin/c++filt comp-cxx-bin binutils
12./usr/bin/c11 comp-c-bin 12./usr/bin/c11 comp-c-bin
13./usr/bin/c89 comp-c-bin 13./usr/bin/c89 comp-c-bin
14./usr/bin/c99 comp-c-bin 14./usr/bin/c99 comp-c-bin
@@ -10135,26 +10135,27 @@ @@ -10135,26 +10135,27 @@
10135./usr/share/man/cat9/aprint_normal_dev.0 comp-sys-catman .cat 10135./usr/share/man/cat9/aprint_normal_dev.0 comp-sys-catman .cat
10136./usr/share/man/cat9/aprint_normal_ifnet.0 comp-sys-catman .cat 10136./usr/share/man/cat9/aprint_normal_ifnet.0 comp-sys-catman .cat
10137./usr/share/man/cat9/aprint_verbose.0 comp-sys-catman .cat 10137./usr/share/man/cat9/aprint_verbose.0 comp-sys-catman .cat
10138./usr/share/man/cat9/aprint_verbose_dev.0 comp-sys-catman .cat 10138./usr/share/man/cat9/aprint_verbose_dev.0 comp-sys-catman .cat
10139./usr/share/man/cat9/aprint_verbose_ifnet.0 comp-sys-catman .cat 10139./usr/share/man/cat9/aprint_verbose_ifnet.0 comp-sys-catman .cat
10140./usr/share/man/cat9/arc4randbytes.0 comp-sys-catman .cat 10140./usr/share/man/cat9/arc4randbytes.0 comp-sys-catman .cat
10141./usr/share/man/cat9/arc4random.0 comp-sys-catman .cat 10141./usr/share/man/cat9/arc4random.0 comp-sys-catman .cat
10142./usr/share/man/cat9/arp.0 comp-sys-catman .cat 10142./usr/share/man/cat9/arp.0 comp-sys-catman .cat
10143./usr/share/man/cat9/arp_ifinit.0 comp-sys-catman .cat 10143./usr/share/man/cat9/arp_ifinit.0 comp-sys-catman .cat
10144./usr/share/man/cat9/arpintr.0 comp-sys-catman .cat 10144./usr/share/man/cat9/arpintr.0 comp-sys-catman .cat
10145./usr/share/man/cat9/arpresolve.0 comp-sys-catman .cat 10145./usr/share/man/cat9/arpresolve.0 comp-sys-catman .cat
10146./usr/share/man/cat9/atop.0 comp-sys-catman .cat 10146./usr/share/man/cat9/atop.0 comp-sys-catman .cat
10147./usr/share/man/cat9/audio.0 comp-sys-catman .cat 10147./usr/share/man/cat9/audio.0 comp-sys-catman .cat
 10148./usr/share/man/cat9/audio_system.0 comp-sys-catman .cat
10148./usr/share/man/cat9/autoconf.0 comp-sys-catman .cat 10149./usr/share/man/cat9/autoconf.0 comp-sys-catman .cat
10149./usr/share/man/cat9/bawrite.0 comp-sys-catman .cat 10150./usr/share/man/cat9/bawrite.0 comp-sys-catman .cat
10150./usr/share/man/cat9/bcdtobin.0 comp-sys-catman .cat 10151./usr/share/man/cat9/bcdtobin.0 comp-sys-catman .cat
10151./usr/share/man/cat9/bcmp.0 comp-sys-catman .cat 10152./usr/share/man/cat9/bcmp.0 comp-sys-catman .cat
10152./usr/share/man/cat9/bcopy.0 comp-sys-catman .cat 10153./usr/share/man/cat9/bcopy.0 comp-sys-catman .cat
10153./usr/share/man/cat9/bdevsw_lookup.0 comp-sys-catman .cat 10154./usr/share/man/cat9/bdevsw_lookup.0 comp-sys-catman .cat
10154./usr/share/man/cat9/bdevsw_lookup_major.0 comp-sys-catman .cat 10155./usr/share/man/cat9/bdevsw_lookup_major.0 comp-sys-catman .cat
10155./usr/share/man/cat9/bdevvp.0 comp-sys-catman .cat 10156./usr/share/man/cat9/bdevvp.0 comp-sys-catman .cat
10156./usr/share/man/cat9/bdwrite.0 comp-sys-catman .cat 10157./usr/share/man/cat9/bdwrite.0 comp-sys-catman .cat
10157./usr/share/man/cat9/be16dec.0 comp-sys-catman .cat 10158./usr/share/man/cat9/be16dec.0 comp-sys-catman .cat
10158./usr/share/man/cat9/be16enc.0 comp-sys-catman .cat 10159./usr/share/man/cat9/be16enc.0 comp-sys-catman .cat
10159./usr/share/man/cat9/be16toh.0 comp-sys-catman .cat 10160./usr/share/man/cat9/be16toh.0 comp-sys-catman .cat
10160./usr/share/man/cat9/be32dec.0 comp-sys-catman .cat 10161./usr/share/man/cat9/be32dec.0 comp-sys-catman .cat
@@ -17621,26 +17622,27 @@ @@ -17621,26 +17622,27 @@
17621./usr/share/man/html9/aprint_normal_dev.html comp-sys-htmlman html 17622./usr/share/man/html9/aprint_normal_dev.html comp-sys-htmlman html
17622./usr/share/man/html9/aprint_normal_ifnet.html comp-sys-htmlman html 17623./usr/share/man/html9/aprint_normal_ifnet.html comp-sys-htmlman html
17623./usr/share/man/html9/aprint_verbose.html comp-sys-htmlman html 17624./usr/share/man/html9/aprint_verbose.html comp-sys-htmlman html
17624./usr/share/man/html9/aprint_verbose_dev.html comp-sys-htmlman html 17625./usr/share/man/html9/aprint_verbose_dev.html comp-sys-htmlman html
17625./usr/share/man/html9/aprint_verbose_ifnet.html comp-sys-htmlman html 17626./usr/share/man/html9/aprint_verbose_ifnet.html comp-sys-htmlman html
17626./usr/share/man/html9/arc4randbytes.html comp-sys-htmlman html 17627./usr/share/man/html9/arc4randbytes.html comp-sys-htmlman html
17627./usr/share/man/html9/arc4random.html comp-sys-htmlman html 17628./usr/share/man/html9/arc4random.html comp-sys-htmlman html
17628./usr/share/man/html9/arp.html comp-sys-htmlman html 17629./usr/share/man/html9/arp.html comp-sys-htmlman html
17629./usr/share/man/html9/arp_ifinit.html comp-sys-htmlman html 17630./usr/share/man/html9/arp_ifinit.html comp-sys-htmlman html
17630./usr/share/man/html9/arpintr.html comp-sys-htmlman html 17631./usr/share/man/html9/arpintr.html comp-sys-htmlman html
17631./usr/share/man/html9/arpresolve.html comp-sys-htmlman html 17632./usr/share/man/html9/arpresolve.html comp-sys-htmlman html
17632./usr/share/man/html9/atop.html comp-sys-htmlman html 17633./usr/share/man/html9/atop.html comp-sys-htmlman html
17633./usr/share/man/html9/audio.html comp-sys-htmlman html 17634./usr/share/man/html9/audio.html comp-sys-htmlman html
 17635./usr/share/man/html9/audio_system.html comp-sys-htmlman html
17634./usr/share/man/html9/autoconf.html comp-sys-htmlman html 17636./usr/share/man/html9/autoconf.html comp-sys-htmlman html
17635./usr/share/man/html9/bawrite.html comp-sys-htmlman html 17637./usr/share/man/html9/bawrite.html comp-sys-htmlman html
17636./usr/share/man/html9/bcdtobin.html comp-sys-htmlman html 17638./usr/share/man/html9/bcdtobin.html comp-sys-htmlman html
17637./usr/share/man/html9/bcmp.html comp-sys-htmlman html 17639./usr/share/man/html9/bcmp.html comp-sys-htmlman html
17638./usr/share/man/html9/bcopy.html comp-sys-htmlman html 17640./usr/share/man/html9/bcopy.html comp-sys-htmlman html
17639./usr/share/man/html9/bdevsw_lookup.html comp-sys-htmlman html 17641./usr/share/man/html9/bdevsw_lookup.html comp-sys-htmlman html
17640./usr/share/man/html9/bdevsw_lookup_major.html comp-sys-htmlman html 17642./usr/share/man/html9/bdevsw_lookup_major.html comp-sys-htmlman html
17641./usr/share/man/html9/bdevvp.html comp-sys-htmlman html 17643./usr/share/man/html9/bdevvp.html comp-sys-htmlman html
17642./usr/share/man/html9/bdwrite.html comp-sys-htmlman html 17644./usr/share/man/html9/bdwrite.html comp-sys-htmlman html
17643./usr/share/man/html9/be16dec.html comp-sys-htmlman html 17645./usr/share/man/html9/be16dec.html comp-sys-htmlman html
17644./usr/share/man/html9/be16enc.html comp-sys-htmlman html 17646./usr/share/man/html9/be16enc.html comp-sys-htmlman html
17645./usr/share/man/html9/be16toh.html comp-sys-htmlman html 17647./usr/share/man/html9/be16toh.html comp-sys-htmlman html
17646./usr/share/man/html9/be32dec.html comp-sys-htmlman html 17648./usr/share/man/html9/be32dec.html comp-sys-htmlman html
@@ -25211,26 +25213,27 @@ @@ -25211,26 +25213,27 @@
25211./usr/share/man/man9/aprint_normal_dev.9 comp-sys-man .man 25213./usr/share/man/man9/aprint_normal_dev.9 comp-sys-man .man
25212./usr/share/man/man9/aprint_normal_ifnet.9 comp-sys-man .man 25214./usr/share/man/man9/aprint_normal_ifnet.9 comp-sys-man .man
25213./usr/share/man/man9/aprint_verbose.9 comp-sys-man .man 25215./usr/share/man/man9/aprint_verbose.9 comp-sys-man .man
25214./usr/share/man/man9/aprint_verbose_dev.9 comp-sys-man .man 25216./usr/share/man/man9/aprint_verbose_dev.9 comp-sys-man .man
25215./usr/share/man/man9/aprint_verbose_ifnet.9 comp-sys-man .man 25217./usr/share/man/man9/aprint_verbose_ifnet.9 comp-sys-man .man
25216./usr/share/man/man9/arc4randbytes.9 comp-sys-man .man 25218./usr/share/man/man9/arc4randbytes.9 comp-sys-man .man
25217./usr/share/man/man9/arc4random.9 comp-sys-man .man 25219./usr/share/man/man9/arc4random.9 comp-sys-man .man
25218./usr/share/man/man9/arp.9 comp-sys-man .man 25220./usr/share/man/man9/arp.9 comp-sys-man .man
25219./usr/share/man/man9/arp_ifinit.9 comp-sys-man .man 25221./usr/share/man/man9/arp_ifinit.9 comp-sys-man .man
25220./usr/share/man/man9/arpintr.9 comp-sys-man .man 25222./usr/share/man/man9/arpintr.9 comp-sys-man .man
25221./usr/share/man/man9/arpresolve.9 comp-sys-man .man 25223./usr/share/man/man9/arpresolve.9 comp-sys-man .man
25222./usr/share/man/man9/atop.9 comp-sys-man .man 25224./usr/share/man/man9/atop.9 comp-sys-man .man
25223./usr/share/man/man9/audio.9 comp-sys-man .man 25225./usr/share/man/man9/audio.9 comp-sys-man .man
 25226./usr/share/man/man9/audio_system.9 comp-sys-man .man
25224./usr/share/man/man9/autoconf.9 comp-sys-man .man 25227./usr/share/man/man9/autoconf.9 comp-sys-man .man
25225./usr/share/man/man9/bawrite.9 comp-sys-man .man 25228./usr/share/man/man9/bawrite.9 comp-sys-man .man
25226./usr/share/man/man9/bcdtobin.9 comp-sys-man .man 25229./usr/share/man/man9/bcdtobin.9 comp-sys-man .man
25227./usr/share/man/man9/bcmp.9 comp-sys-man .man 25230./usr/share/man/man9/bcmp.9 comp-sys-man .man
25228./usr/share/man/man9/bcopy.9 comp-sys-man .man 25231./usr/share/man/man9/bcopy.9 comp-sys-man .man
25229./usr/share/man/man9/bdevsw_lookup.9 comp-sys-man .man 25232./usr/share/man/man9/bdevsw_lookup.9 comp-sys-man .man
25230./usr/share/man/man9/bdevsw_lookup_major.9 comp-sys-man .man 25233./usr/share/man/man9/bdevsw_lookup_major.9 comp-sys-man .man
25231./usr/share/man/man9/bdevvp.9 comp-sys-man .man 25234./usr/share/man/man9/bdevvp.9 comp-sys-man .man
25232./usr/share/man/man9/bdwrite.9 comp-sys-man .man 25235./usr/share/man/man9/bdwrite.9 comp-sys-man .man
25233./usr/share/man/man9/be16dec.9 comp-sys-man .man 25236./usr/share/man/man9/be16dec.9 comp-sys-man .man
25234./usr/share/man/man9/be16enc.9 comp-sys-man .man 25237./usr/share/man/man9/be16enc.9 comp-sys-man .man
25235./usr/share/man/man9/be16toh.9 comp-sys-man .man 25238./usr/share/man/man9/be16toh.9 comp-sys-man .man
25236./usr/share/man/man9/be32dec.9 comp-sys-man .man 25239./usr/share/man/man9/be32dec.9 comp-sys-man .man

cvs diff -r1.1557.2.4 -r1.1557.2.5 src/distrib/sets/lists/man/mi (expand / switch to unified diff)

--- src/distrib/sets/lists/man/mi 2018/05/15 13:42:50 1.1557.2.4
+++ src/distrib/sets/lists/man/mi 2018/06/07 18:24:16 1.1557.2.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: mi,v 1.1557.2.4 2018/05/15 13:42:50 martin Exp $ 1# $NetBSD: mi,v 1.1557.2.5 2018/06/07 18:24:16 martin Exp $
2# 2#
3# Note: don't delete entries from here - mark them as "obsolete" instead. 3# Note: don't delete entries from here - mark them as "obsolete" instead.
4# 4#
5./etc/mtree/set.man man-sys-root 5./etc/mtree/set.man man-sys-root
6./usr/share/info/am-utils.info man-amd-info info 6./usr/share/info/am-utils.info man-amd-info info
7./usr/share/info/as.info man-computil-info binutils,info 7./usr/share/info/as.info man-computil-info binutils,info
8./usr/share/info/awk.info man-util-info info 8./usr/share/info/awk.info man-util-info info
9./usr/share/info/bfd.info man-computil-info binutils,info 9./usr/share/info/bfd.info man-computil-info binutils,info
10./usr/share/info/binutils.info man-computil-info binutils,info 10./usr/share/info/binutils.info man-computil-info binutils,info
11./usr/share/info/bzip2.info man-obsolete obsolete 11./usr/share/info/bzip2.info man-obsolete obsolete
12./usr/share/info/cpp.info man-util-info gcccmds,info 12./usr/share/info/cpp.info man-util-info gcccmds,info
13./usr/share/info/cvs.info man-cvs-info cvs,info 13./usr/share/info/cvs.info man-cvs-info cvs,info
14./usr/share/info/cvsclient.info man-cvs-info cvs,info 14./usr/share/info/cvsclient.info man-cvs-info cvs,info
@@ -2241,27 +2241,27 @@ @@ -2241,27 +2241,27 @@
2241./usr/share/man/cat5/uuencode.format.0 man-obsolete obsolete 2241./usr/share/man/cat5/uuencode.format.0 man-obsolete obsolete
2242./usr/share/man/cat5/veriexec.0 man-sys-catman .cat 2242./usr/share/man/cat5/veriexec.0 man-sys-catman .cat
2243./usr/share/man/cat5/vgrindefs.0 man-groff-catman .cat 2243./usr/share/man/cat5/vgrindefs.0 man-groff-catman .cat
2244./usr/share/man/cat5/virtual.0 man-postfix-catman postfix,.cat 2244./usr/share/man/cat5/virtual.0 man-postfix-catman postfix,.cat
2245./usr/share/man/cat5/weekly.0 man-sys-catman .cat 2245./usr/share/man/cat5/weekly.0 man-sys-catman .cat
2246./usr/share/man/cat5/weekly.conf.0 man-sys-catman .cat 2246./usr/share/man/cat5/weekly.conf.0 man-sys-catman .cat
2247./usr/share/man/cat5/wpa_supplicant.conf.0 man-net-catman .cat 2247./usr/share/man/cat5/wpa_supplicant.conf.0 man-net-catman .cat
2248./usr/share/man/cat5/wscons.conf.0 man-sys-catman .cat 2248./usr/share/man/cat5/wscons.conf.0 man-sys-catman .cat
2249./usr/share/man/cat5/wsmoused.conf.0 man-sys-catman .cat 2249./usr/share/man/cat5/wsmoused.conf.0 man-sys-catman .cat
2250./usr/share/man/cat5/wtmp.0 man-sys-catman .cat 2250./usr/share/man/cat5/wtmp.0 man-sys-catman .cat
2251./usr/share/man/cat5/wtmpx.0 man-sys-catman .cat 2251./usr/share/man/cat5/wtmpx.0 man-sys-catman .cat
2252./usr/share/man/cat5/ypserv.acl.0 man-obsolete obsolete 2252./usr/share/man/cat5/ypserv.acl.0 man-obsolete obsolete
2253./usr/share/man/cat7/ascii.0 man-reference-catman .cat 2253./usr/share/man/cat7/ascii.0 man-reference-catman .cat
2254./usr/share/man/cat7/audio.0 man-reference-catman .cat 2254./usr/share/man/cat7/audio.0 man-obsolete obsolete
2255./usr/share/man/cat7/atf.0 man-atf-catman .cat,atf 2255./usr/share/man/cat7/atf.0 man-atf-catman .cat,atf
2256./usr/share/man/cat7/c.0 man-reference-catman .cat 2256./usr/share/man/cat7/c.0 man-reference-catman .cat
2257./usr/share/man/cat7/c78.0 man-reference-catman .cat 2257./usr/share/man/cat7/c78.0 man-reference-catman .cat
2258./usr/share/man/cat7/c89.0 man-reference-catman .cat 2258./usr/share/man/cat7/c89.0 man-reference-catman .cat
2259./usr/share/man/cat7/c90.0 man-reference-catman .cat 2259./usr/share/man/cat7/c90.0 man-reference-catman .cat
2260./usr/share/man/cat7/c99.0 man-reference-catman .cat 2260./usr/share/man/cat7/c99.0 man-reference-catman .cat
2261./usr/share/man/cat7/des_modes.0 man-reference-catman .cat 2261./usr/share/man/cat7/des_modes.0 man-reference-catman .cat
2262./usr/share/man/cat7/editline.0 man-sys-catman .cat 2262./usr/share/man/cat7/editline.0 man-sys-catman .cat
2263./usr/share/man/cat7/environ.0 man-reference-catman .cat 2263./usr/share/man/cat7/environ.0 man-reference-catman .cat
2264./usr/share/man/cat7/glob.0 man-reference-catman .cat 2264./usr/share/man/cat7/glob.0 man-reference-catman .cat
2265./usr/share/man/cat7/hier.0 man-reference-catman .cat 2265./usr/share/man/cat7/hier.0 man-reference-catman .cat
2266./usr/share/man/cat7/hostname.0 man-reference-catman .cat 2266./usr/share/man/cat7/hostname.0 man-reference-catman .cat
2267./usr/share/man/cat7/intro.0 man-reference-catman .cat 2267./usr/share/man/cat7/intro.0 man-reference-catman .cat
@@ -5262,27 +5262,27 @@ @@ -5262,27 +5262,27 @@
5262./usr/share/man/html5/utmpx.html man-sys-htmlman html 5262./usr/share/man/html5/utmpx.html man-sys-htmlman html
5263./usr/share/man/html5/uuencode.html man-util-htmlman html 5263./usr/share/man/html5/uuencode.html man-util-htmlman html
5264./usr/share/man/html5/veriexec.html man-sys-htmlman html 5264./usr/share/man/html5/veriexec.html man-sys-htmlman html
5265./usr/share/man/html5/vgrindefs.html man-groff-htmlman html 5265./usr/share/man/html5/vgrindefs.html man-groff-htmlman html
5266./usr/share/man/html5/virtual.html man-postfix-htmlman postfix,html 5266./usr/share/man/html5/virtual.html man-postfix-htmlman postfix,html
5267./usr/share/man/html5/weekly.conf.html man-sys-htmlman html 5267./usr/share/man/html5/weekly.conf.html man-sys-htmlman html
5268./usr/share/man/html5/weekly.html man-sys-htmlman html 5268./usr/share/man/html5/weekly.html man-sys-htmlman html
5269./usr/share/man/html5/wpa_supplicant.conf.html man-net-htmlman html 5269./usr/share/man/html5/wpa_supplicant.conf.html man-net-htmlman html
5270./usr/share/man/html5/wscons.conf.html man-sys-htmlman html 5270./usr/share/man/html5/wscons.conf.html man-sys-htmlman html
5271./usr/share/man/html5/wsmoused.conf.html man-sys-htmlman html 5271./usr/share/man/html5/wsmoused.conf.html man-sys-htmlman html
5272./usr/share/man/html5/wtmp.html man-sys-htmlman html 5272./usr/share/man/html5/wtmp.html man-sys-htmlman html
5273./usr/share/man/html5/wtmpx.html man-sys-htmlman html 5273./usr/share/man/html5/wtmpx.html man-sys-htmlman html
5274./usr/share/man/html7/ascii.html man-reference-htmlman html 5274./usr/share/man/html7/ascii.html man-reference-htmlman html
5275./usr/share/man/html7/audio.html man-reference-htmlman html 5275./usr/share/man/html7/audio.html man-obsolete obsolete
5276./usr/share/man/html7/atf.html man-atf-htmlman html,atf 5276./usr/share/man/html7/atf.html man-atf-htmlman html,atf
5277./usr/share/man/html7/c.html man-reference-htmlman html 5277./usr/share/man/html7/c.html man-reference-htmlman html
5278./usr/share/man/html7/c78.html man-reference-htmlman html 5278./usr/share/man/html7/c78.html man-reference-htmlman html
5279./usr/share/man/html7/c89.html man-reference-htmlman html 5279./usr/share/man/html7/c89.html man-reference-htmlman html
5280./usr/share/man/html7/c90.html man-reference-htmlman html 5280./usr/share/man/html7/c90.html man-reference-htmlman html
5281./usr/share/man/html7/c99.html man-reference-htmlman html 5281./usr/share/man/html7/c99.html man-reference-htmlman html
5282./usr/share/man/html7/des_modes.html man-reference-htmlman html 5282./usr/share/man/html7/des_modes.html man-reference-htmlman html
5283./usr/share/man/html7/editline.html man-sys-htmlman html 5283./usr/share/man/html7/editline.html man-sys-htmlman html
5284./usr/share/man/html7/environ.html man-reference-htmlman html 5284./usr/share/man/html7/environ.html man-reference-htmlman html
5285./usr/share/man/html7/glob.html man-reference-htmlman html 5285./usr/share/man/html7/glob.html man-reference-htmlman html
5286./usr/share/man/html7/hier.html man-reference-htmlman html 5286./usr/share/man/html7/hier.html man-reference-htmlman html
5287./usr/share/man/html7/hostname.html man-reference-htmlman html 5287./usr/share/man/html7/hostname.html man-reference-htmlman html
5288./usr/share/man/html7/intro.html man-reference-htmlman html 5288./usr/share/man/html7/intro.html man-reference-htmlman html
@@ -8253,27 +8253,27 @@ @@ -8253,27 +8253,27 @@
8253./usr/share/man/man5/uuencode.format.5 man-obsolete obsolete 8253./usr/share/man/man5/uuencode.format.5 man-obsolete obsolete
8254./usr/share/man/man5/veriexec.5 man-sys-man .man 8254./usr/share/man/man5/veriexec.5 man-sys-man .man
8255./usr/share/man/man5/vgrindefs.5 man-groff-man .man 8255./usr/share/man/man5/vgrindefs.5 man-groff-man .man
8256./usr/share/man/man5/virtual.5 man-postfix-man postfix,.man 8256./usr/share/man/man5/virtual.5 man-postfix-man postfix,.man
8257./usr/share/man/man5/weekly.5 man-sys-man .man 8257./usr/share/man/man5/weekly.5 man-sys-man .man
8258./usr/share/man/man5/weekly.conf.5 man-sys-man .man 8258./usr/share/man/man5/weekly.conf.5 man-sys-man .man
8259./usr/share/man/man5/wpa_supplicant.conf.5 man-net-man .man 8259./usr/share/man/man5/wpa_supplicant.conf.5 man-net-man .man
8260./usr/share/man/man5/wscons.conf.5 man-sys-man .man 8260./usr/share/man/man5/wscons.conf.5 man-sys-man .man
8261./usr/share/man/man5/wsmoused.conf.5 man-sys-man .man 8261./usr/share/man/man5/wsmoused.conf.5 man-sys-man .man
8262./usr/share/man/man5/wtmp.5 man-sys-man .man 8262./usr/share/man/man5/wtmp.5 man-sys-man .man
8263./usr/share/man/man5/wtmpx.5 man-sys-man .man 8263./usr/share/man/man5/wtmpx.5 man-sys-man .man
8264./usr/share/man/man5/ypserv.acl.5 man-obsolete obsolete 8264./usr/share/man/man5/ypserv.acl.5 man-obsolete obsolete
8265./usr/share/man/man7/ascii.7 man-reference-man .man 8265./usr/share/man/man7/ascii.7 man-reference-man .man
8266./usr/share/man/man7/audio.7 man-reference-man .man 8266./usr/share/man/man7/audio.7 man-obsolete obsolete
8267./usr/share/man/man7/atf.7 man-atf-man .man,atf 8267./usr/share/man/man7/atf.7 man-atf-man .man,atf
8268./usr/share/man/man7/c.7 man-reference-man .man 8268./usr/share/man/man7/c.7 man-reference-man .man
8269./usr/share/man/man7/c78.7 man-reference-man .man 8269./usr/share/man/man7/c78.7 man-reference-man .man
8270./usr/share/man/man7/c89.7 man-reference-man .man 8270./usr/share/man/man7/c89.7 man-reference-man .man
8271./usr/share/man/man7/c90.7 man-reference-man .man 8271./usr/share/man/man7/c90.7 man-reference-man .man
8272./usr/share/man/man7/c99.7 man-reference-man .man 8272./usr/share/man/man7/c99.7 man-reference-man .man
8273./usr/share/man/man7/des_modes.7 man-reference-man .man 8273./usr/share/man/man7/des_modes.7 man-reference-man .man
8274./usr/share/man/man7/editline.7 man-sys-man .man 8274./usr/share/man/man7/editline.7 man-sys-man .man
8275./usr/share/man/man7/environ.7 man-reference-man .man 8275./usr/share/man/man7/environ.7 man-reference-man .man
8276./usr/share/man/man7/glob.7 man-reference-man .man 8276./usr/share/man/man7/glob.7 man-reference-man .man
8277./usr/share/man/man7/hier.7 man-reference-man .man 8277./usr/share/man/man7/hier.7 man-reference-man .man
8278./usr/share/man/man7/hostname.7 man-reference-man .man 8278./usr/share/man/man7/hostname.7 man-reference-man .man
8279./usr/share/man/man7/intro.7 man-reference-man .man 8279./usr/share/man/man7/intro.7 man-reference-man .man

cvs diff -r1.79.2.2 -r1.79.2.3 src/share/man/man4/audio.4 (expand / switch to unified diff)

--- src/share/man/man4/audio.4 2018/05/15 13:42:50 1.79.2.2
+++ src/share/man/man4/audio.4 2018/06/07 18:24:16 1.79.2.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: audio.4,v 1.79.2.2 2018/05/15 13:42:50 martin Exp $ 1.\" $NetBSD: audio.4,v 1.79.2.3 2018/06/07 18:24:16 martin Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by John T. Kohl. 7.\" by John T. Kohl.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -780,17 +780,17 @@ string values. @@ -780,17 +780,17 @@ string values.
780.Xr emuxki 4 , 780.Xr emuxki 4 ,
781.Xr esa 4 , 781.Xr esa 4 ,
782.Xr esm 4 , 782.Xr esm 4 ,
783.Xr eso 4 , 783.Xr eso 4 ,
784.Xr fms 4 , 784.Xr fms 4 ,
785.Xr neo 4 , 785.Xr neo 4 ,
786.Xr sv 4 , 786.Xr sv 4 ,
787.Xr yds 4 787.Xr yds 4
788.Ss TURBOchannel 788.Ss TURBOchannel
789.Xr bba 4 789.Xr bba 4
790.Ss USB 790.Ss USB
791.Xr uaudio 4 791.Xr uaudio 4
792.Ss The NetBSD audio specification 792.Ss The NetBSD audio specification
793.Xr audio 7 793.Xr audio_system 9
794.Sh HISTORY 794.Sh HISTORY
795Support for virtual channels and mixing first appeared in 795Support for virtual channels and mixing first appeared in
796.Nx 8.0 . 796.Nx 8.0 .

cvs diff -r1.31.8.1 -r1.31.8.2 src/share/man/man7/Makefile (expand / switch to unified diff)

--- src/share/man/man7/Makefile 2018/05/15 13:42:49 1.31.8.1
+++ src/share/man/man7/Makefile 2018/06/07 18:24:16 1.31.8.2
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1# $NetBSD: Makefile,v 1.31.8.1 2018/05/15 13:42:49 martin Exp $ 1# $NetBSD: Makefile,v 1.31.8.2 2018/06/07 18:24:16 martin Exp $
2# @(#)Makefile 8.1 (Berkeley) 6/5/93 2# @(#)Makefile 8.1 (Berkeley) 6/5/93
3 3
4.include <bsd.init.mk> 4.include <bsd.init.mk>
5 5
6# missing: eqnchar.7 man.7 ms.7 term.7 6# missing: eqnchar.7 man.7 ms.7 term.7
7 7
8MAN= ascii.7 audio.7 c.7 environ.7 glob.7 hier.7 hostname.7 intro.7 \ 8MAN= ascii.7 c.7 environ.7 glob.7 hier.7 hostname.7 intro.7 mailaddr.7 \
9 mailaddr.7 module.7 nls.7 operator.7 orders.7 pkgsrc.7 release.7 \ 9 module.7 nls.7 operator.7 orders.7 pkgsrc.7 release.7 rfc6056.7 \
10 rfc6056.7 security.7 script.7 setuid.7 signal.7 src.7 sticky.7 \ 10 security.7 script.7 setuid.7 signal.7 src.7 sticky.7 symlink.7 \
11 symlink.7 sysctl.7 tests.7 11 sysctl.7 tests.7
12 12
13CLEANFILES= tests.7 13CLEANFILES= tests.7
14.if ${MKKYUA} != "no" 14.if ${MKKYUA} != "no"
15tests.7: tests.kyua.7 15tests.7: tests.kyua.7
16 rm -f ${.TARGET} && cp ${.ALLSRC} ${.TARGET} 16 rm -f ${.TARGET} && cp ${.ALLSRC} ${.TARGET}
17.else 17.else
18tests.7: tests.atf.7 18tests.7: tests.atf.7
19 rm -f ${.TARGET} && cp ${.ALLSRC} ${.TARGET} 19 rm -f ${.TARGET} && cp ${.ALLSRC} ${.TARGET}
20.endif 20.endif
21 21
22MLINKS+=c.7 c78.7 \ 22MLINKS+=c.7 c78.7 \
23 c.7 c89.7 \ 23 c.7 c89.7 \
24 c.7 c90.7 \ 24 c.7 c90.7 \

File Deleted: src/share/man/man7/Attic/audio.7

cvs diff -r1.23.24.1 -r1.23.24.2 src/share/man/man7/intro.7 (expand / switch to unified diff)

--- src/share/man/man7/intro.7 2018/05/15 13:42:49 1.23.24.1
+++ src/share/man/man7/intro.7 2018/06/07 18:24:16 1.23.24.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: intro.7,v 1.23.24.1 2018/05/15 13:42:49 martin Exp $ 1.\" $NetBSD: intro.7,v 1.23.24.2 2018/06/07 18:24:16 martin Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1990, 1993 3.\" Copyright (c) 1983, 1990, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -32,29 +32,26 @@ @@ -32,29 +32,26 @@
32.Dd May 15, 2018 32.Dd May 15, 2018
33.Dt INTRO 7 33.Dt INTRO 7
34.Os 34.Os
35.Sh NAME 35.Sh NAME
36.Nm intro 36.Nm intro
37.Nd miscellaneous information pages 37.Nd miscellaneous information pages
38.Sh DESCRIPTION 38.Sh DESCRIPTION
39This section contains miscellaneous documentation, including: 39This section contains miscellaneous documentation, including:
40.Bl -tag -width "mdoc.samples(7)" -offset indent 40.Bl -tag -width "mdoc.samples(7)" -offset indent
41.It Xr ascii 7 41.It Xr ascii 7
42map of 42map of
43.Tn ASCII 43.Tn ASCII
44character set 44character set
45.It Xr audio 7 
46the 
47.Nx audio specification 
48.It Xr c 7 45.It Xr c 7
49the C programming language 46the C programming language
50.It Xr environ 7 47.It Xr environ 7
51user environment 48user environment
52.It Xr glob 7 49.It Xr glob 7
53shell-style pattern matching 50shell-style pattern matching
54.\" .It Sy eqnchar 51.\" .It Sy eqnchar
55.\" special character definitions for eqn 52.\" special character definitions for eqn
56.It Xr hier 7 53.It Xr hier 7
57file system hierarchy in 54file system hierarchy in
58.Nx 55.Nx
59.It Xr hostname 7 56.It Xr hostname 7
60host name resolution description 57host name resolution description

cvs diff -r1.414 -r1.414.2.1 src/share/man/man9/Makefile (expand / switch to unified diff)

--- src/share/man/man9/Makefile 2017/05/21 19:07:29 1.414
+++ src/share/man/man9/Makefile 2018/06/07 18:24:15 1.414.2.1
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1# $NetBSD: Makefile,v 1.414 2017/05/21 19:07:29 abhinav Exp $ 1# $NetBSD: Makefile,v 1.414.2.1 2018/06/07 18:24:15 martin Exp $
2 2
3# Makefile for section 9 (kernel function and variable) manual pages. 3# Makefile for section 9 (kernel function and variable) manual pages.
4 4
5MAN= accept_filter.9 accf_data.9 accf_http.9 \ 5MAN= accept_filter.9 accf_data.9 accf_http.9 \
6 altq.9 arp.9 audio.9 autoconf.9 \ 6 altq.9 arp.9 audio.9 audio_system.9 autoconf.9 \
7 bcdtobin.9 bcmp.9 bcopy.9 bintime_add.9 bluetooth.9 boothowto.9 bpf.9 \ 7 bcdtobin.9 bcmp.9 bcopy.9 bintime_add.9 bluetooth.9 boothowto.9 bpf.9 \
8 buffercache.9 bufferio.9 bufq.9 bus_dma.9 bus_space.9 byteorder.9 \ 8 buffercache.9 bufferio.9 bufq.9 bus_dma.9 bus_space.9 byteorder.9 \
9 bzero.9 \ 9 bzero.9 \
10 callback.9 callout.9 cardbus.9 clock.9 cnmagic.9 condvar.9 config.9 \ 10 callback.9 callout.9 cardbus.9 clock.9 cnmagic.9 condvar.9 config.9 \
11 cons.9 copy.9 coredump_write.9 \ 11 cons.9 copy.9 coredump_write.9 \
12 cpu_configure.9 cpu_coredump.9 cpu_dumpconf.9 \ 12 cpu_configure.9 cpu_coredump.9 cpu_dumpconf.9 \
13 cpu_lwp_fork.9 \ 13 cpu_lwp_fork.9 \
14 cpu_idle.9 cpu_initclocks.9 cpu_need_resched.9 \ 14 cpu_idle.9 cpu_initclocks.9 cpu_need_resched.9 \
15 cpu_number.9 cpu_reboot.9 cpu_rootconf.9 \ 15 cpu_number.9 cpu_reboot.9 cpu_rootconf.9 \
16 cpu_startup.9 cpu_switchto.9 cpufreq.9 \ 16 cpu_startup.9 cpu_switchto.9 cpufreq.9 \
17 csf.9 ctod.9 \ 17 csf.9 ctod.9 \
18 curproc.9 \ 18 curproc.9 \
19 delay.9 devsw_attach.9 disk.9 ddc.9 disklabel.9 dksubr.9 dofileread.9 \ 19 delay.9 devsw_attach.9 disk.9 ddc.9 disklabel.9 dksubr.9 dofileread.9 \

cvs diff -r1.44.16.1 -r1.44.16.2 src/share/man/man9/audio.9 (expand / switch to unified diff)

--- src/share/man/man9/audio.9 2018/05/15 13:42:50 1.44.16.1
+++ src/share/man/man9/audio.9 2018/06/07 18:24:15 1.44.16.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: audio.9,v 1.44.16.1 2018/05/15 13:42:50 martin Exp $ 1.\" $NetBSD: audio.9,v 1.44.16.2 2018/06/07 18:24:15 martin Exp $
2.\" 2.\"
3.\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Lennart Augustsson. 7.\" by Lennart Augustsson.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -582,19 +582,19 @@ and be of class @@ -582,19 +582,19 @@ and be of class
582.Dv AudioCoutputs . 582.Dv AudioCoutputs .
583.Pp 583.Pp
584There's one additional source recognized specially by 584There's one additional source recognized specially by
585.Dv AUDIO_SETINFO 585.Dv AUDIO_SETINFO
586and 586and
587.Dv AUDIO_GETINFO , 587.Dv AUDIO_GETINFO ,
588to be presented as monitor_gain, 588to be presented as monitor_gain,
589and that is a control named 589and that is a control named
590.Dv AudioNmonitor , 590.Dv AudioNmonitor ,
591of class 591of class
592.Dv AudioCmonitor . 592.Dv AudioCmonitor .
593.Sh SEE ALSO 593.Sh SEE ALSO
594.Xr audio 4 , 594.Xr audio 4 ,
595.Xr audio 7 595.Xr audio_system 9
596.Sh HISTORY 596.Sh HISTORY
597This 597This
598.Nm 598.Nm
599interface first appeared in 599interface first appeared in
600.Nx 1.3 . 600.Nx 1.3 .

File Added: src/share/man/man9/Attic/audio_system.9
.\"	$NetBSD: audio_system.9,v 1.1.2.2 2018/06/07 18:24:15 martin Exp $
.\"
.\" Copyright (c) 2016 - 2018  Nathanial Sloss <nathanialsloss@yahoo.com.au>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 28, 2018
.Dt AUDIO_SYSTEM 9
.Os
.Sh NAME
.Nm audio_system
.Nd the
.Nx
in-kernel audio mixer specification
.Sh INTRODUCTION
This document aims to describe all aspects of the in-kernel audio mixer
included with
.Nx 8
and onwards, describing its current behavior as of 2018.
.Sh VIRTUAL CHANNEL (VCHAN)
This is the most fundamental element to the mixer.
The vchan has all of the properties of the traditional single open
.Nx
audio channel.
It consists of playback and record rings along with
.Vt audio_info
structures.
.Pp
Upon opening of
.Pa /dev/audio
or
.Pa /dev/sound ,
a new vchan and mixerctl structure is created.
In the case of
.Pa /dev/sound ,
.Vt audio_info
structures are inherited from the last open of
.Pa /dev/audio
or
.Pa /dev/sound .
.Pp
All vchans are up or down sampled into the mix ring (intermediate) format
before being sent to hardware.
.Pp
It is described in the following diagram:
.Bd -literal
	VCHAN1---------\\
			\\   VCHAN0
	VCHAN2-------------MIX RING ---- HARDWARE
		...     /
	VCHANn---------/
.Ed
.Pp
In the case of
.Xr sysctl 8
.Dv usemixer=0
(see below), there is only one vchan whose play
and record rings are the hardware play/record rings.
.Pp
User accessible vchans are numbered starting at one (1).
Vchan 0 is used internally by the mixer for the mix ring and its ring buffers
are not user accessible.
.Pp
The only limit to the number of open vchans is the speed of the computer and the
number of free file descriptors.
.Sh BLOCK - SIZE / LATENCY
A block of audio data is the basic unit for audio data.
Audio applications will not commence playback until three (3) blocks have been
written - this is the source of latency in the mixer along with the size of the
audio data block.
.Pp
For normal uses of audio read/write there will be three blocks of audio data before
playback commences one in the vchan, one in the mix ring and one in the
hardware ring.
.Pp
The size of the audio data block is dependent on the audio format configured
by the application the latency
.Xr sysctl 8
and the underlying audio hardware.
.Pp
Some audio hardware devices only support a static block size, as such the
overall latency of the mixer for these devices cannot be changed.
Other devices such as those supported by
.Xr hdaudio 4
allow the hardware block size
to be changed, allowing the latency of the mixer to change from 4
milliseconds (ms) to 128 ms with the mixer intermediate format being 16 bit,
stereo, 48 kHz.
.Pp
With regard to mmapped audio, blocks are played back immediately so the latency
presented to applications is one third of the latency
.Xr sysctl 8
value.
.Pp
Latency can be calculated by the following formula:
.Bd -literal
	Latency (ms) =	 blocksize(bytes) * num blocks * 1000
			--------------------------------------
			freq(Hz) * bytes per sample * channels
.Ed
.Pp
Latency in the mixer and latency presented to audio applications is consistent,
it will be the same regardless of the audio format requested by the audio
application.
.Pp
The default latency configured at boot time is 150ms and is subject to the above
constraints.
.Sh ADDED IOCTLS
Two new ioctls have been added to accommodate mixing of multiple vchans:
.Bl -tag -width indent
.It Dv AUDIO_SETCHAN :
Allows setting the target vchan to operate on for subsequent
.Xr ioctl 2
calls.
.It Dv AUDIO_GETCHAN :
Returns the current vchan number.
.El
.Pp
These ioctls were necessary as some audio applications like to open an
.Xr audio 4
device and an
.Xr audioctl 4
device so to check on buffer usage and samples played etc.
.Pp
As opening an
.Xr audioctl 4
device would represent vchan 0 (the mix ring), these
ioctls allow setting the target vchan and
.Vt audio_info
structure to that of an existing vchan.
.Sh MIXERCTL INTERFACE / SOFTWARE VOLUME
Mixerctl structures are allocated when a new vchan is created.
The mixer control structure allows for setting the software volume for playback -
.Li vchan.dacN
or recording -
.Li vchan.adcN .
These are 8 bit values and the this value is applied during mixing into the mix
ring.
.Pp
The software volume is applied to all channels (1, 2, 4 etc.) in the vchan and at
present (2018-05-04) there are no balance controls for user accessible vchans.
.Pp
The first vchan corresponds to the
.Li vchan.dac1/adc1
mixer controls.
.Pp
All vchan mixer controls only have effect upon its own volume and writing to
.Li outputs.master
(or equivalent) control is required to change the volume of the hardware.
.Pp
Mixer controls are only present whilst the chan is in use and numbering starts
at one (1).
Mixer control numbers i.e.
.Li dac/adc1
correspond to their vchan number.
.Sh AUDIOCTL / AUDIO_INFO INTERFACE
Audioctl allows access to the
.Vt audio_info
structure of a given device.
Due to the audio mixer a
.Fl p
flag was added to allow access to a given vchan's
.Vt audio_info
structure.
The values for
.Fl p
are numbered starting at zero (0).
.Pp
Not specifying
.Fl p
is the same as specifying
.Fl p Ar 0
and will result in working with vchan 0 (the mix ring).
This will display the audio parameters of the mix ring and allow
setting the hardware gain and balance.
.Pp
This is for compatibility with existing applications and shell scripts
that are unaware of the
.Fl p
switch.
.Pp
The parameters for playback and recording only effect the particular vchan
being operated on (gain, sample rate, channels, encoding etc), except
.Fl p Ar 0
(the mix ring).
.Sh ADDED SYSCTLS
With the introduction of the audio mixer the following
.Xr sysctl 7 Ns s
have been added:
.Bl -tag -width indent
.It Li hw.driverN.frequency :
.It Li hw.driverN.precision :
.It Li hw.driverN.channels :
Intermediate mixing format.
(see below)
.It Li hw.driverN.latency :
Expressed in milliseconds.
(see above)
.It Li hw.driverN.multiuser :
Off/On (0/1), defaults to off.
This
.Xr sysctl 7
determines if multiple users are allowed to access the sound hardware.
The root user is always allowed access (i.e., for wsbell).
The first user to open the audio device has full control of the audio device
if this sysctl is set to off.
There currently is an outstanding PR about affecting a privileged process -
PR/52627.
.Pp
Ideally if root intervenes with the audio device, it should do so unaffected.
.Pp
If this control is set to on, then all users' audio data are mixed and all users
have access to the audio hardware.
.It Li hw.driverN.usemixer :
Off/On (0/1), defaults to on.
This
.Xr sysctl 7
enables or disables the audio mixer.
When set to off, the audio device can support only one vchan.
This vchan's play and record ring buffers are the hardware ring buffers.
.Pp
This option was added to aid older/slower systems where the extra overhead of
the audio mixer might pose a problem.
.El
.Sh INTERMEDIATE / MIXING FORMAT
The initial concept was to handle incoming audio data similarly to that of a
superheterodyne radio receiver:
.Pp
.Dl		RF -> IF -> AF
.Pp
So the corresponding mixing concept is:
.Pp
.Dl		vchan -> mixing format -> hardware
.Pp
The
.Xr sysctl 7 Ns s
described above determine the format for mixing.
All vchans are up or down sampled to this format before mixing takes place.
.Pp
On most systems this defaults to 16 bit stereo 48kHz.
The
.Xr sysctl 7 Ns s
governing the mixing format may only be changed when there are no
vchans in use.
.Pp
On faster systems the precision (8, 16, 32 bits) may be changed along with the
sample rate and number of channels (mono, stereo, 4 etc.).
.Pp
On older/slower systems utilizing audio mixing, it may be required to lower the
quality of this format to ease the amount of data processing whilst mixing.
.Pp
All possible audio formats (mulaw, alaw, slinear, ulinear, 8, 16, and 32 bit
precision) are converted for use by the audio mixer.
.Sh MEMORY MAPPED PLAYBACK
It is possible to use mmap for audio playback, achieving reduced latency.
However the audio applications selected format must match the
mixing/intermediate format (see above).
.Pp
It is possible to obtain the
.Vt audio_info
for vchan0 which contains the
intermediate/mixing format to ease applications configuring for mmapped audio.
.Pp
At present most applications don't use the mix ring's
.Vt audio_info
structure to obtain the requiredplay back parameters and some user
intervention is required to set the audio format for the application.
.Sh HARDWARE DRIVER REQUIREMENTS
Audio mixing requires signed linear support in the host's endianness.
Driver authors should support slinear_le and slinear_be formats.
.Pp
If the audio hardware is intended to be used with the mixer disabled, mulaw 1ch
8000 hz needs to be supported also.
.Pp
This is easily achievable with the auconv framework/filters.
All new drivers should consider the use of auconv where possible.
.Sh SEE ALSO
.Xr audioctl 1 ,
.Xr mixerctl 1 ,
.Xr audio 4 ,
.Xr audio 9
.Sh AUTHORS
.An Nathanial Sloss
.Sh SPECIAL THANKS
Great appreciation goes to Onno van der Linden, isaki@, maya@, jmcneill@,
pgoyette@, mrg@, riastradh@ and christos@ \(em without their input, this code would
not be what it is currently.

cvs diff -r1.18 -r1.18.2.1 src/share/man/man9/intro.9 (expand / switch to unified diff)

--- src/share/man/man9/intro.9 2017/05/30 13:49:01 1.18
+++ src/share/man/man9/intro.9 2018/06/07 18:24:15 1.18.2.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: intro.9,v 1.18 2017/05/30 13:49:01 abhinav Exp $ 1.\" $NetBSD: intro.9,v 1.18.2.1 2018/06/07 18:24:15 martin Exp $
2.\" 2.\"
3.\" Copyright (c) 1997, 2007 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1997, 2007 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jeremy Cooper, and Mindaugas Rasiukevicius. 7.\" by Jeremy Cooper, and Mindaugas Rasiukevicius.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -421,26 +421,31 @@ See @@ -421,26 +421,31 @@ See
421.Pp 421.Pp
422Generic virtual console framework. 422Generic virtual console framework.
423See 423See
424.Xr vcons 9 . 424.Xr vcons 9 .
425.Pp 425.Pp
426Machine-independent console support. 426Machine-independent console support.
427See 427See
428.Xr wscons 9 . 428.Xr wscons 9 .
429.Sh DEVICE SPECIFIC IMPLEMENTATION 429.Sh DEVICE SPECIFIC IMPLEMENTATION
430Interface between low and high level audio drivers. 430Interface between low and high level audio drivers.
431See 431See
432.Xr audio 9 . 432.Xr audio 9 .
433.Pp 433.Pp
 434The
 435.Nx audio specification.
 436See
 437.Xr audio_system 9 .
 438.Pp
434Bluetooth Device/Protocol API. 439Bluetooth Device/Protocol API.
435See 440See
436.Xr bluetooth 9 . 441.Xr bluetooth 9 .
437.Pp 442.Pp
438Support for CardBus PC-Card devices. 443Support for CardBus PC-Card devices.
439See 444See
440.Xr cardbus 9 . 445.Xr cardbus 9 .
441.Pp 446.Pp
442VESA Display Data Channel V2. 447VESA Display Data Channel V2.
443See 448See
444.Xr ddc 9 . 449.Xr ddc 9 .
445.Pp 450.Pp
446VESA Extended Display Identification Data. 451VESA Extended Display Identification Data.

cvs diff -r1.357.2.12 -r1.357.2.13 src/sys/dev/Attic/audio.c (expand / switch to unified diff)

--- src/sys/dev/Attic/audio.c 2018/05/15 13:42:50 1.357.2.12
+++ src/sys/dev/Attic/audio.c 2018/06/07 18:24:16 1.357.2.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: audio.c,v 1.357.2.12 2018/05/15 13:42:50 martin Exp $ */ 1/* $NetBSD: audio.c,v 1.357.2.13 2018/06/07 18:24:16 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au> 4 * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Copyright (c) 2008 The NetBSD Foundation, Inc. 7 * Copyright (c) 2008 The NetBSD Foundation, Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This code is derived from software contributed to The NetBSD Foundation 10 * This code is derived from software contributed to The NetBSD Foundation
11 * by Andrew Doran. 11 * by Andrew Doran.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -138,27 +138,27 @@ @@ -138,27 +138,27 @@
138 * query_devinfo - x 138 * query_devinfo - x
139 * allocm - - Called at attach time 139 * allocm - - Called at attach time
140 * freem - - Called at attach time 140 * freem - - Called at attach time
141 * round_buffersize - x 141 * round_buffersize - x
142 * mappage - - Mem. unchanged after attach 142 * mappage - - Mem. unchanged after attach
143 * get_props - x 143 * get_props - x
144 * trigger_output x x 144 * trigger_output x x
145 * trigger_input x x 145 * trigger_input x x
146 * dev_ioctl - x 146 * dev_ioctl - x
147 * get_locks - - Called at attach time 147 * get_locks - - Called at attach time
148 */ 148 */
149 149
150#include <sys/cdefs.h> 150#include <sys/cdefs.h>
151__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.12 2018/05/15 13:42:50 martin Exp $"); 151__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.13 2018/06/07 18:24:16 martin Exp $");
152 152
153#ifdef _KERNEL_OPT 153#ifdef _KERNEL_OPT
154#include "audio.h" 154#include "audio.h"
155#include "midi.h" 155#include "midi.h"
156#endif 156#endif
157 157
158#if NAUDIO > 0 158#if NAUDIO > 0
159 159
160#include <sys/types.h> 160#include <sys/types.h>
161#include <sys/param.h> 161#include <sys/param.h>
162#include <sys/ioctl.h> 162#include <sys/ioctl.h>
163#include <sys/fcntl.h> 163#include <sys/fcntl.h>
164#include <sys/file.h> 164#include <sys/file.h>
@@ -224,26 +224,28 @@ int audio_idle_timeout = 30; @@ -224,26 +224,28 @@ int audio_idle_timeout = 30;
224 224
225#define HW_UNLOCK(x) do { \ 225#define HW_UNLOCK(x) do { \
226 if ((x) == sc->sc_hwvc) \ 226 if ((x) == sc->sc_hwvc) \
227 mutex_exit(sc->sc_intr_lock); \ 227 mutex_exit(sc->sc_intr_lock); \
228} while (0) 228} while (0)
229 229
230int audio_blk_ms = AUDIO_BLK_MS; 230int audio_blk_ms = AUDIO_BLK_MS;
231 231
232int audiosetinfo(struct audio_softc *, struct audio_info *, bool, 232int audiosetinfo(struct audio_softc *, struct audio_info *, bool,
233 struct virtual_channel *); 233 struct virtual_channel *);
234int audiogetinfo(struct audio_softc *, struct audio_info *, int, 234int audiogetinfo(struct audio_softc *, struct audio_info *, int,
235 struct virtual_channel *); 235 struct virtual_channel *);
236 236
 237int audioctl_open(dev_t, struct audio_softc *, int, int, struct lwp *,
 238 struct file **);
237int audio_open(dev_t, struct audio_softc *, int, int, struct lwp *, 239int audio_open(dev_t, struct audio_softc *, int, int, struct lwp *,
238 struct file **); 240 struct file **);
239int audio_close(struct audio_softc *, int, struct audio_chan *); 241int audio_close(struct audio_softc *, int, struct audio_chan *);
240int audio_read(struct audio_softc *, struct uio *, int, 242int audio_read(struct audio_softc *, struct uio *, int,
241 struct virtual_channel *); 243 struct virtual_channel *);
242int audio_write(struct audio_softc *, struct uio *, int, 244int audio_write(struct audio_softc *, struct uio *, int,
243 struct virtual_channel *); 245 struct virtual_channel *);
244int audio_ioctl(dev_t, struct audio_softc *, u_long, void *, int, 246int audio_ioctl(dev_t, struct audio_softc *, u_long, void *, int,
245 struct lwp *, struct audio_chan *); 247 struct lwp *, struct audio_chan *);
246int audio_poll(struct audio_softc *, int, struct lwp *, 248int audio_poll(struct audio_softc *, int, struct lwp *,
247 struct virtual_channel *); 249 struct virtual_channel *);
248int audio_kqfilter(struct audio_chan *, struct knote *); 250int audio_kqfilter(struct audio_chan *, struct knote *);
249int audio_mmap(struct audio_softc *, off_t *, size_t, int, int *, int *, 251int audio_mmap(struct audio_softc *, off_t *, size_t, int, int *, int *,
@@ -1667,29 +1669,31 @@ audiobellioctl(struct file *fp, u_long c @@ -1667,29 +1669,31 @@ audiobellioctl(struct file *fp, u_long c
1667static int 1669static int
1668audioopen(dev_t dev, int flags, int ifmt, struct lwp *l) 1670audioopen(dev_t dev, int flags, int ifmt, struct lwp *l)
1669{ 1671{
1670 struct audio_softc *sc; 1672 struct audio_softc *sc;
1671 struct file *fp; 1673 struct file *fp;
1672 int error; 1674 int error;
1673 1675
1674 if ((error = audio_enter(dev, RW_WRITER, &sc)) != 0) 1676 if ((error = audio_enter(dev, RW_WRITER, &sc)) != 0)
1675 return error; 1677 return error;
1676 device_active(sc->dev, DVA_SYSTEM); 1678 device_active(sc->dev, DVA_SYSTEM);
1677 switch (AUDIODEV(dev)) { 1679 switch (AUDIODEV(dev)) {
1678 case SOUND_DEVICE: 1680 case SOUND_DEVICE:
1679 case AUDIO_DEVICE: 1681 case AUDIO_DEVICE:
1680 case AUDIOCTL_DEVICE: 
1681 error = audio_open(dev, sc, flags, ifmt, l, &fp); 1682 error = audio_open(dev, sc, flags, ifmt, l, &fp);
1682 break; 1683 break;
 1684 case AUDIOCTL_DEVICE:
 1685 error = audioctl_open(dev, sc, flags, ifmt, l, &fp);
 1686 break;
1683 case MIXER_DEVICE: 1687 case MIXER_DEVICE:
1684 error = mixer_open(dev, sc, flags, ifmt, l, &fp); 1688 error = mixer_open(dev, sc, flags, ifmt, l, &fp);
1685 break; 1689 break;
1686 default: 1690 default:
1687 error = ENXIO; 1691 error = ENXIO;
1688 break; 1692 break;
1689 } 1693 }
1690 audio_exit(sc); 1694 audio_exit(sc);
1691 1695
1692 return error; 1696 return error;
1693} 1697}
1694 1698
1695static int 1699static int
@@ -1703,29 +1707,31 @@ audioclose(struct file *fp) @@ -1703,29 +1707,31 @@ audioclose(struct file *fp)
1703 chan = fp->f_audioctx; 1707 chan = fp->f_audioctx;
1704 if (chan == NULL) /* XXX:NS Why is this needed. */ 1708 if (chan == NULL) /* XXX:NS Why is this needed. */
1705 return EIO; 1709 return EIO;
1706 1710
1707 dev = chan->dev; 1711 dev = chan->dev;
1708 1712
1709 if ((error = audio_enter(dev, RW_WRITER, &sc)) != 0) 1713 if ((error = audio_enter(dev, RW_WRITER, &sc)) != 0)
1710 return error; 1714 return error;
1711 1715
1712 device_active(sc->dev, DVA_SYSTEM); 1716 device_active(sc->dev, DVA_SYSTEM);
1713 switch (AUDIODEV(dev)) { 1717 switch (AUDIODEV(dev)) {
1714 case SOUND_DEVICE: 1718 case SOUND_DEVICE:
1715 case AUDIO_DEVICE: 1719 case AUDIO_DEVICE:
1716 case AUDIOCTL_DEVICE: 
1717 error = audio_close(sc, fp->f_flag, chan); 1720 error = audio_close(sc, fp->f_flag, chan);
1718 break; 1721 break;
 1722 case AUDIOCTL_DEVICE:
 1723 error = 0;
 1724 break;
1719 case MIXER_DEVICE: 1725 case MIXER_DEVICE:
1720 error = mixer_close(sc, fp->f_flag, chan); 1726 error = mixer_close(sc, fp->f_flag, chan);
1721 break; 1727 break;
1722 default: 1728 default:
1723 error = ENXIO; 1729 error = ENXIO;
1724 break; 1730 break;
1725 } 1731 }
1726 if (error == 0) { 1732 if (error == 0) {
1727 kmem_free(fp->f_audioctx, sizeof(struct audio_chan)); 1733 kmem_free(fp->f_audioctx, sizeof(struct audio_chan));
1728 fp->f_audioctx = NULL; 1734 fp->f_audioctx = NULL;
1729 } 1735 }
1730 1736
1731 audio_exit(sc); 1737 audio_exit(sc);
@@ -2133,26 +2139,70 @@ audio_calcwater(struct audio_softc *sc,  @@ -2133,26 +2139,70 @@ audio_calcwater(struct audio_softc *sc,
2133 2139
2134 if (audio_can_capture(sc) && vc && vc->sc_rustream) { 2140 if (audio_can_capture(sc) && vc && vc->sc_rustream) {
2135 vc->sc_mrr.usedhigh = 2141 vc->sc_mrr.usedhigh =
2136 vc->sc_rustream->end - vc->sc_rustream->start - 2142 vc->sc_rustream->end - vc->sc_rustream->start -
2137 vc->sc_mrr.blksize; 2143 vc->sc_mrr.blksize;
2138 vc->sc_mrr.usedlow = 0; 2144 vc->sc_mrr.usedlow = 0;
2139 DPRINTF(("%s: plow=%d phigh=%d rlow=%d rhigh=%d\n", __func__, 2145 DPRINTF(("%s: plow=%d phigh=%d rlow=%d rhigh=%d\n", __func__,
2140 vc->sc_mpr.usedlow, vc->sc_mpr.usedhigh, 2146 vc->sc_mpr.usedlow, vc->sc_mpr.usedhigh,
2141 vc->sc_mrr.usedlow, vc->sc_mrr.usedhigh)); 2147 vc->sc_mrr.usedlow, vc->sc_mrr.usedhigh));
2142 } 2148 }
2143} 2149}
2144 2150
2145int 2151int
 2152audioctl_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
 2153 struct lwp *l, struct file **nfp)
 2154{
 2155 struct file *fp;
 2156 int error, fd;
 2157 const struct audio_hw_if *hw;
 2158 struct virtual_channel *vc;
 2159 struct audio_chan *chan;
 2160
 2161 KASSERT(mutex_owned(sc->sc_lock));
 2162
 2163 if (sc->sc_usemixer && !sc->sc_ready)
 2164 return ENXIO;
 2165
 2166 hw = sc->hw_if;
 2167 if (hw == NULL)
 2168 return ENXIO;
 2169
 2170 chan = kmem_zalloc(sizeof(struct audio_chan), KM_SLEEP);
 2171 if (sc->sc_usemixer)
 2172 vc = &sc->sc_mixring;
 2173 else
 2174 vc = sc->sc_hwvc;
 2175 chan->vc = vc;
 2176
 2177 error = fd_allocfile(&fp, &fd);
 2178 if (error)
 2179 goto bad;
 2180
 2181 chan->dev = dev;
 2182 chan->chan = 0;
 2183 chan->deschan = 0;
 2184
 2185 error = fd_clone(fp, fd, flags, &audio_fileops, chan);
 2186 KASSERT(error == EMOVEFD);
 2187
 2188 *nfp = fp;
 2189 return error;
 2190bad:
 2191 kmem_free(chan, sizeof(struct audio_chan));
 2192 return error;
 2193}
 2194
 2195int
2146audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt, 2196audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
2147 struct lwp *l, struct file **nfp) 2197 struct lwp *l, struct file **nfp)
2148{ 2198{
2149 struct file *fp; 2199 struct file *fp;
2150 int error, fd, n; 2200 int error, fd, n;
2151 u_int mode; 2201 u_int mode;
2152 const struct audio_hw_if *hw; 2202 const struct audio_hw_if *hw;
2153 struct virtual_channel *vc; 2203 struct virtual_channel *vc;
2154 struct audio_chan *chan; 2204 struct audio_chan *chan;
2155 2205
2156 KASSERT(mutex_owned(sc->sc_lock)); 2206 KASSERT(mutex_owned(sc->sc_lock));
2157 2207
2158 if (sc->sc_usemixer && !sc->sc_ready) 2208 if (sc->sc_usemixer && !sc->sc_ready)
@@ -2164,29 +2214,26 @@ audio_open(dev_t dev, struct audio_softc @@ -2164,29 +2214,26 @@ audio_open(dev_t dev, struct audio_softc
2164 2214
2165 n = 1; 2215 n = 1;
2166 chan = SIMPLEQ_LAST(&sc->sc_audiochan, audio_chan, entries); 2216 chan = SIMPLEQ_LAST(&sc->sc_audiochan, audio_chan, entries);
2167 if (chan != NULL) 2217 if (chan != NULL)
2168 n = chan->chan + 1; 2218 n = chan->chan + 1;
2169 2219
2170 chan = kmem_zalloc(sizeof(struct audio_chan), KM_SLEEP); 2220 chan = kmem_zalloc(sizeof(struct audio_chan), KM_SLEEP);
2171 if (sc->sc_usemixer) 2221 if (sc->sc_usemixer)
2172 vc = kmem_zalloc(sizeof(struct virtual_channel), KM_SLEEP); 2222 vc = kmem_zalloc(sizeof(struct virtual_channel), KM_SLEEP);
2173 else 2223 else
2174 vc = sc->sc_hwvc; 2224 vc = sc->sc_hwvc;
2175 chan->vc = vc; 2225 chan->vc = vc;
2176 2226
2177 if (!sc->sc_usemixer && AUDIODEV(dev) == AUDIOCTL_DEVICE) 
2178 goto audioctl_dev; 
2179 
2180 if (sc->sc_usemixer) { 2227 if (sc->sc_usemixer) {
2181 vc->sc_open = 0; 2228 vc->sc_open = 0;
2182 vc->sc_mode = 0; 2229 vc->sc_mode = 0;
2183 vc->sc_nrfilters = 0; 2230 vc->sc_nrfilters = 0;
2184 memset(vc->sc_rfilters, 0, 2231 memset(vc->sc_rfilters, 0,
2185 sizeof(vc->sc_rfilters)); 2232 sizeof(vc->sc_rfilters));
2186 vc->sc_rbus = false; 2233 vc->sc_rbus = false;
2187 vc->sc_npfilters = 0; 2234 vc->sc_npfilters = 0;
2188 memset(vc->sc_pfilters, 0, 2235 memset(vc->sc_pfilters, 0,
2189 sizeof(vc->sc_pfilters)); 2236 sizeof(vc->sc_pfilters));
2190 vc->sc_draining = false; 2237 vc->sc_draining = false;
2191 vc->sc_pbus = false; 2238 vc->sc_pbus = false;
2192 vc->sc_lastinfovalid = false; 2239 vc->sc_lastinfovalid = false;
@@ -2284,43 +2331,39 @@ audio_open(dev_t dev, struct audio_softc @@ -2284,43 +2331,39 @@ audio_open(dev_t dev, struct audio_softc
2284 * Sample rate and precision are supposed to be set to proper 2331 * Sample rate and precision are supposed to be set to proper
2285 * default values by the hardware driver, so that it may give 2332 * default values by the hardware driver, so that it may give
2286 * us these values. 2333 * us these values.
2287 */ 2334 */
2288 if (vc->sc_rparams.precision == 0 || vc->sc_pparams.precision == 0) { 2335 if (vc->sc_rparams.precision == 0 || vc->sc_pparams.precision == 0) {
2289 printf("audio_open: 0 precision\n"); 2336 printf("audio_open: 0 precision\n");
2290 goto bad; 2337 goto bad;
2291 } 2338 }
2292#endif 2339#endif
2293 2340
2294 /* audio_close() decreases sc_mpr[n].usedlow, recalculate here */ 2341 /* audio_close() decreases sc_mpr[n].usedlow, recalculate here */
2295 audio_calcwater(sc, vc); 2342 audio_calcwater(sc, vc);
2296 2343
2297audioctl_dev: 
2298 error = fd_allocfile(&fp, &fd); 2344 error = fd_allocfile(&fp, &fd);
2299 if (error) 2345 if (error)
2300 goto bad; 2346 goto bad;
2301 if (!sc->sc_usemixer && AUDIODEV(dev) == AUDIOCTL_DEVICE) 
2302 goto setup_chan; 
2303 2347
2304 DPRINTF(("audio_open: done sc_mode = 0x%x\n", vc->sc_mode)); 2348 DPRINTF(("audio_open: done sc_mode = 0x%x\n", vc->sc_mode));
2305 2349
2306 if (sc->sc_usemixer) 2350 if (sc->sc_usemixer)
2307 grow_mixer_states(sc, 2); 2351 grow_mixer_states(sc, 2);
2308 if (flags & FREAD) 2352 if (flags & FREAD)
2309 sc->sc_recopens++; 2353 sc->sc_recopens++;
2310 if (flags & FWRITE) 2354 if (flags & FWRITE)
2311 sc->sc_opens++; 2355 sc->sc_opens++;
2312 2356
2313setup_chan: 
2314 chan->dev = dev; 2357 chan->dev = dev;
2315 chan->chan = n; 2358 chan->chan = n;
2316 chan->deschan = n; 2359 chan->deschan = n;
2317 if (sc->sc_usemixer) 2360 if (sc->sc_usemixer)
2318 SIMPLEQ_INSERT_TAIL(&sc->sc_audiochan, chan, entries); 2361 SIMPLEQ_INSERT_TAIL(&sc->sc_audiochan, chan, entries);
2319 2362
2320 error = fd_clone(fp, fd, flags, &audio_fileops, chan); 2363 error = fd_clone(fp, fd, flags, &audio_fileops, chan);
2321 KASSERT(error == EMOVEFD); 2364 KASSERT(error == EMOVEFD);
2322 2365
2323 *nfp = fp; 2366 *nfp = fp;
2324 return error; 2367 return error;
2325 2368
2326bad: 2369bad:
@@ -2477,29 +2520,26 @@ audio_drain(struct audio_softc *sc, stru @@ -2477,29 +2520,26 @@ audio_drain(struct audio_softc *sc, stru
2477 2520
2478/* 2521/*
2479 * Close an audio chip. 2522 * Close an audio chip.
2480 */ 2523 */
2481/* ARGSUSED */ 2524/* ARGSUSED */
2482int 2525int
2483audio_close(struct audio_softc *sc, int flags, struct audio_chan *chan) 2526audio_close(struct audio_softc *sc, int flags, struct audio_chan *chan)
2484{ 2527{
2485 struct virtual_channel *vc; 2528 struct virtual_channel *vc;
2486 const struct audio_hw_if *hw; 2529 const struct audio_hw_if *hw;
2487 2530
2488 KASSERT(mutex_owned(sc->sc_lock)); 2531 KASSERT(mutex_owned(sc->sc_lock));
2489  2532
2490 if (!sc->sc_usemixer && AUDIODEV(chan->dev) == AUDIOCTL_DEVICE) 
2491 return 0; 
2492 
2493 if (sc->sc_opens == 0 && sc->sc_recopens == 0) 2533 if (sc->sc_opens == 0 && sc->sc_recopens == 0)
2494 return ENXIO; 2534 return ENXIO;
2495 2535
2496 vc = chan->vc; 2536 vc = chan->vc;
2497 2537
2498 hw = sc->hw_if; 2538 hw = sc->hw_if;
2499 if (hw == NULL) 2539 if (hw == NULL)
2500 return ENXIO; 2540 return ENXIO;
2501 mutex_enter(sc->sc_intr_lock); 2541 mutex_enter(sc->sc_intr_lock);
2502 DPRINTF(("audio_close: sc=%p\n", sc)); 2542 DPRINTF(("audio_close: sc=%p\n", sc));
2503 /* Stop recording. */ 2543 /* Stop recording. */
2504 if (sc->sc_recopens == 1 && (flags & FREAD) && vc->sc_rbus) { 2544 if (sc->sc_recopens == 1 && (flags & FREAD) && vc->sc_rbus) {
2505 /* 2545 /*
@@ -3075,27 +3115,27 @@ audio_ioctl(dev_t dev, struct audio_soft @@ -3075,27 +3115,27 @@ audio_ioctl(dev_t dev, struct audio_soft
3075 3115
3076 KASSERT(mutex_owned(sc->sc_lock)); 3116 KASSERT(mutex_owned(sc->sc_lock));
3077 3117
3078 if (sc->sc_usemixer && chan->deschan != 0) { 3118 if (sc->sc_usemixer && chan->deschan != 0) {
3079 SIMPLEQ_FOREACH(pchan, &sc->sc_audiochan, entries) { 3119 SIMPLEQ_FOREACH(pchan, &sc->sc_audiochan, entries) {
3080 if (pchan->chan == chan->deschan) 3120 if (pchan->chan == chan->deschan)
3081 break; 3121 break;
3082 } 3122 }
3083 if (pchan == NULL) 3123 if (pchan == NULL)
3084 return ENXIO; 3124 return ENXIO;
3085 } else 3125 } else
3086 pchan = chan; 3126 pchan = chan;
3087 3127
3088 if (chan->deschan != 0) 3128 if (!sc->sc_usemixer || chan->deschan != 0)
3089 vc = pchan->vc; 3129 vc = pchan->vc;
3090 else 3130 else
3091 vc = &sc->sc_mixring; 3131 vc = &sc->sc_mixring;
3092 3132
3093 DPRINTF(("audio_ioctl(%lu,'%c',%lu)\n", 3133 DPRINTF(("audio_ioctl(%lu,'%c',%lu)\n",
3094 IOCPARM_LEN(cmd), (char)IOCGROUP(cmd), cmd&0xff)); 3134 IOCPARM_LEN(cmd), (char)IOCGROUP(cmd), cmd&0xff));
3095 hw = sc->hw_if; 3135 hw = sc->hw_if;
3096 if (hw == NULL) 3136 if (hw == NULL)
3097 return ENXIO; 3137 return ENXIO;
3098 error = 0; 3138 error = 0;
3099 switch (cmd) { 3139 switch (cmd) {
3100 case AUDIO_GETCHAN: 3140 case AUDIO_GETCHAN:
3101 if ((int *)addr != NULL) 3141 if ((int *)addr != NULL)
@@ -4747,28 +4787,28 @@ done: @@ -4747,28 +4787,28 @@ done:
4747 } 4787 }
4748 if (SPECIFIED(p->gain)) { 4788 if (SPECIFIED(p->gain)) {
4749 if (!sc->sc_usemixer || vc == &sc->sc_mixring) { 4789 if (!sc->sc_usemixer || vc == &sc->sc_mixring) {
4750 au_get_gain(sc, &sc->sc_outports, &gain, &balance); 4790 au_get_gain(sc, &sc->sc_outports, &gain, &balance);
4751 error = au_set_gain(sc, &sc->sc_outports, p->gain, balance); 4791 error = au_set_gain(sc, &sc->sc_outports, p->gain, balance);
4752 if (error) 4792 if (error)
4753 goto cleanup; 4793 goto cleanup;
4754 } else 4794 } else
4755 vc->sc_swvol = p->gain; 4795 vc->sc_swvol = p->gain;
4756 } 4796 }
4757 4797
4758 if (SPECIFIED(r->gain)) { 4798 if (SPECIFIED(r->gain)) {
4759 if (!sc->sc_usemixer || vc == &sc->sc_mixring) { 4799 if (!sc->sc_usemixer || vc == &sc->sc_mixring) {
4760 au_get_gain(sc, &sc->sc_outports, &gain, &balance); 4800 au_get_gain(sc, &sc->sc_inports, &gain, &balance);
4761 error = au_set_gain(sc, &sc->sc_outports, r->gain, balance); 4801 error = au_set_gain(sc, &sc->sc_inports, r->gain, balance);
4762 if (error) 4802 if (error)
4763 goto cleanup; 4803 goto cleanup;
4764 } else 4804 } else
4765 vc->sc_recswvol = r->gain; 4805 vc->sc_recswvol = r->gain;
4766 } 4806 }
4767 4807
4768 if (SPECIFIED_CH(p->balance)) { 4808 if (SPECIFIED_CH(p->balance)) {
4769 if (!sc->sc_usemixer || vc == &sc->sc_mixring) { 4809 if (!sc->sc_usemixer || vc == &sc->sc_mixring) {
4770 au_get_gain(sc, &sc->sc_outports, &gain, &balance); 4810 au_get_gain(sc, &sc->sc_outports, &gain, &balance);
4771 error = au_set_gain(sc, &sc->sc_outports, gain, p->balance); 4811 error = au_set_gain(sc, &sc->sc_outports, gain, p->balance);
4772 if (error) 4812 if (error)
4773 goto cleanup; 4813 goto cleanup;
4774 } 4814 }