From d58df704016cd5d4b8acd47dff17aaac6b3c971a Mon Sep 17 00:00:00 2001 From: isaki Date: Sat, 28 Mar 2020 08:35:36 +0000 Subject: [PATCH] Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k (m68k uses 40msec default as before). And remove the option from GENERIC. - It's not good idea to set such parameter in individual GENERICs. - 4msec is (probably no problem for most modern real hardware but) too aggressive to be default. - 10msec is too severe for antique machines but it's hard to draw a line. --- sys/arch/amd64/conf/GENERIC | 7 ++----- sys/arch/evbarm/conf/GENERIC | 3 +-- sys/arch/evbarm/conf/GENERIC64 | 3 +-- sys/arch/i386/conf/GENERIC | 7 ++----- sys/arch/macppc/conf/GENERIC | 7 ++----- sys/arch/sparc64/conf/GENERIC | 7 ++----- sys/dev/audio/audiodef.h | 14 +++++++++++--- 7 files changed, 21 insertions(+), 27 deletions(-) diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC index 549989bb80a3..44a0d35b4005 100644 --- a/sys/arch/amd64/conf/GENERIC +++ b/sys/arch/amd64/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.563 2020/02/17 06:32:46 nisimura Exp $ +# $NetBSD: GENERIC,v 1.564 2020/03/28 08:35:36 isaki Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.563 $" +#ident "GENERIC-$Revision: 1.564 $" maxusers 64 # estimated number of users @@ -55,9 +55,6 @@ maxusers 64 # estimated number of users options INSECURE # disable kernel security levels - X needs this -options AUDIO_BLK_MS=4 # make software with low latency needs performant - # no substantial CPU overhead on this platform - options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT options NTP # NTP phase/frequency locked loop diff --git a/sys/arch/evbarm/conf/GENERIC b/sys/arch/evbarm/conf/GENERIC index bccf874ff078..298c1f8ea5f5 100644 --- a/sys/arch/evbarm/conf/GENERIC +++ b/sys/arch/evbarm/conf/GENERIC @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC,v 1.74 2020/03/15 13:54:28 skrll Exp $ +# $NetBSD: GENERIC,v 1.75 2020/03/28 08:35:36 isaki Exp $ # # GENERIC ARM (aarch32) kernel # @@ -622,7 +622,6 @@ sun8icodec* at fdt? # Audio codec (sun8i) sunxicodec* at fdt? # Allwinner audio codec sunxii2s* at fdt? # I2S/PCM audio* at audiobus? -options AUDIO_BLK_MS=4 spkr* at audio? # SDMMC diff --git a/sys/arch/evbarm/conf/GENERIC64 b/sys/arch/evbarm/conf/GENERIC64 index 35feba7583dc..fe1281bc1ef3 100644 --- a/sys/arch/evbarm/conf/GENERIC64 +++ b/sys/arch/evbarm/conf/GENERIC64 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC64,v 1.147 2020/03/27 01:43:58 thorpej Exp $ +# $NetBSD: GENERIC64,v 1.148 2020/03/28 08:35:36 isaki Exp $ # # GENERIC ARM (aarch64) kernel # @@ -481,7 +481,6 @@ h3codec* at fdt? # Allwinner H3 audio codec (analog part) a64acodec* at fdt? # Allwinner A64 audio codec (analog part) sunxii2s* at fdt? # Allwinner I2S/PCM audio* at audiobus? -options AUDIO_BLK_MS=4 spkr* at audio? # PC speaker (synthesized) diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC index 241b51d7bd6f..5ce62c8f66d8 100644 --- a/sys/arch/i386/conf/GENERIC +++ b/sys/arch/i386/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1226 2020/03/16 19:09:34 nia Exp $ +# $NetBSD: GENERIC,v 1.1227 2020/03/28 08:35:36 isaki Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/i386/conf/std.i386" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1226 $" +#ident "GENERIC-$Revision: 1.1227 $" maxusers 64 # estimated number of users @@ -77,9 +77,6 @@ options MULTIBOOT # Multiboot support (see multiboot(8)) options INSECURE # disable kernel security levels - X needs this -options AUDIO_BLK_MS=4 # make software with low latency needs performant - # no substantial CPU overhead on this platform - options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT options NTP # NTP phase/frequency locked loop diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC index 28415dbb0fa3..1628f089d7e9 100644 --- a/sys/arch/macppc/conf/GENERIC +++ b/sys/arch/macppc/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.365 2020/03/16 19:09:34 nia Exp $ +# $NetBSD: GENERIC,v 1.366 2020/03/28 08:35:36 isaki Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/macppc/conf/std.macppc" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.365 $" +#ident "GENERIC-$Revision: 1.366 $" maxusers 32 @@ -31,9 +31,6 @@ options ALTIVEC # Include AltiVec support # Standard system options options INSECURE # disable kernel security levels -options AUDIO_BLK_MS=4 # make software with low latency needs performant - # no substantial CPU overhead on this platform - options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT options NTP # NTP phase/frequency locked loop options KTRACE # system call tracing via ktrace(1) diff --git a/sys/arch/sparc64/conf/GENERIC b/sys/arch/sparc64/conf/GENERIC index 960cde600034..936ed9b3aca0 100644 --- a/sys/arch/sparc64/conf/GENERIC +++ b/sys/arch/sparc64/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.225 2020/03/16 19:09:34 nia Exp $ +# $NetBSD: GENERIC,v 1.226 2020/03/28 08:35:36 isaki Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/sparc64/conf/std.sparc64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.225 $" +#ident "GENERIC-$Revision: 1.226 $" maxusers 64 @@ -48,9 +48,6 @@ config netbsd root on ? type ? #options UVMHIST #options UVMHIST_PRINT # Loud! -options AUDIO_BLK_MS=4 # make software with low latency needs performant - # no substantial CPU overhead on this platform - ## System call tracing (see ktrace(1)). options KTRACE diff --git a/sys/dev/audio/audiodef.h b/sys/dev/audio/audiodef.h index 3b0700430ca3..a88c2ab2a300 100644 --- a/sys/dev/audio/audiodef.h +++ b/sys/dev/audio/audiodef.h @@ -1,4 +1,4 @@ -/* $NetBSD: audiodef.h,v 1.12 2020/03/05 15:18:55 riastradh Exp $ */ +/* $NetBSD: audiodef.h,v 1.13 2020/03/28 08:35:36 isaki Exp $ */ /* * Copyright (C) 2017 Tetsuya Isaki. All rights reserved. @@ -44,13 +44,21 @@ /* * Hardware blocksize in msec. - * We use 40 msec as default. (1 / 40ms) = 25 = 5^2. + * We use 10 msec as default for most platforms. But it's too severe for + * most m68k. + * + * 40 msec was initially choosen for the following reason: + * (1 / 40ms) = 25 = 5^2. Thus, the frequency is factored by 5. * In this case, the number of frames in a block can be an integer * even if the frequency is a multiple of 100 (44100, 48000, etc), * or even if 15625Hz (vs(4)). */ #if !defined(AUDIO_BLK_MS) -#define AUDIO_BLK_MS 40 +# if defined(__m68k__) +# define AUDIO_BLK_MS 40 +# else +# define AUDIO_BLK_MS 10 +# endif #endif /*