Merge pull request #2638 from bagnz0r/master
Audio optimization, usability fixes, sound peak blowout fix, Polish translation, bugfixes
This commit is contained in:
commit
05dfd27db8
5 changed files with 20 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue