Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev/audio Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/515575f0cdd1
branches:  netbsd-9
changeset: 1002262:515575f0cdd1
user:      martin <martin%NetBSD.org@localhost>
date:      Wed May 05 17:01:41 2021 +0000

description:
Pull up following revision(s) (requested by nia in ticket #1268):

        sys/dev/audio/audio.c: revision 1.95

audio: Only score hardware formats by channel count at count<=2

Scoring by channel count makes sense when you are using hardware that
supports mono and stereo formats. However, if your hardware also supports
surround formats, defaulting to those might be confusing. So, don't
prefer them.

Problem reported and fix tested by tcmart14 with a 2015 model Macbook Pro.

diffstat:

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

diffs (30 lines):

diff -r 74548dc12897 -r 515575f0cdd1 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Mon May 03 09:13:22 2021 +0000
+++ b/sys/dev/audio/audio.c     Wed May 05 17:01:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.28.2.21 2021/03/01 16:00:08 martin Exp $   */
+/*     $NetBSD: audio.c,v 1.28.2.22 2021/05/05 17:01:41 martin Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.21 2021/03/01 16:00:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.22 2021/05/05 17:01:41 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -6566,7 +6566,10 @@
                    query.fmt.precision == AUDIO_INTERNAL_BITS) {
                        score += 0x10;
                }
-               score += query.fmt.channels;
+
+               /* Do not prefer surround formats */
+               if (query.fmt.channels <= 2)
+                       score += query.fmt.channels;
 
                if (score < cand_score) {
                        DPRINTF(1, "fmt[%d] skip; score 0x%x < 0x%x\n", i,



Home | Main Index | Thread Index | Old Index