summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2019-03-31 17:55:09 +0000
committerratchov <ratchov@openbsd.org>2019-03-31 17:55:09 +0000
commitf19882cd56e3932363b0058026e7ceb5cd53a878 (patch)
treeb074c3a11c6f054a6e544080de6a82439febafc2
parentDon't use memcpy for struct bgpd_config, the pointers and lists in that (diff)
downloadwireguard-openbsd-f19882cd56e3932363b0058026e7ceb5cd53a878.tar.xz
wireguard-openbsd-f19882cd56e3932363b0058026e7ceb5cd53a878.zip
Don't try to recover when DMA pointers wrap if the driver is
using bounce buffers. In this case, hardware underruns are managed by the driver on the bounce buffers, not the audio ring buffer.
-rw-r--r--sys/dev/audio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 8e8be366ec8..dcce535ed7e 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.176 2019/03/12 08:16:29 ratchov Exp $ */
+/* $OpenBSD: audio.c,v 1.177 2019/03/31 17:55:09 ratchov Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
@@ -387,7 +387,7 @@ audio_pintr(void *addr)
* check if record pointer wrapped, see explanation
* in audio_rintr()
*/
- if (sc->mode & AUMODE_RECORD) {
+ if ((sc->mode & AUMODE_RECORD) && sc->ops->underrun == NULL) {
sc->offs--;
nblk = sc->rec.len / sc->rec.blksz;
todo = -sc->offs;
@@ -470,7 +470,7 @@ audio_rintr(void *addr)
* We fix this by advancing play position by an integer count of
* full buffers, so it reaches the record position.
*/
- if (sc->mode & AUMODE_PLAY) {
+ if ((sc->mode & AUMODE_PLAY) && sc->ops->underrun == NULL) {
sc->offs++;
nblk = sc->play.len / sc->play.blksz;
todo = sc->offs;