MAME 2015 Refresh Rate Audio/Video Sync Questions

Hi all! Hopefully someone more knowledgeable about MAME, VSync and refresh rates etc…can chime in and help here.

I’ve never been able to achieve Audio/Video sync with MAME in RetroArch as well as I’ve been able to in standalone MAME. Let me try to explain…

In standalone MAME, setting ‘throttle’ to ‘off’ and ‘wait for vsync’ and ‘refresh speed’ to ‘on’ accomplishes what I’m trying to achieve; i.e. it get’s rid of flickering sprites and flickering psuedo transparency effects on games that don’t run at exactly 60hz, such as Neo Geo games. I believe games might run at a slightly different speed, but it gets rid of flickering shadows and stuff that is tied directly to the refresh rate. I’m assuming it does this by letting the game run at your monitors refresh rate and ignoring the actual reported refresh rate.

In RetroArch, I’ve never been able to achieve this, until recently when I discovered if I turn off ‘Audio/Video Sync’ in the audio settings I can completely get rid of the flickering issues. It seems ‘throttle off’ in MAME core options doesn’t do what it does in standalone MAME, and setting ‘read config’ in core options and placing my mame.ini in system\mame\ini doesn’t work either. I’ve set my refresh rate speed in ‘video settings’ based on what RetroArch is telling me my refresh rate is (60.002 hz).

At this point, I just don’t know what else to try… I’ve adjusted refresh rate, I’ve messed around with the audio settings, and like I said, if I turn off audio/video sync, the flickering sprites and shadows go away, and the game seems to be synced to my monitor/TV; there is slight audio cracking, which I’m not quite sure how to remove.

How detrimental is it to leave off ‘audio/video sync’? What can I do to further reduce the audio crackling? Only the MAME core behaves this way. Any other suggestions to have MAME games that run at different refresh rates sync better with my monitor? Anyone that has any knowledge on this is encouraged to join the conversation, as I’d like to figure out why this behaves like this in RetroArch and not standalone MAME…

If it makes a difference, I’m on Windows 7 64bit Intel Haswell at 3.6khz AMD Radeon 7750

This doesn’t help with your issue, but seems related. Something changed sometime after the 1.0.0.3 beta build of the MAME core so that Gaia Crusaders runs faster than stand alone and sounds off because of it. I made a git issue about it here. I think that game runs at a strange refresh and is being sped up now to match the refresh rate specified in my config. Toggling throttle or audio sync doesn’t affect it. But, if I set the refresh rate to 57 instead of the default 59.95 it’s about the same as it sounds in stand alone.

Edit: Also, that game uses the kind of shadows you mention and they don’t flicker for me. That’s with the throttle core option off, audio sync on, vsync on, refresh rate set to default 59.95 and hard sync on (sync frames 1). I’m using the 2-9-15 nightly core and RetroArch build. I can setup MAME stand alone with your video settings and get perfect shadows too, but it doesn’t have the side effect of speeding up the audio like the libretro core does.

Edit2: I tried the 1.0.0.3 beta build of the core again and I do see the shadow flickering there. I’m using the same settings as I do for the nightly. I tested Last Blade 2 as well and the flickering is present in the beta core and gone in the nightly. The audio distortion is minimal compared to Gaia, but when I recorded both I could hear a little when jumping back and forth between them.

Edit3: One more discovery! I can change “audio_max_timing_skew” from 0.05 to 0.00 in the nightly to fix the audio, but that brings back the shadow flickering.

I don’t think there is any perfect solution with a 60Hz monitor.

The easiest one is to go to “slider controls” in Mame Gui and push “screen refresh rate” there to 60Hz or slightly above. The sound could jump a bit then.

The “throttle off” sync to 60Hz way is a bit crazy with some games originally running at 50/55Hz or even bellow. Those games will be too fast.

The best solution will be a FreeSync/G-Sync monitor with its dynamic refresh rate I guess (if that works here).

That’s worked for me in the past, but I’ve never found a way to save that setting… At least you can save ‘audio video sync’ to off or ‘dynamic rate control’ to ‘0.00’ and have it save…

How come standalone can get rid of the flickering shadows and RetroArch struggles? It would be nice to implement a way to incorporate standalone MAME behavior in RetroArch… Does ‘core throttle’ behave differently in RetroArch vs standalone MAME?

P.S. Gaia Crusaders is a cool, underrated game IMHO…

There are a few competing constants here:

To get non-flickering shadows, you need to be running at exactly the same refresh rate as the monitor. That’s faster than the game is supposed to run, though, so the video will be slightly faster than normal. You need the audio to push samples out in lockstep with the video, or else the audio buffer empties and you get an audible pop/crackle. In RetroArch, you can set the max_audio_skew to something higher than normal and it will run the audio faster and at a slightly higher pitch to match the video and the audio buffer will never empty.

I hear that standalone MAME doesn’t have higher-pitched audio, so either they’re resampling the audio at a lower pitch to compensate for the faster speed or they’re doing some other magic to keep the buffer from emptying.

[QUOTE=hunterk;18560]There are a few competing constants here:

To get non-flickering shadows, you need to be running at exactly the same refresh rate as the monitor. That’s faster than the game is supposed to run, though, so the video will be slightly faster than normal. You need the audio to push samples out in lockstep with the video, or else the audio buffer empties and you get an audible pop/crackle. In RetroArch, you can set the max_audio_skew to something higher than normal and it will run the audio faster and at a slightly higher pitch to match the video and the audio buffer will never empty.

I hear that standalone MAME doesn’t have higher-pitched audio, so either they’re resampling the audio at a lower pitch to compensate for the faster speed or they’re doing some other magic to keep the buffer from emptying.[/QUOTE]

How/why does disabling ‘audio video sync’ in RGUI audio settings get rid of flickering shadows?

I believe that means it’s no longer blocking on audio, so the video is matching to the refresh rate as intended, instead of being held back by the audio.

After messing around a bit, I have MAME running pretty good with ‘Audio/Video Sync’ on, ‘Audio Rate Control Delta’ at 0.000 (off) and Audio Maximum Timing Skew bumped up to 0.07. No flickering… Audio sounds good

Those settings don’t noticeably affect the audio for me. I’m fine with setting the max skew to 0.00 or 0.01 and getting some shadow flickering. I was afraid there would be more side affects than that, but it doesn’t noticeably affect background scrolling or cause any audio pops. Glad you got settings that work well for you!

And yeah, Gaia Crusaders is a great beat 'em up :). Lots of variety in attacks and movement, music’s pretty good and has nice art.

[QUOTE=Awakened;18644]

And yeah, Gaia Crusaders is a great beat 'em up :). Lots of variety in attacks and movement, music’s pretty good and has nice art.[/QUOTE]

If you like that style beat’em up and never checked out ‘The Gladiator/Road of the Sword/Shen Jian’, do so; One of my favorites. I enjoy it more than Gaia Crusaders

I have heard of that one, but didn’t try it until now. Trying to do air juggles is fun.