Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Use correct combination of mix ring block size and v...



details:   https://anonhg.NetBSD.org/src/rev/8d87b6ab4fb1
branches:  trunk
changeset: 357591:8d87b6ab4fb1
user:      nat <nat%NetBSD.org@localhost>
date:      Thu Nov 16 23:43:48 2017 +0000

description:
Use correct combination of mix ring block size and vc playring used low
for signalling the writer or fetching data from the vc play ring filters.

When dealing with the ring buffer sc_mpr.s it is necessary to use the hwvc
or mixring block sizes as they represent the final size of the data to be
played back from the stream vc.

When dealing with sc_pustream when there is play back filters or not one
should use the vc->sc_mpr.blocksize, as this represents the amount of data
before going through play back filters.

This should address PR kern/52685.

diffstat:

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

diffs (36 lines):

diff -r 715cad03826b -r 8d87b6ab4fb1 sys/dev/audio.c
--- a/sys/dev/audio.c   Thu Nov 16 23:32:11 2017 +0000
+++ b/sys/dev/audio.c   Thu Nov 16 23:43:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.439 2017/11/16 23:32:11 nat Exp $  */
+/*     $NetBSD: audio.c,v 1.440 2017/11/16 23:43: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.439 2017/11/16 23:32:11 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.440 2017/11/16 23:43:48 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -3802,7 +3802,7 @@
                 * at accurate timing.  If used < blksize, uaudio(4) already
                 * request transfer of garbage data.
                 */
-               if (used <= cb->usedlow && !cb->copying &&
+               if (used <= sc->sc_hwvc->sc_mpr.usedlow && !cb->copying &&
                    vc->sc_npfilters > 0) {
                        /* we might have data in filter pipeline */
                        null_fetcher.fetch_to = null_fetcher_fetch_to;
@@ -3863,7 +3863,7 @@
                             audio_stream_get_used(&cb->s), cb->usedlow));
 
                if ((vc->sc_mode & AUMODE_PLAY) && !cb->pause) {
-                       if (audio_stream_get_used(&cb->s) <= cb->usedlow)
+                       if (audio_stream_get_used(vc->sc_pustream) <= cb->usedlow)
                                sc->schedule_wih = true;
                }
                /* Possible to return one or more "phantom blocks" now. */



Home | Main Index | Thread Index | Old Index