diff --git a/Core/Config.cpp b/Core/Config.cpp index b32c4cfcbf..0b1e9fb7b1 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -134,8 +134,8 @@ void Config::Load(const char *iniFileName) IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Get("Enable", &bEnableSound, true); sound->Get("EnableAtrac3plus", &bEnableAtrac3plus, true); - sound->Get("BGMVolume", &iBGMVolume, 4); - sound->Get("SEVolume", &iSEVolume, 4); + sound->Get("BGMVolume", &iBGMVolume, 5); + sound->Get("SEVolume", &iSEVolume, 5); IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Get("ShowStick", &bShowAnalogStick, false); diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp index cc09d0307c..45bb878ce5 100644 --- a/Core/HLE/__sceAudio.cpp +++ b/Core/HLE/__sceAudio.cpp @@ -29,6 +29,8 @@ #include "FixedSizeQueue.h" #include "Common/Thread.h" +#define LOW_LATENCY_AUDIO false + // Should be used to lock anything related to the outAudioQueue. recursive_mutex section; @@ -37,15 +39,27 @@ int eventHostAudioUpdate = -1; int mixFrequency = 44100; const int hwSampleRate = 44100; + +#ifdef LOW_LATENCY_AUDIO +const int hwBlockSize = 16; +const int hostAttemptBlockSize = 256; +#else const int hwBlockSize = 64; const int hostAttemptBlockSize = 512; +#endif; + const int audioIntervalUs = (int)(1000000ULL * hwBlockSize / hwSampleRate); const int audioHostIntervalUs = (int)(1000000ULL * hostAttemptBlockSize / hwSampleRate); // High and low watermarks, basically. For perfect emulation, the correct values are 0 and 1, respectively. // TODO: Tweak +#ifdef LOW_LATENCY_AUDIO +const int chanQueueMaxSizeFactor = 0; +const int chanQueueMinSizeFactor = 1; +#else const int chanQueueMaxSizeFactor = 2; const int chanQueueMinSizeFactor = 1; +#endif // TODO: Need to replace this with something lockless. Mutexes in the audio pipeline // is bad mojo. diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 61c1614319..effd72f489 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -625,7 +625,7 @@ u32 _AtracDecodeData(int atracID, u8* outbuf, u32 *SamplesNum, u32* finish, int atrac->sampleQueue.push(buf, decodebytes); } } - const int MAX_CONFIG_VOLUME = 5; + const int MAX_CONFIG_VOLUME = 8; s16* out = (s16*)outbuf; memset(out, 0, ATRAC3PLUS_MAX_SAMPLES * sizeof(s16) * atrac->atracOutputChannels); int gotsize = atrac->sampleQueue.pop_front(buf, ATRAC3PLUS_MAX_SAMPLES * sizeof(s16) * atrac->atracChannels); diff --git a/Core/HW/SasAudio.cpp b/Core/HW/SasAudio.cpp index fca3ef62e9..c771c684fb 100644 --- a/Core/HW/SasAudio.cpp +++ b/Core/HW/SasAudio.cpp @@ -413,7 +413,7 @@ void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) { // Resample to the correct pitch, writing exactly "grainSize" samples. u32 sampleFrac = voice.sampleFrac; - const int MAX_CONFIG_VOLUME = 17; // 12 + 5 + const int MAX_CONFIG_VOLUME = 20; int volumeShift = (MAX_CONFIG_VOLUME - g_Config.iSEVolume); if (volumeShift < 0) volumeShift = 0; for (int i = 0; i < grainSize; i++) { diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index 0aba2936f6..cb3366d27f 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -870,7 +870,7 @@ void AudioScreen::render() { if (g_Config.iBGMVolume > 1) g_Config.iBGMVolume -= 1; if (UIButton(GEN_ID, hlinear1, 50, 0, a->T("+1"), ALIGN_LEFT)) - if (g_Config.iBGMVolume < 5) + if (g_Config.iBGMVolume < 8) g_Config.iBGMVolume += 1; y+=20; char sevol[256]; @@ -883,7 +883,7 @@ void AudioScreen::render() { if (g_Config.iSEVolume > 1) g_Config.iSEVolume -= 1; if (UIButton(GEN_ID, hlinear2, 50, 0, a->T("+1"), ALIGN_LEFT)) - if (g_Config.iSEVolume < 5) + if (g_Config.iSEVolume < 8) g_Config.iSEVolume += 1; y+=10;