mirror of https://github.com/PCSX2/pcsx2.git
SPU2: Attempt 96khz sample rate if 48khz fails
This commit is contained in:
parent
a94561fba7
commit
af89879750
|
@ -893,6 +893,9 @@ __forceinline
|
||||||
|
|
||||||
SndBuffer::Write(Out);
|
SndBuffer::Write(Out);
|
||||||
|
|
||||||
|
if(SampleRate == 96000) // Double up samples for 96khz (Port Audio Non-Exclusive)
|
||||||
|
SndBuffer::Write(Out);
|
||||||
|
|
||||||
// Update AutoDMA output positioning
|
// Update AutoDMA output positioning
|
||||||
OutPos++;
|
OutPos++;
|
||||||
if (OutPos >= 0x200)
|
if (OutPos >= 0x200)
|
||||||
|
|
|
@ -297,6 +297,22 @@ public:
|
||||||
PaCallback,
|
PaCallback,
|
||||||
|
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
|
if (err == paInvalidSampleRate && SampleRate == 48000)
|
||||||
|
{
|
||||||
|
DevCon.Warning("Failed to create device at 48khz, trying 96khz");
|
||||||
|
SampleRate = 96000;
|
||||||
|
err = Pa_OpenStream(&stream,
|
||||||
|
nullptr, &outParams, SampleRate,
|
||||||
|
SndOutPacketSize,
|
||||||
|
paNoFlag,
|
||||||
|
PaCallback,
|
||||||
|
|
||||||
|
nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err == paInvalidSampleRate && SampleRate == 96000) // It didn't work, so lets just put the samplerate back
|
||||||
|
SampleRate = 48000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -308,6 +324,8 @@ public:
|
||||||
}
|
}
|
||||||
if (err != paNoError)
|
if (err != paNoError)
|
||||||
{
|
{
|
||||||
|
if(err == paInvalidSampleRate)
|
||||||
|
Console.Warning("Failed to create Port Audio Device %dkhz, Please use Exclusive Mode", SampleRate / 1000);
|
||||||
fprintf(stderr, "* SPU2: PortAudio error: %s\n", Pa_GetErrorText(err));
|
fprintf(stderr, "* SPU2: PortAudio error: %s\n", Pa_GetErrorText(err));
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue