Hi,
I noticed something interesting that is affecting GroovyMAME (audio) emulation accuracy. Short introduction first on the issue and then for the test and test results. It's also a very simple test, so if you have a minute, please report back, and I'll collect them in this first post.
One part in the chain of accurate emulation is the soundcard frequency stability, i.e. does it always exactly return the requested playback rate? Because if not, it will lead to a more unstable soundbuffer, which will cause soundbuffer over-/underflows (missing audio) at lower audio latency settings. Or said differently, the more stable the soundcard, the lower you can set the MAME audio latency without it causing issues, the more accurate the emulation gets.
Because GM didn't seem to be able to get as low a -stable- sound latency as I would expect it to be able to for DirectSound (the windows api used by MAME), I've been digging around deeper. First in the code, which didn't help, then looking at the soundcards more closely. Now to my total surprise I found that on two of my high end PC's, the high end soundcards that I've got in there (one an Auzentech X-Fi Forte and the other a Creative SB X-Fi) don't deliver a stable rate at all! Switching over to the Realtek ALC898 onboard audio delivered rocksteady audio, and allowed me to lower the audio latency in GroovyMAME by quite some margin, very close to a setting of 1, -without- it leading to any buffer over-/underflows.
Doing the soundcard frequency tests for all three, showed how unstable both X-Fi cards were, and how very stable the Realtek ALC898 is! The tests are done with the tool FreqTest, which requests a sample played at 48Khz a number of times and calculates the actual frequency that is returned by the soundcard, providing a "min", "avg" and "max" value. Ideally these values are the
same , as that means there's no invariabilty and as such the highest possible stability for MAME audio emulation.
Here are the results:
(
EDIT: other user results added to the table. Order is from best to worse.)
Card | Min (Hz) | Avg (Hz) | Max (Hz) | OS | Interface | User |
Realtek ALC861 | 48000,018 | 48000,030 | 48000,080 | Vista x64 | On-board | SMMM |
Sound Blaster X-Fi XtremeGamer | 47998,995 | 47999,05 | 47999,099 | XP x64 | PCI | Krick |
Auzentech X-Fi Prelude 7.1 | 47998,720 | 47998,810 | 47998,897 | XP x86 | PCI | Goglu2 |
Realtek ALC269 | 47998,298 | 47998,676 | 47998,934 | W7 x64 | On-board | Calamity |
Nvidia 550Ti (HDMI out) | 47998,440 | 47998,456 | 47998,472 | W7 x64 | PCI Express | SMMM |
SIGMATEL STAC 92XX C-Major HD Audio | 47998,200 | 47998,244 | 47998,275 | W7 x64 | On-board | Calamity |
Realtek ALC892 | 47997,946 | 47998,002 | 47998,054 | W7 x64 | On-board | bulbousbeard |
Realtek ALC887 | 47997,927 | 47997,951 | 47997,971 | W7 x64 | On-board | Krick |
Realtek ALC850 | 47997,934 | 47997,941 | 47997,959 | W7 x64 | On-board | deathterrapin |
Realtek ALC898 | 47997,252 | 47997,262 | 47997,292 | W7 x64 | On-board | Dr.Venom |
SIGMATEL STAC 92XX C-Major HD Audio | 48008,415 | 48008,485 | 48008,574 | XP x64 | On-board | Calamity |
Realtek ALC662 | 47973,221 | 47976,507 | 47993,630 | XP x64 | On-board | Calamity |
C-Media USB CM106 | 47997,932 | 48002,742 | 48045,940 | W7 x64 | USB | deathterrapin |
VIA VT1828S | 47997,245 | 48002,060 | 48045,268 | W7 x64 | On-Board | SMMM |
Auzentech X-Fi Forte | 47997,232 | 48002,057 | 48045,257 | W7 x64 | PCI Express | Dr.Venom |
C-Media USB unknown (0D8C 000E) | 47973,471 | 47975,037 | 47978,460 | XP x64 | USB | deathterrapin |
C-Media USB CM106 | 47973,478 | 47974,899 | 47978,343 | XP x64 | USB | deathterrapin |
Realtek ALC889 | 47950,417 | 47993,645 | 47998,486 | W7 x64 | On-Board | SMMM |
Creative SB X-Fi | 47949,261 | 48006,380 | 48045,260 | W7 x64 | PCI Express | Dr.Venom |
Asus Xonar DG | 47949,252 | 48006,863 | 48093,336 | W7 x64 | PCI | SMMM |
Realtek ALC889a | 47873,472 | 47946,747 | 48026,595 | W7 x64 | On-board | JDFan |
|
Now, as can be seen the RealTek ALC898 delivered by far the most stable results when compared to both my Auzentech and Creative X-Fi cards. The Realtek results in the possibility to now set a much
lower audio latency setting in MAME then with the X-Fi cards, without it causing audio issues (buffer over-/underflows).
Now I was actually quite surprised that the expensive high-end soundcards deliver such poor stability results. But it's not the first time we may be surprised on PC hard-/software.
Given this I'm wondering what the results are for other soundcards / OS setups? Hopefully you'll submit your own results. The procedure is actually quite simple:1. Make sure that you have set your audio device in windows to work at
16-bit 48Khz (configuration->audio panel -> right mouse button on default audio device -> select properties and then "advanced" and set it to 16-bit 48000Hz). *Note: this first step is important, as having the default audio device at any other rate then 48Khz, will cause FreqTest to deliver false results, because of resampling between the requested 48Khz and the default rate set in Windows.*
2. Start the attached "FreqTest.exe" (the archive includes both a 32 and 64 bit version) and wait for a few minutes. It will first test the screen frequency and then the audio test. The result will be like the picture below. The relevant part "sample rate" is highlighted in the red square:
3. Report back here with your soundcard, OS and the "sample rate" results.
If possible, I'll collect all the other results in the first post, such that we build a list on the best / most stable audio cards for use with MAME. Even if your card is the same as already reported by someone else in the test results, then please still report back with your own, as the stability may possibly also be OS / driver dependant. The more information the better.