Skip to content

Half-Life, CD Audio and Speed

Latest

Choose a tag to compare

@z2k-retro z2k-retro released this 12 Nov 05:21
925e140

This update to the emulated Aureal Vortex 2 (SQ2500) for 86Box comes mostly from comparing Half-Life's tram ride on a real card against the emulator, sound by sound. It fixes missing and cut-off dialogue, pops and stale sound, adds CD audio, and makes the audio model about two and a half times cheaper to run.

New

  • CD audio. On the SQ2500 the CD drive's analog cable plugs into the card. The Aureal driver doesn't play it through the codec's analog mixer: it records it through the codec's input, the same way you would record from a microphone, and mixes it digitally on the Vortex. The emulator now does the same, so game soundtracks on audio CD tracks play, and the Windows CD volume control works as on a real card. Before this there was no CD audio at all.
  • CD audio input level setting. The level depends on the CD drive's analog output and the card's input circuit, which haven't been measured. A new CD audio input level option in the card's settings sets it. The default, −12 dB, matches the music-to-game balance of Half-Life's current Steam release, measured with the soundtrack located in a recording of it. If the music seems too loud or too quiet, try a step either way.

Fixed

  • Dialogue that was silent or cut off in Half-Life now plays. Lines such as the security guard's at the end of the tram ride were silent, and the last word of the tram announcement ("day") was cut off. The cause was how the emulator fed sound data to the chip. It now fetches sound data from memory in the same pattern as a real card, measured from traces: 56 samples at the start of a sound, then 18 samples at a time. A stopped voice also keeps playing out what it has already fetched for a few milliseconds, as on a real card, rather than stopping dead.
  • No more stale sound when a sound restarts. When a game restarted a sound, the emulator could briefly replay leftover data from the previous one. This caused pops while walking in Half-Life, among other places. The driver clears a voice's buffer when it stops or restarts the voice, and the emulator now honours that.
  • Mixer gains above +1.5 dB no longer boost the signal. Half-Life turns some mixer inputs up far past unity. On a real card that doesn't make them louder, but in the emulator it did, so some sounds drowned out the 3D sound and clipped. The balance now matches real-card recordings of the tram ride.
  • Clipping and dropouts in CD audio. 86Box delivers CD audio in 100 ms chunks that sometimes arrive late; the card now buffers enough to ride over them.
  • A register now reads back as on real hardware. The voice buffer control registers return only the bits a real card returns.

Faster

  • About 2.5 times less CPU for the audio model, with the same output. The 3D engine skips work for silent and settled sources, the sample-rate converters and crosstalk canceller do less redundant work, and the wavetable loop is reorganised. This matters most on slower host machines, where heavy 3D scenes caused skipping.

Known limitations

  • Remaining pops are mostly 86Box running below full speed. The emulated card can't fill gaps when the whole emulator falls behind.
  • The tram announcer warbles slightly while the tram moves. The Doppler shift on the real card varies in the same way in traces, so this is probably faithful, but it hasn't been confirmed by ear on real hardware.
  • The CD audio level is an estimate until it can be measured on a real card. See the setting above.
  • Only CD audio is recorded through the codec. Other recording sources, such as the microphone and line in, aren't emulated.

See the 0.1 release notes for setup, what is emulated, and the other limitations, including the Sound Blaster IRQ 5 conflict and the A3D splash screen with PowerVR games.

Reporting problems

Turn on Write diagnostic log in the card's settings and attach vortex2.log (from the machine's folder) to your report. For sounds that are missing or wrong, a register trace of a short session helps most. If 86Box itself closes with an error, a Windows crash dump (set up through Windows Error Reporting's LocalDumps setting) shows where it failed.