Closed GoogleCodeExporter closed 9 years ago
This has to do with the input rate, which is designed to accommodate audio
output rates or video refresh rates that tend to vary slightly even in spec.
The code you posted is just adjusting the ratio so as to not affect the output
rate when timing are enabled, and is dependent on a timing hack in itself. Your
problem is that there's not enough sound data for the slow speed your video is
output at. The only way to fix this without changing hardware is to use a
high-resolution resampler to stretch the data slightly.
The core resampler is designed to be able to multithread by default anyways.
Read the porting.html file that comes in the doc folder of the Snes9x source.
In short, you need to set up S9xSetSamplesAvailableCallback, then lock a common
mutex around the S9xFinalizeSamples in the callback and the S9xMixSamples calls
in your audio thread--S9xMixSamples is what actually performs the resampling.
If you're still against using the built-in resampler, you're going to need your
own high precision resampler somewhere to avoid the underruns. If you can get
significantly faster than the LinearResampler without any CPU-specific
instructions, though, I'd be surprised.
BTW, you should stick to the Snes9x development forum for core questions like
these (http://www.snes9x.com/phpbb2/viewforum.php?f=8). This issue tracker is
specifically for Snes9x-gtk.
Original comment by bear...@gmail.com
on 30 Oct 2010 at 4:33
Sorry, part of that second paragraph should read:
"when timing hacks are enabled, and is not dependent on a timing hack in itself"
Original comment by bear...@gmail.com
on 30 Oct 2010 at 4:35
And if you want to disregard the timing hacks, you probably can. You'll only
see overruns, not underruns, and these will be eliminated by duplicate frames
if you're properly using sound sync.
Original comment by bear...@gmail.com
on 30 Oct 2010 at 4:39
Original issue reported on code.google.com by
airmake...@gmail.com
on 27 Oct 2010 at 7:40