From 56d920162e995fe263f40f85bd0b14e35c9837d6 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sun, 20 Jan 2013 11:54:26 +0100 Subject: [PATCH] Reduce default volume to 0.3 on non-linux-platforms If the volume is set too high the OpenAL backend preamplification leads to overdriven sound samples. It's not quite understandable to me why that only happen on platforms other than Linux (maybe a bug in OpenAL?) and there's not much we can do against it besides reducing the volume. As the side note: Simmilar behavior can be seen at least in ioQ3 and dhewm3... --- src/client/sound/snd_dma.c | 5 +++++ src/client/sound/snd_vorbis.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/client/sound/snd_dma.c b/src/client/sound/snd_dma.c index c48b31a6..f79e30f8 100644 --- a/src/client/sound/snd_dma.c +++ b/src/client/sound/snd_dma.c @@ -137,7 +137,12 @@ S_Init(void) } else { +#ifdef __linux__ s_volume = Cvar_Get("s_volume", "0.7", CVAR_ARCHIVE); +#else + s_volume = Cvar_Get("s_volume", "0.3", CVAR_ARCHIVE); +#endif + s_khz = Cvar_Get("s_khz", "44", CVAR_ARCHIVE); s_loadas8bit = Cvar_Get("s_loadas8bit", "0", CVAR_ARCHIVE); s_mixahead = Cvar_Get("s_mixahead", "0.14", CVAR_ARCHIVE); diff --git a/src/client/sound/snd_vorbis.c b/src/client/sound/snd_vorbis.c index 1a8a83ee..0cb2b39d 100644 --- a/src/client/sound/snd_vorbis.c +++ b/src/client/sound/snd_vorbis.c @@ -96,7 +96,12 @@ OGG_Init(void) ogg_check = Cvar_Get("ogg_check", "0", CVAR_ARCHIVE); ogg_playlist = Cvar_Get("ogg_playlist", "playlist", CVAR_ARCHIVE); ogg_sequence = Cvar_Get("ogg_sequence", "loop", CVAR_ARCHIVE); + +#ifdef __linux__ ogg_volume = Cvar_Get("ogg_volume", "0.7", CVAR_ARCHIVE); +#else + ogg_volume = Cvar_Get("ogg_volume", "0.3", CVAR_ARCHIVE); +#endif /* Console commands. */ Cmd_AddCommand("ogg_list", OGG_ListCmd);