Module Name: src
Committed By: snj
Date: Tue Aug 1 23:21:30 UTC 2017
Modified Files:
src/sys/dev [netbsd-8]: auconv.c auconv.h
src/sys/dev/ic [netbsd-8]: am7930.c
Log Message:
Pull up following revision(s) (requested by nat in ticket #165):
sys/dev/auconv.c: revision 1.29
sys/dev/auconv.h: revision 1.19
sys/dev/ic/am7930.c: revision 1.56
Add a null_filter to help with the audio autoconfig of pmax.
Tested by flxd@.
To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/auconv.c
cvs rdiff -u -r1.16.42.1 -r1.16.42.2 src/sys/dev/auconv.h
cvs rdiff -u -r1.53.8.1 -r1.53.8.2 src/sys/dev/ic/am7930.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/auconv.c
diff -u src/sys/dev/auconv.c:1.26.2.1 src/sys/dev/auconv.c:1.26.2.2
--- src/sys/dev/auconv.c:1.26.2.1 Fri Jun 30 06:38:00 2017
+++ src/sys/dev/auconv.c Tue Aug 1 23:21:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: auconv.c,v 1.26.2.1 2017/06/30 06:38:00 snj Exp $ */
+/* $NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.1 2017/06/30 06:38:00 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $");
#include <sys/types.h>
#include <sys/audioio.h>
@@ -456,6 +456,24 @@ DEFINE_FILTER(swap_bytes)
return 0;
}
+DEFINE_FILTER(null_filter)
+{
+ stream_filter_t *this;
+ int m, err;
+
+ this = (stream_filter_t *)self;
+ max_used = (max_used + 1) & ~1; /* round up to even */
+ if ((err = this->prev->fetch_to(sc, this->prev, this->src, max_used)))
+ return err;
+ m = (dst->end - dst->start) & ~1;
+ m = min(m, max_used);
+ FILTER_LOOP_PROLOGUE(this->src, 1, dst, 1, m) {
+ *d = *s;
+ } FILTER_LOOP_EPILOGUE(this->src, dst);
+
+ return 0;
+}
+
DEFINE_FILTER(swap_bytes_change_sign16)
{
stream_filter_t *this;
Index: src/sys/dev/auconv.h
diff -u src/sys/dev/auconv.h:1.16.42.1 src/sys/dev/auconv.h:1.16.42.2
--- src/sys/dev/auconv.h:1.16.42.1 Fri Jun 30 06:38:00 2017
+++ src/sys/dev/auconv.h Tue Aug 1 23:21:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: auconv.h,v 1.16.42.1 2017/06/30 06:38:00 snj Exp $ */
+/* $NetBSD: auconv.h,v 1.16.42.2 2017/08/01 23:21:30 snj Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@ extern stream_filter_factory_t linear8_8
extern stream_filter_factory_t linear8_8_to_linear24;
extern stream_filter_factory_t linear8_8_to_linear16;
extern stream_filter_factory_t linear8_8_to_linear8;
+extern stream_filter_factory_t null_filter;
#define linear16_to_linear8 linear16_16_to_linear8
#define linear8_to_linear16 linear8_8_to_linear16
Index: src/sys/dev/ic/am7930.c
diff -u src/sys/dev/ic/am7930.c:1.53.8.1 src/sys/dev/ic/am7930.c:1.53.8.2
--- src/sys/dev/ic/am7930.c:1.53.8.1 Fri Jun 30 06:32:21 2017
+++ src/sys/dev/ic/am7930.c Tue Aug 1 23:21:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: am7930.c,v 1.53.8.1 2017/06/30 06:32:21 snj Exp $ */
+/* $NetBSD: am7930.c,v 1.53.8.2 2017/08/01 23:21:30 snj Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53.8.1 2017/06/30 06:32:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53.8.2 2017/08/01 23:21:30 snj Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -137,6 +137,7 @@ static const uint16_t ger_coeff[] = {
#define NGER (sizeof(ger_coeff) / sizeof(ger_coeff[0]))
};
+extern stream_filter_factory_t null_filter;
/*
* Reset chip and set boot-time softc defaults.
@@ -239,11 +240,14 @@ am7930_set_params(void *addr, int setmod
if (sc->sc_glue->output_conv != NULL) {
hw = *p;
hw.encoding = AUDIO_ENCODING_NONE;
+ hw.precision = 8;
+ pfil->append(pfil, null_filter, &hw);
hw.precision *= sc->sc_glue->factor;
pfil->append(pfil, sc->sc_glue->output_conv, &hw);
}
if (p->encoding == AUDIO_ENCODING_SLINEAR) {
hw = *p;
+ hw.precision = 8;
hw.encoding = AUDIO_ENCODING_ULAW;
pfil->append(pfil, linear8_to_mulaw, &hw);
}
@@ -260,11 +264,14 @@ am7930_set_params(void *addr, int setmod
if (sc->sc_glue->input_conv != NULL) {
hw = *r;
hw.encoding = AUDIO_ENCODING_NONE;
+ hw.precision = 8;
+ pfil->append(pfil, null_filter, &hw);
hw.precision *= sc->sc_glue->factor;
pfil->append(rfil, sc->sc_glue->input_conv, &hw);
}
if (r->encoding == AUDIO_ENCODING_SLINEAR) {
hw = *r;
+ hw.precision = 8;
hw.encoding = AUDIO_ENCODING_ULAW;
rfil->append(rfil, mulaw_to_linear8, &hw);
}