From b62dbc545af0f4acdc324cf29c1352a85aa3d094 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 7 Jul 2010 19:20:53 +0000 Subject: [PATCH] SPU2-X: More volume! Expect to have to turn your speakers down a bit. (made possible by proper clamping) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3419 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/Mixer.cpp | 11 +++++------ plugins/spu2-x/src/SndOut.h | 8 +++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/spu2-x/src/Mixer.cpp b/plugins/spu2-x/src/Mixer.cpp index ffcd27d652..2c055b4784 100644 --- a/plugins/spu2-x/src/Mixer.cpp +++ b/plugins/spu2-x/src/Mixer.cpp @@ -775,14 +775,13 @@ __forceinline void Mix() } else { - // SndOutVolumeShift + 1 because sound output is notoriously too quiet (rama) - Out.Left = MulShr32( Out.Left<<(SndOutVolumeShift+1), Cores[1].MasterVol.Left.Value ); - Out.Right = MulShr32( Out.Right<<(SndOutVolumeShift+1), Cores[1].MasterVol.Right.Value ); + Out.Left = MulShr32( Out.Left<<(SndOutVolumeShift+2), Cores[1].MasterVol.Left.Value ); + Out.Right = MulShr32( Out.Right<<(SndOutVolumeShift+2), Cores[1].MasterVol.Right.Value ); // Final Clamp! - // This could be circumvented by using 1/2th total output volume, although - // I suspect this approach (clamping at the higher volume) is more true to the - // PS2's real implementation. + // Like any good audio system, the PS2 pumps the volume and incurs some distortion in its + // output, giving us a nice thumpy sound at times. So we add 2 above (4x volume pump) and + // then clamp it all here. Out = clamp_mix( Out, SndOutVolumeShift ); } diff --git a/plugins/spu2-x/src/SndOut.h b/plugins/spu2-x/src/SndOut.h index 539fdf96b5..9ba9f9e9e4 100644 --- a/plugins/spu2-x/src/SndOut.h +++ b/plugins/spu2-x/src/SndOut.h @@ -22,9 +22,11 @@ // SndOut. static const int SndOutPacketSize = 64; -// Overall master volume shift. -// Converts the mixer's 32 bit value into a 16 bit value. -static const int SndOutVolumeShift = 13; +// Overall master volume shift; this is meant to be a precision value and does not affect +// actual output volumes. It converts SPU2 16 bit volumes to 32-bit volumes, and likewise +// downsamples 32 bit samples to 16 bit sound driver output (this way timestretching and +// DSP effects get better precision results) +static const int SndOutVolumeShift = 12; // Samplerate of the SPU2. For accurate playback we need to match this // exactly. Trying to scale samplerates and maintain SPU2's Ts timing accuracy