Settings: Drop audio sync option

Not relevant since time stretching was added.
This commit is contained in:
Connor McLaughlin 2022-08-05 17:57:46 +10:00
parent 57c1ca97f7
commit 1289064316
6 changed files with 2 additions and 31 deletions

View File

@ -286,7 +286,6 @@ void Settings::Load(SettingsInterface& si)
audio_fast_forward_volume = si.GetUIntValue("Audio", "FastForwardVolume", 100); audio_fast_forward_volume = si.GetUIntValue("Audio", "FastForwardVolume", 100);
audio_output_muted = si.GetBoolValue("Audio", "OutputMuted", false); audio_output_muted = si.GetBoolValue("Audio", "OutputMuted", false);
audio_sync_enabled = si.GetBoolValue("Audio", "Sync", true);
audio_dump_on_boot = si.GetBoolValue("Audio", "DumpOnBoot", false); audio_dump_on_boot = si.GetBoolValue("Audio", "DumpOnBoot", false);
dma_max_slice_ticks = si.GetIntValue("Hacks", "DMAMaxSliceTicks", DEFAULT_DMA_MAX_SLICE_TICKS); dma_max_slice_ticks = si.GetIntValue("Hacks", "DMAMaxSliceTicks", DEFAULT_DMA_MAX_SLICE_TICKS);
@ -485,7 +484,6 @@ void Settings::Save(SettingsInterface& si) const
si.SetUIntValue("Audio", "OutputVolume", audio_output_volume); si.SetUIntValue("Audio", "OutputVolume", audio_output_volume);
si.SetUIntValue("Audio", "FastForwardVolume", audio_fast_forward_volume); si.SetUIntValue("Audio", "FastForwardVolume", audio_fast_forward_volume);
si.SetBoolValue("Audio", "OutputMuted", audio_output_muted); si.SetBoolValue("Audio", "OutputMuted", audio_output_muted);
si.SetBoolValue("Audio", "Sync", audio_sync_enabled);
si.SetBoolValue("Audio", "DumpOnBoot", audio_dump_on_boot); si.SetBoolValue("Audio", "DumpOnBoot", audio_dump_on_boot);
si.SetIntValue("Hacks", "DMAMaxSliceTicks", dma_max_slice_ticks); si.SetIntValue("Hacks", "DMAMaxSliceTicks", dma_max_slice_ticks);

View File

@ -150,7 +150,6 @@ struct Settings
u32 audio_output_volume = 100; u32 audio_output_volume = 100;
u32 audio_fast_forward_volume = 100; u32 audio_fast_forward_volume = 100;
bool audio_output_muted = false; bool audio_output_muted = false;
bool audio_sync_enabled = true;
bool audio_dump_on_boot = false; bool audio_dump_on_boot = false;
// timing hacks section // timing hacks section

View File

@ -2210,14 +2210,10 @@ void System::UpdateSpeedLimiterState()
} }
} }
const bool is_non_standard_speed = IsRunningAtNonStandardSpeed();
const bool audio_sync_enabled =
!IsRunning() || (m_throttler_enabled && g_settings.audio_sync_enabled && !is_non_standard_speed);
const bool video_sync_enabled = ShouldUseVSync(); const bool video_sync_enabled = ShouldUseVSync();
const float max_display_fps = (!IsRunning() || m_throttler_enabled) ? 0.0f : g_settings.display_max_fps; const float max_display_fps = (!IsRunning() || m_throttler_enabled) ? 0.0f : g_settings.display_max_fps;
Log_InfoPrintf("Target speed: %f%%", target_speed * 100.0f); Log_InfoPrintf("Target speed: %f%%", target_speed * 100.0f);
Log_InfoPrintf("Syncing to %s%s", audio_sync_enabled ? "audio" : "", Log_InfoPrintf("Using vsync: %s", video_sync_enabled ? "YES" : "NO");
(audio_sync_enabled && video_sync_enabled) ? " and video" : (video_sync_enabled ? "video" : ""));
Log_InfoPrintf("Max display fps: %f (%s)", max_display_fps, Log_InfoPrintf("Max display fps: %f (%s)", max_display_fps,
m_display_all_frames ? "displaying all frames" : "skipping displaying frames when needed"); m_display_all_frames ? "displaying all frames" : "skipping displaying frames when needed");
@ -2234,10 +2230,6 @@ void System::UpdateSpeedLimiterState()
if (s_target_speed < target_speed) if (s_target_speed < target_speed)
stream->UpdateTargetTempo(target_speed); stream->UpdateTargetTempo(target_speed);
// stream->SetSync(audio_sync_enabled);
// if (audio_sync_enabled)
// stream->EmptyBuffer();
s_target_speed = target_speed; s_target_speed = target_speed;
UpdateThrottlePeriod(); UpdateThrottlePeriod();
ResetThrottler(); ResetThrottler();
@ -3191,7 +3183,6 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
if (g_settings.audio_backend != old_settings.audio_backend || if (g_settings.audio_backend != old_settings.audio_backend ||
g_settings.video_sync_enabled != old_settings.video_sync_enabled || g_settings.video_sync_enabled != old_settings.video_sync_enabled ||
g_settings.audio_sync_enabled != old_settings.audio_sync_enabled ||
g_settings.increase_timer_resolution != old_settings.increase_timer_resolution || g_settings.increase_timer_resolution != old_settings.increase_timer_resolution ||
g_settings.emulation_speed != old_settings.emulation_speed || g_settings.emulation_speed != old_settings.emulation_speed ||
g_settings.fast_forward_speed != old_settings.fast_forward_speed || g_settings.fast_forward_speed != old_settings.fast_forward_speed ||

View File

@ -20,7 +20,6 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent
SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.audioBackend, "Audio", "Backend", &Settings::ParseAudioBackend, SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.audioBackend, "Audio", "Backend", &Settings::ParseAudioBackend,
&Settings::GetAudioBackendName, Settings::DEFAULT_AUDIO_BACKEND); &Settings::GetAudioBackendName, Settings::DEFAULT_AUDIO_BACKEND);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.syncToOutput, "Audio", "Sync", true);
SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.stretchMode, "Audio", "StretchMode", SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.stretchMode, "Audio", "StretchMode",
&AudioStream::ParseStretchMode, &AudioStream::GetStretchModeName, &AudioStream::ParseStretchMode, &AudioStream::GetStretchModeName,
Settings::DEFAULT_AUDIO_STRETCH_MODE); Settings::DEFAULT_AUDIO_STRETCH_MODE);
@ -70,10 +69,6 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent
"host. Smaller values reduce the output latency, but may cause hitches if the emulation " "host. Smaller values reduce the output latency, but may cause hitches if the emulation "
"speed is inconsistent. Note that the Cubeb backend uses smaller chunks regardless of " "speed is inconsistent. Note that the Cubeb backend uses smaller chunks regardless of "
"this value, so using a low value here may not significantly change latency.")); "this value, so using a low value here may not significantly change latency."));
dialog->registerWidgetHelp(m_ui.syncToOutput, tr("Sync To Output"), tr("Checked"),
tr("Throttles the emulation speed based on the audio backend pulling audio frames. This "
"helps to remove noises or crackling if emulation is too fast. Sync will "
"automatically be disabled if not running at 100% speed."));
dialog->registerWidgetHelp( dialog->registerWidgetHelp(
m_ui.startDumpingOnBoot, tr("Start Dumping On Boot"), tr("Unchecked"), m_ui.startDumpingOnBoot, tr("Start Dumping On Boot"), tr("Unchecked"),
tr("Start dumping audio to file as soon as the emulator is started. Mainly useful as a debug option.")); tr("Start dumping audio to file as soon as the emulator is started. Mainly useful as a debug option."));

View File

@ -39,7 +39,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="2"> <item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="startDumpingOnBoot"> <widget class="QCheckBox" name="startDumpingOnBoot">
<property name="text"> <property name="text">
<string>Start Dumping On Boot</string> <string>Start Dumping On Boot</string>
@ -126,13 +126,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="syncToOutput">
<property name="text">
<string>Sync To Output</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2"> <item row="5" column="0" colspan="2">
<widget class="QLabel" name="bufferingLabel"> <widget class="QLabel" name="bufferingLabel">
<property name="text"> <property name="text">

View File

@ -3185,11 +3185,6 @@ void FullscreenUI::DrawAudioSettingsPage()
"Audio", "OutputLatencyMS", Settings::DEFAULT_AUDIO_OUTPUT_LATENCY_MS, 1, 500, "%d ms"); "Audio", "OutputLatencyMS", Settings::DEFAULT_AUDIO_OUTPUT_LATENCY_MS, 1, 500, "%d ms");
} }
DrawToggleSetting("Sync To Output",
"Throttles the emulation speed based on the audio backend pulling audio "
"frames. Enable to reduce the chances of crackling.",
"Audio", "Sync", true);
EndMenuButtons(); EndMenuButtons();
} }