MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

DaRayu
MAME Fan
Reged: 02/05/13
Posts: 162
Send PM


Sound propblems with vsync and games >= 60 Hz
#307667 - 04/22/13 11:33 PM


Does the following happen to you too? When you play a game in MAME and have vsync enabled and if your monitor is set to 60 Hz and the game runs at 60 Hz as well, then every few seconds the sound will "stumble".

This can be observed very well in "Street Fighter II": MAME 0.126 was the last version where the game was set to 60.0 Hz. In MAME 0.127, it was set to 59.61 Hz.
If I play it in 0.126 and just let the introduction music play, the sound will stumble after a while. For a very short moment, the sound will trip and then continue normally. This happens periodically.
Then, one version later, in 0.127, where the refresh rate lies less than half a Hertz below the screen refresh rate, the sound will play totally smoothly without ever having a problem.

Do you experience the same problem? And can this be prevented?
For "Street Fighter II" itself it's not a problem anymore. And for games that don't scroll, like "Pac-Man", I can just disable vsync since it's not really needed. But how do I resolve this sound problem in games that scroll and run at 60 Hz, like "Vs. Super Mario Bros."?



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: Sound propblems with vsync and games >= 60 Hz new [Re: DaRayu]
#307746 - 04/24/13 07:37 PM


> Does the following happen to you too? When you play a game in MAME and have vsync
> enabled and if your monitor is set to 60 Hz and the game runs at 60 Hz as well, then
> every few seconds the sound will "stumble".

If that's happening, it's generally because either your video card/monitor aren't syncing to a perfect 60.0 Hz or your soundcard isn't syncing perfectly to MAME's output rate. -vsync assumes that each time you hit vblank at 60 Hz that your soundcard will need exactly (44100.0/60.0) = 735 more samples. If either hardware device doesn't quite honor that contract you'll get periodic sound skips.



DaRayu
MAME Fan
Reged: 02/05/13
Posts: 162
Send PM


Re: Sound propblems with vsync and games >= 60 Hz new [Re: R. Belmont]
#307747 - 04/24/13 08:09 PM


Is there an option in MAME that can circumvent this somehow? And why doesn't it happen if the game is set to less than 60Hz?



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: Sound propblems with vsync and games >= 60 Hz new [Re: DaRayu]
#307791 - 04/25/13 04:59 PM


> Is there an option in MAME that can circumvent this somehow? And why doesn't it
> happen if the game is set to less than 60Hz?

MAME attempts to auto-compensate for minor drifts, but it stops short of creating audible pitch distortion (which making the audio frames too far out of sync with correctness would do). Depending on which way things are drifting it's quite plausible that it's able to compensate in one direction but not the other.



Marcelo_20XX
MAME Fan
Reged: 04/20/13
Posts: 43
Send PM


Re: Sound propblems with vsync and games >= 60 Hz new [Re: R. Belmont]
#308013 - 04/29/13 08:30 PM


I got the same problem and it turned out that it was my Sound Card, which is an integrated one, so as a workaround I lowered the sample rate to 32000


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 464 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1758