Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev Pull up following revision(s) (requested by nat i...



details:   https://anonhg.NetBSD.org/src/rev/7718c365c7e6
branches:  netbsd-8
changeset: 850985:7718c365c7e6
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Aug 31 11:10:37 2017 +0000

description:
Pull up following revision(s) (requested by nat in ticket #238):
        sys/dev/audio.c: revision 1.392
        sys/dev/audio.c: revision 1.386
        sys/dev/audio.c: revision 1.387
Reset mixer ports on opening /dev/sound.
This fixes an issue reported on port-arm@ by Brian Buhrow.

Ensure to call mix write if inserting silence into the hw ring.
Addresses PR kern/52459.
Patch provided and tested by isaki@.

If the harware ring is starved of data...Insert silence into the mix ring
so mix_write can function properly.

diffstat:

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

diffs (52 lines):

diff -r d85e6254323e -r 7718c365c7e6 sys/dev/audio.c
--- a/sys/dev/audio.c   Thu Aug 31 08:50:57 2017 +0000
+++ b/sys/dev/audio.c   Thu Aug 31 11:10:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.357.2.4 2017/08/01 23:25:11 snj Exp $      */
+/*     $NetBSD: audio.c,v 1.357.2.5 2017/08/31 11:10:37 martin 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.357.2.4 2017/08/01 23:25:11 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.5 2017/08/31 11:10:37 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2242,6 +2242,8 @@
        error = audio_set_defaults(sc, mode, vc);
        if (!error && ISDEVSOUND(dev) && sc->sc_aivalid == true) {
                sc->sc_ai.mode = mode;
+               sc->sc_ai.play.port = ~0;
+               sc->sc_ai.record.port = ~0;
                error = audiosetinfo(sc, &sc->sc_ai, true, vc);
        }
        if (error)
@@ -3684,20 +3686,18 @@
                DPRINTFN(3, ("HW RING - INSERT SILENCE\n"));
                used = blksize;
                while (used > 0) {
-                       cc = vc->sc_mpr.s.end - vc->sc_mpr.s.inp;
+                       cc = sc->sc_pr.s.end - sc->sc_pr.s.inp;
                        if (cc > used)
                                cc = used;
-                       audio_fill_silence(&vc->sc_pparams, vc->sc_mpr.s.inp, cc);
-                       vc->sc_mpr.s.inp = audio_stream_add_inp(&vc->sc_mpr.s,
-                           vc->sc_mpr.s.inp, cc);
+                       audio_fill_silence(&vc->sc_pustream->param, sc->sc_pr.s.inp, cc);
+                       sc->sc_pr.s.inp = audio_stream_add_inp(&sc->sc_pr.s,
+                           sc->sc_pr.s.inp, cc);
                        used -= cc;
                }
-               goto wake_mix;
        }
 
        mix_write(sc);
 
-wake_mix:
        cv_broadcast(&sc->sc_condvar);
 }
 



Home | Main Index | Thread Index | Old Index