Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Improved audiostartp for when audio mixing is disabled.
details: https://anonhg.NetBSD.org/src/rev/e82cbc487631
branches: trunk
changeset: 357550:e82cbc487631
user: nat <nat%NetBSD.org@localhost>
date: Wed Nov 15 01:58:48 2017 +0000
description:
Improved audiostartp for when audio mixing is disabled.
diffstat:
sys/dev/audio.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diffs (54 lines):
diff -r 5880f5843622 -r e82cbc487631 sys/dev/audio.c
--- a/sys/dev/audio.c Wed Nov 15 01:55:45 2017 +0000
+++ b/sys/dev/audio.c Wed Nov 15 01:58:48 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.434 2017/11/15 01:55:45 nat Exp $ */
+/* $NetBSD: audio.c,v 1.435 2017/11/15 01:58:48 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.434 2017/11/15 01:55:45 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.435 2017/11/15 01:58:48 nat Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -3593,7 +3593,13 @@
if (vc == sc->sc_hwvc && sc->sc_usemixer)
return 0;
- if (!vc->sc_mpr.mmapped && used < sc->sc_mixring.sc_mpr.blksize) {
+ int blksize;
+ if (sc->sc_usemixer)
+ blksize = sc->sc_mixring.sc_mpr.blksize;
+ else
+ blksize = vc->sc_mpr.blksize;
+
+ if (!vc->sc_mpr.mmapped && used < blksize) {
cv_broadcast(&sc->sc_wchan);
DPRINTF(("%s: wakeup and return\n", __func__));
return 0;
@@ -3610,13 +3616,14 @@
error = mix_write(sc);
if (error)
goto done;
- vc = sc->sc_hwvc;
- vc->sc_mpr.s.outp =
- audio_stream_add_outp(&vc->sc_mpr.s,
- vc->sc_mpr.s.outp, vc->sc_mpr.blksize);
- error = mix_write(sc);
- if (sc->sc_usemixer)
+ if (sc->sc_usemixer) {
+ vc = sc->sc_hwvc;
+ vc->sc_mpr.s.outp =
+ audio_stream_add_outp(&vc->sc_mpr.s,
+ vc->sc_mpr.s.outp, vc->sc_mpr.blksize);
+ error = mix_write(sc);
cv_broadcast(&sc->sc_condvar);
+ }
done:
mutex_exit(sc->sc_intr_lock);
}
Home |
Main Index |
Thread Index |
Old Index