keepcalculator

06 Numbers and Powers

MAME 0.78 Sound Emulation Overhaul Explained

Card No. 06·86018 · Updated · Standard formula, shown below

Yes, MAME 0.78, released in November 2003, overhauled sound emulation by introducing a completely rewritten audio core that replaced the old, hardware-dependent sound system. This update, part of the project’s broader shift toward a more portable and accurate emulation framework, changed how MAME handled audio mixing, sample rates, and sound chip emulation, and it laid the groundwork for the modern MAME audio pipeline.

Background: MAME Before 0.78

Before version 0.78, MAME’s sound system was tied to a specific set of assumptions about the host hardware. The audio output was processed in a way that, while functional, made it difficult to add new sound chips or improve accuracy without risking breakage across the entire emulator. The old system also had limitations with sample rate conversion and mixing multiple audio streams, which could lead to minor audio glitches or timing inaccuracies, especially on games with complex sound hardware.

The MAME development team had been working on a major internal restructuring for several years, aiming to make the codebase more modular and easier to maintain. The sound overhaul in 0.78 was a key part of this effort, and it was one of the most significant internal changes in the emulator’s history up to that point.

What the Overhaul Actually Changed

The core change in MAME 0.78 was the introduction of a new sound stream system. Instead of each sound chip directly writing to a global buffer, each chip now creates its own stream, which is then mixed together by the emulator’s audio core. This allowed for:

  • Per-chip sample rates: Each sound chip can run at its native clock rate, and the core handles resampling to the output rate, improving accuracy.
  • Better mixing: The new mixer properly handles volume and panning, and it uses floating-point or higher-precision integer math to reduce distortion.
  • Modularity: Adding a new sound chip no longer requires rewriting the audio output code; developers just write a stream interface.

This change also meant that the old MAME_SOUND macros and the global sound_xxx functions were replaced with a more object-oriented approach, making the codebase cleaner and more consistent with the rest of the emulator’s architecture.

How the New Audio Core Works

In the new system, each sound device (like a YM2203 FM chip or a DAC) is responsible for generating a stream of samples at its own clock rate. The audio core then takes all these streams, converts them to a common sample rate (usually 48000 Hz), and mixes them together. The conversion is done using a band-limited resampling algorithm, which reduces aliasing artifacts compared to the old linear interpolation.

The mixer also handles the final volume and panning for each stream, and it applies a low-pass filter to prevent high-frequency noise from being introduced during resampling. This results in cleaner, more accurate audio, especially for games that use multiple sound chips simultaneously.

Impact on Accuracy and Compatibility

The overhaul was not just a cosmetic change; it improved the accuracy of sound emulation in several ways. Because each chip now runs at its exact clock speed, the timing of sound effects and music is more precise relative to the rest of the emulation. This is particularly noticeable in games that have tight audio-visual synchronization, such as rhythm games or games with voice samples.

However, the change also introduced some temporary regressions. Some games that relied on the old, less accurate audio timing had their sound slightly out of sync or distorted until the emulation of their specific sound chips was updated to the new system. The MAME team worked through these issues over the following releases, and by the next few versions, most games were back to normal or better than before.

Common Problems and Fixes

Users who upgraded to MAME 0.78 sometimes reported audio issues, such as crackling, popping, or no sound at all. These were usually caused by:

  • Old configuration files: The new audio core required a fresh configuration; existing mame.ini files with outdated audio settings could cause problems. Deleting the ini file and letting MAME regenerate it solved this.
  • Sample rate mismatch: Setting the output sample rate to an unusual value (like 22050 Hz) could cause artifacts. The default of 48000 Hz was recommended.
  • Sound card drivers: Some older sound cards had drivers that didn’t handle the new stream format well. Updating drivers or selecting a different audio API (like DirectSound instead of WaveOut) in the options often fixed this.

If you’re running an old version of MAME and experience audio problems, the first step is to reset your configuration and ensure your output sample rate is set to 48000 Hz.

Comparing MAME 0.78 to Later Versions

MAME 0.78’s audio core was a major step forward, but it was not the end of the evolution. Later versions further refined the system, adding support for more sound chips, improving the resampler quality, and integrating the audio system with the emulator’s dynamic recompiler for better performance. The basic stream architecture introduced in 0.78 is still present in modern MAME, albeit with many enhancements.

Compared to other emulators of the time, MAME 0.78’s audio was arguably more accurate than most, but it was also more demanding on the CPU. The new mixer and resampler required more processing power, which meant that older PCs might struggle to run games at full speed with sound enabled. This was a trade-off that the MAME team accepted in favor of accuracy.

Frequently Asked Questions

Does MAME 0.78 work on modern operating systems?

MAME 0.78 is a 2003-era application and may not run well on modern 64-bit Windows or macOS without compatibility settings. It was designed for Windows 9x/2000/XP, and while it can sometimes run on newer systems, it is not recommended for regular use. For modern systems, you should use a current version of MAME, which has much better compatibility and performance.

What is the best sample rate to use with MAME 0.78?

The default sample rate of 48000 Hz is the best choice for MAME 0.78. It matches the native rate of most sound cards and avoids the need for additional resampling, which can degrade quality. Using lower rates like 22050 Hz may reduce CPU usage but can introduce audible artifacts.

Why do some games have no sound in MAME 0.78?

If a game has no sound, it is usually because the game’s sound hardware is not yet emulated or is emulated incorrectly. MAME 0.78 emulated a wide range of sound chips, but some obscure or newly dumped games might have incomplete sound support. Check the game’s status in the MAME documentation or try a later version of MAME.

Can I use MAME 0.78 with a USB headset?

Yes, as long as your system recognizes the USB headset as a standard audio output device. MAME 0.78 uses the system’s default sound device, so you may need to set your headset as the default in your operating system’s sound settings. If you experience issues, try selecting a different audio API in MAME’s options.

Is MAME 0.78 legal to download?

MAME itself is open-source and legal to download. However, the ROMs (game files) are copyrighted and should only be used if you own the original arcade boards. Downloading ROMs from the internet without owning the original hardware is illegal in most jurisdictions.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →