mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 15:00:30 +02:00
sceAudio: Don't reschedule before the mixed block is pushed
Waking a thread from the mixer reschedules, which runs any due CoreTiming events. When an audio tick runs late, the next tick would already be due, and it would mix over mixBuffer before this one had been output. The next block would then be played twice and this one dropped. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3dddacbfe0
commit
76a8e9d45f
1 file changed
+7
-4
@@ -639,10 +639,6 @@ void __AudioUpdate(bool resetRecording) {
|
||||
woke |= __AudioMixSRC(g_audioSRC);
|
||||
audioMixing = false;
|
||||
|
||||
if (woke) {
|
||||
__AudioReScheduleAfterWake();
|
||||
}
|
||||
|
||||
if (g_Config.bEnableSound) {
|
||||
float multiplier = Volume100ToMultiplier(std::clamp(g_Config.iGameVolume, 0, VOLUMEHI_FULL));
|
||||
if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL || PSP_CoreParameter().fastForward) {
|
||||
@@ -689,6 +685,13 @@ void __AudioUpdate(bool resetRecording) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Only once the block is out. Rescheduling runs any due events, and when this tick was late
|
||||
// that includes the next one, which would mix over mixBuffer before it was pushed - playing
|
||||
// the next block twice and dropping this one.
|
||||
if (woke) {
|
||||
__AudioReScheduleAfterWake();
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MOBILE_DEVICE
|
||||
|
||||
Reference in new issue
Block a user