Compare commits

...

4 Commits

Author SHA1 Message Date
JMC47
804cf465fc Merge pull request #13819 from jordan-woyak/null-sound-stream-drop-samples
AudioCommon/Mixer: Skip sample processing when NullSoundStream is being used.
2025-08-05 16:46:57 -04:00
JMC47
ab990018f2 Merge pull request #13831 from JoshuaVandaele/dualcore-conf
Config: Change default value for Dual Core from enabled to disabled
2025-08-05 13:45:15 -04:00
Joshua Vandaële
ee68efeee8 Config: Change default value for Dual Core from enabled to disabled
Dual Core is primarily known as one of the first troubleshooting steps when emulation or NetPlay misbehave.

I believe(?) the original intent with having it on by default was likely to support users with weaker machines. However, I believe it would be a lot more reasonable for users to manually enable dual core if they really need the performance boost, rather than it is for them to have come ask us in support channel why their cleanly-installed Dolphin is not emulating their games properly.

Instead, this creates a fragile first impression where a clean install of Dolphin is already set up in a way that leads to inexplicable crashes, subtle timing bugs, and NetPlay desyncs.

Note: This changes only applies to the Desktop application, since mobile devices *do* really need the performance boost.
2025-07-27 19:07:08 +02:00
Jordan Woyak
ff0560574e AudioCommon/Mixer: Skip sample processing when NullSoundStream is being used. 2025-07-23 17:53:21 -05:00
5 changed files with 34 additions and 4 deletions

View File

@@ -226,7 +226,11 @@ void Mixer::MixerFifo::PushSamples(const s16* samples, std::size_t num_samples)
void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
{
m_dma_mixer.PushSamples(samples, num_samples);
if (IsOutputSampleRateValid())
{
m_dma_mixer.PushSamples(samples, num_samples);
}
if (m_log_dsp_audio)
{
const s32 sample_rate_divisor = m_dma_mixer.GetInputSampleRateDivisor();
@@ -238,7 +242,11 @@ void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
{
m_streaming_mixer.PushSamples(samples, num_samples);
if (IsOutputSampleRateValid())
{
m_streaming_mixer.PushSamples(samples, num_samples);
}
if (m_log_dtk_audio)
{
const s32 sample_rate_divisor = m_streaming_mixer.GetInputSampleRateDivisor();
@@ -251,6 +259,9 @@ void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
void Mixer::PushWiimoteSpeakerSamples(const s16* samples, std::size_t num_samples,
u32 sample_rate_divisor)
{
if (!IsOutputSampleRateValid())
return;
// Max 20 bytes/speaker report, may be 4-bit ADPCM so multiply by 2
static constexpr std::size_t MAX_SPEAKER_SAMPLES = 20 * 2;
std::array<s16, MAX_SPEAKER_SAMPLES * 2> samples_stereo;
@@ -274,6 +285,9 @@ void Mixer::PushWiimoteSpeakerSamples(const s16* samples, std::size_t num_sample
void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_samples)
{
if (!IsOutputSampleRateValid())
return;
// Skylander samples are always supplied as 64 bytes, 32 x 16 bit samples
// The portal speaker is 1 channel, so duplicate and play as stereo audio
static constexpr std::size_t MAX_PORTAL_SPEAKER_SAMPLES = 32;
@@ -299,6 +313,9 @@ void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_sample
void Mixer::PushGBASamples(std::size_t device_number, const s16* samples, std::size_t num_samples)
{
if (!IsOutputSampleRateValid())
return;
m_gba_mixers[device_number].PushSamples(samples, num_samples);
}

View File

@@ -35,6 +35,10 @@ public:
void PushGBASamples(std::size_t device_number, const s16* samples, std::size_t num_samples);
u32 GetSampleRate() const { return m_output_sample_rate; }
void SetSampleRate(u32 output_sample_rate) { m_output_sample_rate = output_sample_rate; }
// Note: NullSoundStream sets the sample rate to 0.
bool IsOutputSampleRateValid() const { return m_output_sample_rate != 0; }
void SetDMAInputSampleRateDivisor(u32 rate_divisor);
void SetStreamInputSampleRateDivisor(u32 rate_divisor);

View File

@@ -5,6 +5,9 @@
bool NullSound::Init()
{
// Make Mixer aware that audio output is disabled.
GetMixer()->SetSampleRate(0);
return true;
}

View File

@@ -47,7 +47,13 @@ const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true};
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};
const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40};
const Info<bool> MAIN_CORRECT_TIME_DRIFT{{System::Main, "Core", "CorrectTimeDrift"}, false};
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, true};
#if defined(ANDROID)
// Currently enabled by default on Android because the performance boost is really needed.
constexpr bool DEFAULT_CPU_THREAD = true;
#else
constexpr bool DEFAULT_CPU_THREAD = false;
#endif
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, DEFAULT_CPU_THREAD};
const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true};
const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""};
const Info<bool> MAIN_ENABLE_CHEATS{{System::Main, "Core", "EnableCheats"}, false};

View File

@@ -371,7 +371,7 @@ void GeneralPane::AddDescriptions()
"burden by spreading Dolphin's heaviest load across two cores, which usually "
"improves performance. However, it can result in glitches and crashes."
"<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_CHEATS_DESCRIPTION[] = QT_TR_NOOP(
"Enables the use of AR and Gecko cheat codes which can be used to modify games' behavior. "
"These codes can be configured with the Cheats Manager in the Tools menu."