mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
9cf627113a
Replace the push-model SDL_QueueAudio output with the shared band-limited polyphase resampler + P-only fill servo (recomp_audio_drc.h), fed by an SPSC ring under SDL_LockAudioDevice and drained by a pull callback. The SPU renders 44100/60 per wall-clock frame while the host consumes on its own crystal; the unsynchronized clocks drifted the queue to underrun (silence gaps = sustained crackle). The bridge nudges the resample ratio <=+/-0.5% to hold the ring near target so the queue never runs dry. Measured on MMX6: legacy push ~1.5-2.5 underruns/s (queue draining to 0ms) -> bridge 0 underruns, fill held ~50ms. PSXRECOMP_AUDIO_LEGACY=1 keeps the old push path for A/B; PSXRECOMP_AUDIO_PROBE=1 prints the fill/underrun trend. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>