mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Merge branch 'OpenAL'
* OpenAL: Changed SoundTouch to use float samples, allowing SSE to be used. Made the DPL2 decoder disabled by default. Re-added the audio hack used by the Accurate VBeam emulation option. Added a latency setting to the audio settings. Removed the Sample Rate setting. It is now hardcoded to 48000hz (accurate audio timing). Skipped timestretching if the emulator is running below 10% speed to prevent buffer overflows. Removed the synchronisation between the CPU thread and the audio thread. Added code to detect and resume from buffer underruns. Disabled the ability to change the DPL2 option after the game has started. Fixed a memory leak that occurred in the DPL2 decoder. Fixed the OSX build. Build fix Added a Dolby Pro Logic II (DPL2) decoder in the OpenAL backend. DPL2 audio is decoded to 5.1. Code adapted from ffdshow. Added an option in the DSP settings to disable the DPL2 decoder in case Dolphin incorrectly detects a 5.1 audio system. Updated the OpenAL files to OpenAL Soft 1.15.1 in the Windows build. Removed the system timing hack which was activated when the Accurate VBeam option was enabled. Fixed the include directories in Audio Common for the Windows 32bit build. Fixed the include directories in Audio Common for the Windows build. Messed up the static include line Fix include paths and compiling in Linux. Externals soundtouch is 1.7.1, while Ubuntu 12.10 is 1.6.x. Externals soundtouch is compiled with integer samples, while ubuntu is compiled with float samples. Float samples is probably the more common route. If you're going to use soundtouch, you should probably use SAMPLETYPE instead of explicitly choosing short. This probably breaks the windows build since its includes aren't setup. OSX: typedef signed char BOOL OSX build fix Build fix Added audio time stretching by using the SoundTouch library. Implemented correct audio timing. OpenAL for Windows initial commit
This commit is contained in:
@ -119,7 +119,8 @@ EVT_RADIOBOX(ID_DSPENGINE, CConfigMain::AudioSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DSPTHREAD, CConfigMain::AudioSettingsChanged)
|
||||
EVT_CHECKBOX(ID_ENABLE_THROTTLE, CConfigMain::AudioSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMP_AUDIO, CConfigMain::AudioSettingsChanged)
|
||||
EVT_CHOICE(ID_FREQUENCY, CConfigMain::AudioSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DPL2DECODER, CConfigMain::AudioSettingsChanged)
|
||||
EVT_SLIDER(ID_LATENCY, CConfigMain::AudioSettingsChanged)
|
||||
EVT_CHOICE(ID_BACKEND, CConfigMain::AudioSettingsChanged)
|
||||
EVT_SLIDER(ID_VOLUME, CConfigMain::AudioSettingsChanged)
|
||||
|
||||
@ -215,6 +216,8 @@ void CConfigMain::UpdateGUI()
|
||||
// Disable stuff on AudioPage
|
||||
DSPEngine->Disable();
|
||||
DSPThread->Disable();
|
||||
DPL2Decoder->Disable();
|
||||
LatencySlider->Disable();
|
||||
|
||||
// Disable stuff on GamecubePage
|
||||
GCSystemLang->Disable();
|
||||
@ -360,8 +363,11 @@ void CConfigMain::InitializeGUIValues()
|
||||
VolumeText->SetLabel(wxString::Format(wxT("%d %%"), ac_Config.m_Volume));
|
||||
DSPThread->SetValue(startup_params.bDSPThread);
|
||||
DumpAudio->SetValue(ac_Config.m_DumpAudio ? true : false);
|
||||
FrequencySelection->SetSelection(
|
||||
FrequencySelection->FindString(wxString::Format(_("%d Hz"), ac_Config.iFrequency)));
|
||||
DPL2Decoder->Enable(std::string(ac_Config.sBackend) == BACKEND_OPENAL);
|
||||
DPL2Decoder->SetValue(startup_params.bDPL2Decoder);
|
||||
LatencySlider->Enable(std::string(ac_Config.sBackend) == BACKEND_OPENAL);
|
||||
LatencySlider->SetValue(startup_params.iLatency);
|
||||
LatencyText->SetLabel(wxString::Format(wxT("%d"), startup_params.iLatency));
|
||||
// add backends to the list
|
||||
AddAudioBackends();
|
||||
|
||||
@ -503,7 +509,6 @@ void CConfigMain::InitializeGUITooltips()
|
||||
|
||||
// Audio tooltips
|
||||
DSPThread->SetToolTip(_("Run DSP LLE on a dedicated thread (not recommended)."));
|
||||
FrequencySelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
|
||||
BackendSelection->SetToolTip(_("Changing this will have no effect while the emulator is running!"));
|
||||
|
||||
// Gamecube - Devices
|
||||
@ -511,6 +516,16 @@ void CConfigMain::InitializeGUITooltips()
|
||||
|
||||
// Wii - Devices
|
||||
WiiKeyboard->SetToolTip(_("This could cause slow down in Wii Menu and some games."));
|
||||
|
||||
#if defined(__APPLE__)
|
||||
DPL2Decoder->SetToolTip(_("Enables Dolby Pro Logic II emulation using 5.1 surround. Not available on OSX."));
|
||||
#elif defined(__linux__)
|
||||
DPL2Decoder->SetToolTip(_("Enables Dolby Pro Logic II emulation using 5.1 surround. OpenAL backend only."));
|
||||
#elif defined(_WIN32)
|
||||
DPL2Decoder->SetToolTip(_("Enables Dolby Pro Logic II emulation using 5.1 surround. OpenAL backend only. May need to rename soft_oal.dll to OpenAL32.dll to make it work."));
|
||||
#endif
|
||||
|
||||
LatencySlider->SetToolTip(_("Sets the latency (in ms). Higher values may reduce audio crackling. OpenAL backend only."));
|
||||
}
|
||||
|
||||
void CConfigMain::CreateGUIControls()
|
||||
@ -608,20 +623,23 @@ void CConfigMain::CreateGUIControls()
|
||||
DSPThread = new wxCheckBox(AudioPage, ID_DSPTHREAD, _("DSP LLE on Thread"));
|
||||
DumpAudio = new wxCheckBox(AudioPage, ID_DUMP_AUDIO, _("Dump Audio"),
|
||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
DPL2Decoder = new wxCheckBox(AudioPage, ID_DPL2DECODER, _("Dolby Pro Logic II decoder"));
|
||||
VolumeSlider = new wxSlider(AudioPage, ID_VOLUME, 0, 1, 100,
|
||||
wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
|
||||
VolumeText = new wxStaticText(AudioPage, wxID_ANY, wxT(""),
|
||||
wxDefaultPosition, wxDefaultSize, 0);
|
||||
BackendSelection = new wxChoice(AudioPage, ID_BACKEND, wxDefaultPosition,
|
||||
wxDefaultSize, wxArrayBackends, 0, wxDefaultValidator, wxEmptyString);
|
||||
FrequencySelection = new wxChoice(AudioPage, ID_FREQUENCY);
|
||||
FrequencySelection->Append(wxString::Format(_("%d Hz"), 48000));
|
||||
FrequencySelection->Append(wxString::Format(_("%d Hz"), 32000));
|
||||
LatencySlider = new wxSlider(AudioPage, ID_LATENCY, 0, 0, 30,
|
||||
wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL);
|
||||
LatencyText = new wxStaticText(AudioPage, wxID_ANY, wxT(""),
|
||||
wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
FrequencySelection->Disable();
|
||||
LatencySlider->Disable();
|
||||
BackendSelection->Disable();
|
||||
DPL2Decoder->Disable();
|
||||
}
|
||||
|
||||
// Create sizer and add items to dialog
|
||||
@ -629,6 +647,7 @@ void CConfigMain::CreateGUIControls()
|
||||
sbAudioSettings->Add(DSPEngine, 0, wxALL | wxEXPAND, 5);
|
||||
sbAudioSettings->Add(DSPThread, 0, wxALL, 5);
|
||||
sbAudioSettings->Add(DumpAudio, 0, wxALL, 5);
|
||||
sbAudioSettings->Add(DPL2Decoder, 0, wxALL, 5);
|
||||
|
||||
wxStaticBoxSizer *sbVolume = new wxStaticBoxSizer(wxVERTICAL, AudioPage, _("Volume"));
|
||||
sbVolume->Add(VolumeSlider, 1, wxLEFT|wxRIGHT, 13);
|
||||
@ -637,8 +656,9 @@ void CConfigMain::CreateGUIControls()
|
||||
wxGridBagSizer *sBackend = new wxGridBagSizer();
|
||||
sBackend->Add(TEXT_BOX(AudioPage, _("Audio Backend:")), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBackend->Add(BackendSelection, wxGBPosition(0, 1), wxDefaultSpan, wxALL, 5);
|
||||
sBackend->Add(TEXT_BOX(AudioPage, _("Sample Rate:")), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBackend->Add(FrequencySelection, wxGBPosition(1, 1), wxDefaultSpan, wxALL, 5);
|
||||
sBackend->Add(TEXT_BOX(AudioPage, _("Latency:")), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sBackend->Add(LatencySlider, wxGBPosition(1, 1), wxDefaultSpan, wxALL, 5);
|
||||
sBackend->Add(LatencyText, wxGBPosition(1, 2), wxDefaultSpan, wxALL, 5);
|
||||
wxStaticBoxSizer *sbBackend = new wxStaticBoxSizer(wxHORIZONTAL, AudioPage, _("Backend Settings"));
|
||||
sbBackend->Add(sBackend, 0, wxEXPAND);
|
||||
|
||||
@ -919,19 +939,25 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPThread = DSPThread->IsChecked();
|
||||
break;
|
||||
|
||||
case ID_DPL2DECODER:
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bDPL2Decoder = DPL2Decoder->IsChecked();
|
||||
break;
|
||||
|
||||
case ID_BACKEND:
|
||||
VolumeSlider->Enable(SupportsVolumeChanges(std::string(BackendSelection->GetStringSelection().mb_str())));
|
||||
LatencySlider->Enable(std::string(BackendSelection->GetStringSelection().mb_str()) == BACKEND_OPENAL);
|
||||
DPL2Decoder->Enable(std::string(BackendSelection->GetStringSelection().mb_str()) == BACKEND_OPENAL);
|
||||
ac_Config.sBackend = BackendSelection->GetStringSelection().mb_str();
|
||||
ac_Config.Update();
|
||||
break;
|
||||
|
||||
case ID_LATENCY:
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iLatency = LatencySlider->GetValue();
|
||||
LatencyText->SetLabel(wxString::Format(wxT("%d"), LatencySlider->GetValue()));
|
||||
break;
|
||||
|
||||
default:
|
||||
ac_Config.m_DumpAudio = DumpAudio->GetValue();
|
||||
|
||||
long int frequency;
|
||||
FrequencySelection->GetStringSelection().ToLong(&frequency);
|
||||
ac_Config.iFrequency = frequency;
|
||||
ac_Config.Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user