How to Configure Run-Ahead in RetroArch Without Audio Glitches

Stylized abstract chip board illustration in cool blue with offset timing traces and frame blocks, for a RetroArch run-ahead feature, no logos.

RetroArch run-ahead cuts a frame or two of input lag, but the second instance setting is what keeps the audio from crackling during the lookahead simulation.

I switched on run-ahead for a SNES platformer, shaved what felt like two frames off the jump, and then spent the next ten minutes chasing a crackle that only appeared while the music was playing. The lag improvement was real. The noise was also real, and it came from the same setting. Run-ahead is one of the more useful latency options in RetroArch, but it asks the emulator to do extra work every frame, and audio is where that extra work tends to show up first. Here is how I set it up so the response stays snappy and the soundtrack stays clean, using legal personal backups of games I own.

What run-ahead actually computes each frame

Run-ahead does not speed up your television and it does not reduce the delay a display adds. It attacks the lag baked into the game loop. Many NES and SNES titles read the pad, run a frame of logic, then draw the result one or two frames later, so your button press shows up after a short internal delay. Run-ahead saves the emulator state, simulates one or more frames ahead without drawing or playing them, reads the newest input, restores the saved state and replays up to the real frame with that fresher input. The visible frame therefore reflects a button you pressed more recently than it otherwise would.

Finding the settings and a sane starting value

In RetroArch the switch lives under Settings, then Latency, as the run-ahead option, with a separate number-of-frames value and a second-instance toggle. Per-core overrides are the right place to store it, because a flat global setting will punish heavy cores that cannot afford the extra steps. Start at one frame. One frame removes the most obvious internal lag on 2D titles and is cheap enough that a modest laptop keeps up. Two frames is for games with a deeper input buffer, and it should be a deliberate choice after you confirm the core stays at full speed, not a default you copy from someone else config.

Why the audio crackles and what stops it

The crackle has a mechanical explanation. Audio is generated per emulated frame and handed to a buffer that the sound card drains at a steady real-time rate. During run-ahead, the emulator briefly computes frames faster than real time and then throws some of them away. If the audio backend tries to render samples for those discarded frames, or if the buffer is asked to fill at an uneven rate, you get gaps and duplicates that come out as ticks and buzz. There is also a plain mismatch case: a large audio buffer hides the problem but adds its own delay, while a tiny one underruns the moment the emulation pace wobbles.

The single most effective fix is the second-instance option. It runs a separate copy of the core to do the lookahead work, so the primary instance keeps one continuous, well-behaved audio stream. That is the setting I reach for first, because it treats the cause rather than the symptom. After that, lower the audio latency value under Settings, then Audio, from a generous default down toward 32 or 64 milliseconds, and try a different audio driver if the current one is fussy. On Windows the low-level exclusive drivers behave differently from the shared ones, and on Linux the ALSA and Pulse paths are not interchangeable. A resampler option can also smooth small timing errors, though it will not rescue a core that is missing frames outright.

Symptom Likely cause Setting to try first
Crackle only during music Lookahead frames feeding the audio buffer Enable second instance
Occasional pops after a lag spike Buffer underrun at uneven pace Raise audio latency slightly
Response still feels heavy Too few lookahead frames Raise number of frames to two
Frame rate dips with run-ahead on Core already CPU bound Back to zero frames for that core
Buzz persists on every core Audio driver or sample rate mismatch Switch driver, check sample rate

An ordered setup that stays stable

  1. Pick a fast 2D core and a game with one visible, repeatable action, like a jump with a fixed animation. Confirm the core supports rewind, which is a good proxy for state serialization.
  2. Set number of frames to one and enable run-ahead. Load the game and confirm the frame rate holds at full speed in the performance overlay.
  3. Compare input to response with a slow-motion phone recording at 120 or 240 frames per second, counting frames between pad press and first moving pixel. Repeat with run-ahead off to get a baseline.
  4. If you hear crackle, enable second instance and reload the core. Re-listen during a music-heavy section, not a quiet menu.
  5. Only then lower audio latency, in small steps, and re-check for pops after each change.
  6. Raise to two frames only if the baseline still shows more than one frame of internal lag and the core has CPU headroom. Save the result as a per-core .cfg override.

Which games gain the most

2D platformers and shooters on 8-bit and 16-bit hardware are the sweet spot, because they are cheap to emulate and their input buffers are shallow. Games that already respond on the first frame gain almost nothing, so forcing run-ahead on them just burns cycles. Cores that stream audio from a disc, or push a lot of geometry per frame, are the ones I leave alone: the extra state saves can disturb streaming and the audio glitches come back even with the second instance. There is a related video option, hard GPU sync, that trims a different part of the pipeline by forcing the CPU and GPU to stay closer together, and it is worth a look when run-ahead alone is not enough. I treat the two as separate tools rather than stacking them by default, because each one costs frame time.

Keep the per-core .cfg overrides under version control or at least in a folder you back up, since they are the whole record of what you tuned. On my SNES setup, one frame plus the second instance removed the crackle completely, while two frames made a modest laptop stutter during busy screens. The one-frame version is still the one I load, and the faster the game, the more I notice it.

Related reading

If you want to keep digging into this corner of the library, these two posts on Roms Get go a little further:

Similar Posts