mirror of https://github.com/PCSX2/pcsx2.git
Drop XAudio 2.7 module
This commit is contained in:
parent
b6e95fea52
commit
9f664c5f9c
|
@ -158,17 +158,6 @@ SPU2test()
|
||||||
if (!CheckSSE())
|
if (!CheckSSE())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
if (IsWindows8OrGreater()) {
|
|
||||||
for (int n = 0; mods[n] != nullptr; ++n) {
|
|
||||||
if (mods[n] == XAudio2_27_Out) {
|
|
||||||
mods[n] = XAudio2Out;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ReadSettings();
|
ReadSettings();
|
||||||
if (SndBuffer::Test() != 0) {
|
if (SndBuffer::Test() != 0) {
|
||||||
// TODO : Implement a proper dialog that allows the user to test different audio out drivers.
|
// TODO : Implement a proper dialog that allows the user to test different audio out drivers.
|
||||||
|
|
|
@ -84,7 +84,7 @@ SndOutModule *mods[] =
|
||||||
{
|
{
|
||||||
&NullOut,
|
&NullOut,
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
XAudio2_27_Out,
|
XAudio2Out,
|
||||||
DSoundOut,
|
DSoundOut,
|
||||||
WaveOut,
|
WaveOut,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -670,7 +670,6 @@ public:
|
||||||
//internal
|
//internal
|
||||||
extern SndOutModule *WaveOut;
|
extern SndOutModule *WaveOut;
|
||||||
extern SndOutModule *DSoundOut;
|
extern SndOutModule *DSoundOut;
|
||||||
extern SndOutModule *XAudio2_27_Out;
|
|
||||||
extern SndOutModule *XAudio2Out;
|
extern SndOutModule *XAudio2Out;
|
||||||
#endif
|
#endif
|
||||||
#if defined(_WIN32) || defined(SPU2X_PORTAUDIO)
|
#if defined(_WIN32) || defined(SPU2X_PORTAUDIO)
|
||||||
|
|
|
@ -228,16 +228,6 @@ s2r_replay(HWND hwnd, HINSTANCE hinst, LPSTR filename, int nCmdShow)
|
||||||
SetConsoleCtrlHandler(HandlerRoutine, TRUE);
|
SetConsoleCtrlHandler(HandlerRoutine, TRUE);
|
||||||
|
|
||||||
conprintf("Playing %s file on %x...", filename, hwnd);
|
conprintf("Playing %s file on %x...", filename, hwnd);
|
||||||
|
|
||||||
if (IsWindows8OrGreater()) {
|
|
||||||
for (int n = 0; mods[n] != nullptr; ++n) {
|
|
||||||
if (mods[n] == XAudio2_27_Out) {
|
|
||||||
mods[n] = XAudio2Out;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// load file
|
// load file
|
||||||
|
|
|
@ -128,10 +128,7 @@ void ReadSettings()
|
||||||
// let's use xaudio2 until this is sorted (rama)
|
// let's use xaudio2 until this is sorted (rama)
|
||||||
|
|
||||||
// CfgReadStr(L"OUTPUT", L"Output_Module", omodid, 127, PortaudioOut->GetIdent());
|
// CfgReadStr(L"OUTPUT", L"Output_Module", omodid, 127, PortaudioOut->GetIdent());
|
||||||
if (IsWindows8OrGreater())
|
|
||||||
CfgReadStr(L"OUTPUT", L"Output_Module", omodid, 127, XAudio2Out->GetIdent());
|
CfgReadStr(L"OUTPUT", L"Output_Module", omodid, 127, XAudio2Out->GetIdent());
|
||||||
else
|
|
||||||
CfgReadStr(L"OUTPUT", L"Output_Module", omodid, 127, XAudio2_27_Out->GetIdent());
|
|
||||||
|
|
||||||
// find the driver index of this module:
|
// find the driver index of this module:
|
||||||
OutputModule = FindOutputModuleById(omodid);
|
OutputModule = FindOutputModuleById(omodid);
|
||||||
|
@ -215,7 +212,6 @@ void CheckOutputModule(HWND window)
|
||||||
|
|
||||||
const bool AudioExpansion =
|
const bool AudioExpansion =
|
||||||
mods[OutputModule] == XAudio2Out ||
|
mods[OutputModule] == XAudio2Out ||
|
||||||
mods[OutputModule] == XAudio2_27_Out ||
|
|
||||||
mods[OutputModule] == PortaudioOut;
|
mods[OutputModule] == PortaudioOut;
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(window, IDC_OUTCONF), IsConfigurable);
|
EnableWindow(GetDlgItem(window, IDC_OUTCONF), IsConfigurable);
|
||||||
|
|
|
@ -54,11 +54,7 @@ public:
|
||||||
|
|
||||||
static const double SndOutNormalizer = (double)(1UL << (SndOutVolumeShift + 16));
|
static const double SndOutNormalizer = (double)(1UL << (SndOutVolumeShift + 16));
|
||||||
|
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
class XAudio2Mod : public SndOutModule
|
class XAudio2Mod : public SndOutModule
|
||||||
#else
|
|
||||||
class XAudio2_27_Mod : public SndOutModule
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static const int PacketsPerBuffer = 8;
|
static const int PacketsPerBuffer = 8;
|
||||||
|
@ -250,9 +246,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
HMODULE xAudio2DLL = nullptr;
|
HMODULE xAudio2DLL = nullptr;
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
decltype(&XAudio2Create) pXAudio2Create = nullptr;
|
decltype(&XAudio2Create) pXAudio2Create = nullptr;
|
||||||
#endif
|
|
||||||
CComPtr<IXAudio2> pXAudio2;
|
CComPtr<IXAudio2> pXAudio2;
|
||||||
IXAudio2MasteringVoice *pMasteringVoice = nullptr;
|
IXAudio2MasteringVoice *pMasteringVoice = nullptr;
|
||||||
std::unique_ptr<BaseStreamingVoice> m_voiceContext;
|
std::unique_ptr<BaseStreamingVoice> m_voiceContext;
|
||||||
|
@ -265,7 +259,6 @@ public:
|
||||||
try {
|
try {
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
xAudio2DLL = LoadLibraryEx(XAUDIO2_DLL, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
xAudio2DLL = LoadLibraryEx(XAUDIO2_DLL, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
if (xAudio2DLL == nullptr)
|
if (xAudio2DLL == nullptr)
|
||||||
throw std::runtime_error("Could not load " XAUDIO2_DLL_A ". Error code:" + std::to_string(GetLastError()));
|
throw std::runtime_error("Could not load " XAUDIO2_DLL_A ". Error code:" + std::to_string(GetLastError()));
|
||||||
|
@ -276,24 +269,6 @@ public:
|
||||||
|
|
||||||
if (FAILED(hr = pXAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
if (FAILED(hr = pXAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
||||||
throw Exception::XAudio2Error(hr, "Failed to init XAudio2 engine. Error Details:");
|
throw Exception::XAudio2Error(hr, "Failed to init XAudio2 engine. Error Details:");
|
||||||
#else
|
|
||||||
// On some systems XAudio2.7 can unload itself and cause PCSX2 to crash.
|
|
||||||
// Maintain an extra library reference so it can't do so. Does not
|
|
||||||
// affect XAudio 2.8+, but that's Win8+. See
|
|
||||||
// http://blogs.msdn.com/b/chuckw/archive/2015/10/09/known-issues-xaudio-2-7.aspx
|
|
||||||
xAudio2DLL = LoadLibrary(IsDebugBuild ? L"XAudioD2_7.dll" : L"XAudio2_7.dll");
|
|
||||||
const UINT32 flags = IsDebugBuild ? XAUDIO2_DEBUG_ENGINE : 0;
|
|
||||||
if (FAILED(hr = XAudio2Create(&pXAudio2, flags)))
|
|
||||||
throw Exception::XAudio2Error(hr,
|
|
||||||
"Failed to init XAudio2 engine. XA2 may not be available on your system.\n"
|
|
||||||
"Ensure that you have the latest DirectX runtimes installed, or use\n"
|
|
||||||
"DirectX / WaveOut drivers instead. Error Details:");
|
|
||||||
|
|
||||||
XAUDIO2_DEVICE_DETAILS deviceDetails;
|
|
||||||
pXAudio2->GetDeviceDetails(0, &deviceDetails);
|
|
||||||
// Any windows driver should support stereo at the software level, I should think!
|
|
||||||
pxAssume(deviceDetails.OutputFormat.Format.nChannels > 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Stereo Expansion was planned to grab the currently configured number of
|
// Stereo Expansion was planned to grab the currently configured number of
|
||||||
// Speakers from Windows's audio config.
|
// Speakers from Windows's audio config.
|
||||||
|
@ -395,9 +370,7 @@ public:
|
||||||
if (xAudio2DLL) {
|
if (xAudio2DLL) {
|
||||||
FreeLibrary(xAudio2DLL);
|
FreeLibrary(xAudio2DLL);
|
||||||
xAudio2DLL = nullptr;
|
xAudio2DLL = nullptr;
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
pXAudio2Create = nullptr;
|
pXAudio2Create = nullptr;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,11 +397,7 @@ public:
|
||||||
|
|
||||||
const wchar_t *GetLongName() const
|
const wchar_t *GetLongName() const
|
||||||
{
|
{
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
return L"XAudio 2 (Recommended)";
|
return L"XAudio 2 (Recommended)";
|
||||||
#else
|
|
||||||
return L"XAudio 2.7 (Recommended)";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadSettings()
|
void ReadSettings()
|
||||||
|
@ -445,8 +414,4 @@ public:
|
||||||
|
|
||||||
} static XA2;
|
} static XA2;
|
||||||
|
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
SndOutModule *XAudio2Out = &XA2;
|
SndOutModule *XAudio2Out = &XA2;
|
||||||
#else
|
|
||||||
SndOutModule *XAudio2_27_Out = &XA2;
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
/* SPU2-X, A plugin for Emulating the Sound Processing Unit of the Playstation 2
|
|
||||||
* Developed and maintained by the Pcsx2 Development Team.
|
|
||||||
*
|
|
||||||
* Original portions from SPU2ghz are (c) 2008 by David Quintana [gigaherz]
|
|
||||||
*
|
|
||||||
* SPU2-X is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* SPU2-X is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE. See the GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with SPU2-X. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Global.h"
|
|
||||||
#include "Dialogs.h"
|
|
||||||
|
|
||||||
#if _WIN32_WINNT >= 0x602
|
|
||||||
#error Time to remove this module.
|
|
||||||
#endif
|
|
||||||
#include <xaudio2.h>
|
|
||||||
|
|
||||||
#include "SndOut_XAudio2.inl"
|
|
|
@ -114,9 +114,6 @@
|
||||||
<ClCompile Include="SndOut_DSound.cpp" />
|
<ClCompile Include="SndOut_DSound.cpp" />
|
||||||
<ClCompile Include="SndOut_waveOut.cpp" />
|
<ClCompile Include="SndOut_waveOut.cpp" />
|
||||||
<ClCompile Include="SndOut_XAudio2.cpp" />
|
<ClCompile Include="SndOut_XAudio2.cpp" />
|
||||||
<ClCompile Include="SndOut_XAudio2_27.cpp">
|
|
||||||
<AdditionalIncludeDirectories>$(DXSDK_DIR)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Linux\Alsa.cpp">
|
<ClCompile Include="..\Linux\Alsa.cpp">
|
||||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -144,9 +144,6 @@
|
||||||
<ClCompile Include="SndOut_waveOut.cpp">
|
<ClCompile Include="SndOut_waveOut.cpp">
|
||||||
<Filter>Source Files\Sound Output\Windows</Filter>
|
<Filter>Source Files\Sound Output\Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="SndOut_XAudio2_27.cpp">
|
|
||||||
<Filter>Source Files\Sound Output\Windows</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Linux\Alsa.cpp">
|
<ClCompile Include="..\Linux\Alsa.cpp">
|
||||||
<Filter>Source Files\Sound Output\Linux</Filter>
|
<Filter>Source Files\Sound Output\Linux</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
Loading…
Reference in New Issue