aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2017-05-27 08:30:32 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2017-05-27 08:30:32 +0000
commitaf134725236bac32196d34ed8125b083d70672aa (patch)
tree4a46713c5b3e0b5e55a6d017e609629b3836e53d
parentb1c87a9e6b8f30d989e4702185fe515e752f6a7a (diff)
downloadsrc-af134725236bac32196d34ed8125b083d70672aa.tar.gz
src-af134725236bac32196d34ed8125b083d70672aa.zip
MFC r318820:
Increase the allowed maximum number of audio channels from 31 to 127 in the PCM feeder mixer. Without this change a value of 32 channels is treated like zero, due to using a mask of 0x1f, causing a kernel assert when trying to playback bitperfect 32-channel audio. Also update the AWK script which is generating the division tables to handle more than 18 channels. This commit complements r282650.
Notes
Notes: svn path=/stable/8/; revision=318981
-rw-r--r--sys/dev/sound/pcm/feeder_mixer.c8
-rw-r--r--sys/tools/sound/snd_fxdiv_gen.awk6
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/sound/pcm/feeder_mixer.c b/sys/dev/sound/pcm/feeder_mixer.c
index 32978acd2d57..8e6ba27f77a5 100644
--- a/sys/dev/sound/pcm/feeder_mixer.c
+++ b/sys/dev/sound/pcm/feeder_mixer.c
@@ -131,10 +131,10 @@ static struct feed_mixer_info feed_mixer_info_tab[] = {
sizeof(feed_mixer_info_tab[0])))
#define FEEDMIXER_DATA(i, c) ((void *) \
- ((uintptr_t)((((i) & 0x1f) << 5) | \
- ((c) & 0x1f))))
-#define FEEDMIXER_INFOIDX(d) ((uint32_t)((uintptr_t)(d) >> 5) & 0x1f)
-#define FEEDMIXER_CHANNELS(d) ((uint32_t)((uintptr_t)(d)) & 0x1f)
+ ((uintptr_t)((((i) & 0x1f) << 7) | \
+ ((c) & 0x7f))))
+#define FEEDMIXER_INFOIDX(d) ((uint32_t)((uintptr_t)(d) >> 7) & 0x1f)
+#define FEEDMIXER_CHANNELS(d) ((uint32_t)((uintptr_t)(d)) & 0x7f)
static int
feed_mixer_init(struct pcm_feeder *f)
diff --git a/sys/tools/sound/snd_fxdiv_gen.awk b/sys/tools/sound/snd_fxdiv_gen.awk
index 5828062ee662..2e1d3a545380 100644
--- a/sys/tools/sound/snd_fxdiv_gen.awk
+++ b/sys/tools/sound/snd_fxdiv_gen.awk
@@ -74,7 +74,7 @@ BEGIN {
FXSHIFT = 16;
FXONE = shl(1, FXSHIFT);
- SND_CHN_MAX = 18;
+ SND_CHN_MAX = 127;
PCM_8_BPS = 1;
PCM_16_BPS = 2;
@@ -103,9 +103,9 @@ BEGIN {
printf("/*\n");
printf(" * Fast unsigned 32bit integer division and rounding, accurate for\n");
printf(" * x = 1 - %d. This table should be enough to handle possible\n", FXONE);
- printf(" * division for 1 - 72 (more can be generated though..).\n");
+ printf(" * division for 1 - 508 (more can be generated though..).\n");
printf(" *\n");
- printf(" * 72 = SND_CHN_MAX * PCM_32_BPS, which is why....\n");
+ printf(" * 508 = SND_CHN_MAX * PCM_32_BPS, which is why....\n");
printf(" */\n\n");
printf("static const uint32_t snd_fxdiv_table[][2] = {\n");