Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Don't hold sc_lock whilst calling mix_write/read. T...



details:   https://anonhg.NetBSD.org/src/rev/fee523e29d3e
branches:  trunk
changeset: 823930:fee523e29d3e
user:      nat <nat%NetBSD.org@localhost>
date:      Mon May 15 01:03:47 2017 +0000

description:
Don't hold sc_lock whilst calling mix_write/read.  This makes uaudio work
again.

With regard to uaudio however tyr-quake's audio does not work well.

diffstat:

 sys/dev/audio.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r 36baf10e02eb -r fee523e29d3e sys/dev/audio.c
--- a/sys/dev/audio.c   Sun May 14 21:38:23 2017 +0000
+++ b/sys/dev/audio.c   Mon May 15 01:03:47 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.346 2017/05/14 10:57:32 nat Exp $  */
+/*     $NetBSD: audio.c,v 1.347 2017/05/15 01:03:47 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.346 2017/05/14 10:57:32 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.347 2017/05/15 01:03:47 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -3485,10 +3485,12 @@
                return EINVAL;
 
        if (sc->sc_rec_started == false) {
+               mutex_exit(sc->sc_lock);
                mutex_enter(sc->sc_intr_lock);
                mix_read(sc);
                cv_broadcast(&sc->sc_rcondvar);
                mutex_exit(sc->sc_intr_lock);
+               mutex_enter(sc->sc_lock);
        }
        vc->sc_rbus = true;
 
@@ -3523,6 +3525,7 @@
        if (sc->sc_trigger_started == false) {
                audio_mix(sc);
                audio_mix(sc);
+               mutex_exit(sc->sc_lock);
                mutex_enter(sc->sc_intr_lock);
                mix_write(sc);
                vc = chan->vc;
@@ -3532,6 +3535,7 @@
                mix_write(sc);
                cv_broadcast(&sc->sc_condvar);
                mutex_exit(sc->sc_intr_lock);
+               mutex_enter(sc->sc_lock);
        }
 
        return error;



Home | Main Index | Thread Index | Old Index