Jump to content
Visual Boy Advance-M
Gobo

"Sync game to audio" creates motion sututtering (SVN945)

Recommended Posts

First of all, hello forum.

 

Now here's my problem; leaving "Sync game to audio" checked creates motion stuttering when playing in fullscreen, vsyncing to 60hz. I have tried about every possible combination of settings but to no avail. Disabling it, of course, gets rid of the stuttering, but then audio screws up quite badly.

 

The best way to test this is to go fullscreen and vsync to 60hz with "Sync game to audio" checked. Make sure your system isn't running anything else in the background that would mess with the framerate. Now load a game with long, horizontal smooth scrolling scenes (Super Mario Land 2's map should do), keep moving left and right (B+pad) till you notice the stuttering, which may happen any time.

 

Gambatte gets this right, not stuttering under normal circumstances, so at least a fix should be technically possible.

 

Thanks for your time and thanks for this great emulator.

Share this post


Link to post
Share on other sites

if anything is messing with your framerate, then im sorry this isn't a vba-m issue even with other things closed.

 

your system is just not capable of holding the emulator at full speed.

Share this post


Link to post
Share on other sites

if anything is messing with your framerate, then im sorry this isn't a vba-m issue even with other things closed.

 

Wrong assumption on your part. Nothing is messing with my framerate (I spend quite a deal of time optimizing my system precisely to avoid such problems) and that's why I specifically suggested that people should test this without anything in the background wasting CPU cycles.

 

your system is just not capable of holding the emulator at full speed.

 

Another equally wrong assumption on your part, unless this thing was designed for Crays.

Share this post


Link to post
Share on other sites

Alright. What are the recommended specs for plain gb/gbc emulation without filters or complex scalers? by recommended I mean, fast enough there's no way on earth it will slowdown no matter what. This was tested on a 3.8ghz Intel Pentium 4 with Windows XP Professional SP3 on top. The OS and everything relevant to VBA-M's requirements is up to date.

 

Also "not reproducible on anything over an Athlon 2000" implies God knows how many CPU models thus it'd have been virtually impossible for you to run this test extensively enough to tell for sure. At best it's a "not reproducible on my Athlon 2000" I'd say the problem lies somewhere else.

 

Anyways, if 3.8ghz won't cut it for plain GMB emulation, make it an emergency call for optimization.

Share this post


Link to post
Share on other sites

Does that pentium 4 have HTT?

 

if so, disable it as well as speed stepping. P4 C states are notorious for reduced performance, especially when the code runs efficient enough that most of the time it doesn't need to ramp up the clock rate.

 

the stutter is caused by the application switching HTT threads and switching the thread to active.

 

 

As for my hardware, I had an Athlon 2000 through most of vba-m's development, as well as several Durons spanning 850 - 1300mhz, a mobile Athlon64, Sempron 1250, mobile Core2 based Pentium, and my current i7 920.

Share this post


Link to post
Share on other sites

Yes, it has HT, but all it does is make regular application run slower so I keep it disabled. Granted it's not HT getting in the middle.

 

Does VBA-M's sound engine require hardware buffers?

 

A few hours ago I had the opportunity to run the test on a 3.0ghz with similar specs and it too failed. It's worth noting that you may not be able to reproduce the same type of stuttering on LCD screens, specially laptops' which work at fixed rates such as 75hz (60 frames per second "refreshed" 75 times per second would result in natural stuttery movement so it'd be hard to tell them apart)

 

For all I know VBA-M is unable properly sync to 60hz (as I understand it, the gameboy doesn't output at exactly 60hz so there the problem) and then sound to that, so one will always be behind the other and that's where the resync code enters the scene. Normally it's better to resync sound to video rather than video to sound (what seems to be the case here) but in VBA-M neither seems to do the job.

 

Any other ideas? for comparison, Cycle-exact WinUAE, which's far more demanding, can do this properly, and so can Gambatte.

Share this post


Link to post
Share on other sites
Does VBA-M's sound engine require hardware buffers?

 

no, however xaudio on XP only uses DirectSound,

 

need to get a openal enabled build uploaded.....

 

are you using opengl or direct3D?

Share this post


Link to post
Share on other sites

Sure. Which settings should I use, the ones that cause the stuttering? default settings? if I have to go fullscreen, I'll only be able to see part of the results (once I go back to windowed mode) as the graph just keeps scrolling.

Share this post


Link to post
Share on other sites

w89x7o.png

 

This is a 5 min test for gbc game "Alice in Wonderland" under the offending settings. Attached is my current vba.ini.

Share this post


Link to post
Share on other sites

the stuttering happens because the fps drops to 50.

 

Disable AutoFrame skip. this appears to trigger a fps drop at random, The probability is that its not entirely compatible with the new audio core (like save states).

Share this post


Link to post
Share on other sites

Sorry but it was already disabled, check my vba.ini. Enabling it just worsens the stuttering.

Share this post


Link to post
Share on other sites

Im afraid i cannot reproduce this when auto frame skipping is enabled with vsync, vsync is enabled with audio sync, or throttle is used.

 

It only occurs as long as audio sync and auto frame limiting is used together for me.

 

was using super mario deluxe to verify.

Share this post


Link to post
Share on other sites

On the other hand I've been able to reproduce the stuttering on 2 systems already. This just keeps getting weirder. What are your system specs?

Share this post


Link to post
Share on other sites

ok i have managed to reproduce it under OpenAL, but only when using hardware/software buffers.

 

the default XFI OAL device is low latency and doesn't cause it.

 

 

i still can't reproduce it on xaudio.

Share this post


Link to post
Share on other sites

For what it may be worth, my current sound driver won't do hardware buffers at all (hence my previous question) because it's optimized for low latencies and some nonessential features had to be left out.

 

Maybe it's my sound setup, but this is the first application to ever fall in conflict with it, assuming that's what's actually happening here.

Share this post


Link to post
Share on other sites

I get the same. 3570k, AMD 7950 HD - annoying stutter with "sync game to audio", with any combinations of settings including disabling audio. Same results with either a sound card (X-fi using OpenAL) or onboard (DS or XAudio2). DPC latency checker reveals less than 100 microseconds latency at all times (usually around 40). I can replicate this in all the machines in my house. Afterburner's 2.3.0 fps counter that updates many times a second never dips below 60fps, yet the visuals stutter.

 

IDK if it's because I'm highly sensitive to frame dropping or not but I assume there are others out there with the same problem. Could you please take another look at this/suggest a fix? Without sync game to audio I get fps problems - the games run about 5fps too fast, and it's noticeable.

 

P.S Regarding frame buffers, is there a reason why 2 frames is the minimum? I don't have anyone to help me A/B but Rhythm heaven feels pretty different depending on what the buffer is set to. Not complaining, just curious.

Share this post


Link to post
Share on other sites

is your display running at 65hz?

 

if not it should vsync to 60fps.

 

Its still not reproducible on this end, though I have found with certain other emulators that the switching from 3d clocks to low power clocks can make it appear to stutter.

 

Try forcing the drivers to specify max performance when running the emulator.

Share this post


Link to post
Share on other sites

my display runs at 120z which is probably why the most reliable speed setting i have is audio sync. i've just tried forcing 3d clocks as you suggested but the frame skips are still there.

 

i'm getting a new sound card in the next few weeks, will come back and report if anything's changed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×