bsnes vsync development thread

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

blargg wrote:Slowed SNES: 60 Hz video, 31992 Hz audio

Then we just resample the audio to 48000 Hz. There's no need to resample twice, from 32040 to 31992, then to 48000, so we just resample once from 32040 to 48000 Hz, using an interpolator rate (step) of 0.6675.
Wait, you lost me there.
Wouldn't you have to resample 31992 to 48000 (0.6665) ?
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
byuu

Post by byuu »

I only have one resample. The SNES outputs samples to a resampler / volume adjust routine (100% volume does not modify the samples). That spits out samples to the actual audio codec when appropriate.
I get a relatively stable 30/30 fps here
Sorry. Sigh, why can't all the cool people have leet Core 2 Duos? :(
Maybe I should start soliciting 'donations' from Intel for my work in promoting their new processors, heheh.
Because I'm using this setting right now, running around in Super Mario World, and I can't see these dupe frames.
Then your monitor is different than all of mine. Which is a great reason to be for a wide range to accommodate all users ;)
Remember, I only resist your middle default theory because I honestly don't think people know whether left or right is going to make things better.
I don't think people are going to think to change the SNES input frequency to fix video sound tearing issues in the first place, to be truthful.

It's sucky that it needs to be there at all, but it is what it is. I was playing with Kega Fusion, which lacks such an option, and I wasn't able to keep the video from jumping every ~3 seconds. I found it less annoying to leave vsync off entirely.

Maybe we shouldn't even worry about it. I would like to continue to pursue this in the future. Perhaps we can come up with a dynamically adjustable buffer that auto-compensates to match video:audio ratio. Though if sinamas and blargg consider it to be very difficult, I don't think I will fare well.
If both are off, for example, and the checkmark is at 100%, speed will be uncapped despite the checkmark.
The speed meaning has changed. By having the video+audio checkboxes, it's now possible to run uncapped with different input frequency rates (from 16khz-64khz). I don't know why you'd want that, since the sound sucks anyway without audio sync, but it's there.
A little confusing, but that's what you get for having these percentage options.
And they're awesome. Because of them, I can do something I can't do in any other emulator: beat Mega Man X2 without using save states, by running the game at 50% speed. Slows it down just enough for my clearly inferior hand-eye coordination.
diminish

Post by diminish »

byuu wrote:Some things I would suggest: overclock infinitesimally if you can. I understand if you don't want to for a SNES emulator. Also, set the process affinity (in task manager, right click on bsnes) to high. Make sure absolutely nothing else non-essential is running, perhaps even including services and virus scanning stuff. That should help prevent sudden frame dips. Next, make sure your Scale Nx is not the biggest size your display can support. Make it one smaller. That helps me immensely on Windows.
I tried different things, but no luck. About the O/C, that's really a pest on a laptop - no bios settings, messing with it straight in OS, not mentioning increased heat, which already is up high. My machine must be somewhat 'broken', because FitzRoy is ok with 1.86 GHz :?. I admit I have some problems with crackling in foobar when other app is hungry for CPU, or when I quit from some game and turn foobar on (doesn't matter if Direct Sound, Kernel Streaming or Wave Out). It's present in WinXP SP2, SP3 or Vista with newest drivers for everything. In Vista, even video files crackle slightly :shock:. Turning off Hardware Acceleration for Sound in dxdiag makes things even worse.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

byuu wrote:
I get a relatively stable 30/30 fps here
Sorry. Sigh, why can't all the cool people have leet Core 2 Duos? :(
Nah, my fault for not going with the times. :wink: I just don't want to replace the entire system until absolutely necessary.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

I'm not going to allow audio to be lowered to 0. I'll get idiots complaining that "mute audio" has no effect, because they set the volume to zero. No need for two ways to do the same thing, and I want a quick way to turn off audio without going into another window.
I can usually foresee what dummies are going to do, but this would honestly surprise even me. In any case, one final suggestion, take out the mute audio option, give the slider full range, and institute Increase / Decrease Volume hotkeys which reports in the status bar. This would give you an even faster way to mute audio, and it would put all volume settings in one place.
byuu wrote: Then your monitor is different than all of mine. Which is a great reason to be for a wide range to accommodate all users ;)
The range is the same. The only disagreement is the default. Once again, there's nothing stopping you or anyone else from moving the ticker left to improve its behavior.
I don't think people are going to think to change the SNES input frequency to fix video sound tearing issues in the first place, to be truthful.
If that's the case, then we're really fucked. Prepare for the barrage of complaints. Unless of course, you don't go through with your aggressive defaults...
And they're awesome. Because of them, I can do something I can't do in any other emulator: beat Mega Man X2 without using save states, by running the game at 50% speed. Slows it down just enough for my clearly inferior hand-eye coordination.
Yeah, yeah, but it doesn't solve that confusion. How about graying them out when both Sync to Audio and Sync to Video are unchecked? That would clear it up. And it's really tempting to just combine the two syncs, so much damn simpler. What would the costs be of doing this?

Another idea, you could do a two checkmark system like this with only two areas, graying out the percentages when it's on desync:

Code: Select all

Emulation Speed >
    Desync
 (X)Sync to Audio
    Sync to Video
    Sync to Audio & Video
    ---------------
    50%
    75%
 (X)100%
    150%
    200%
byuu

Post by byuu »

In any case, one final suggestion, take out the mute audio option, give the slider full range, and institute Increase / Decrease Volume hotkeys which reports in the status bar.
I don't mind hotkeys, but I do want the mute audio checkbox. That may not be the best UI thing, but it's important to me. I use it all the time. Probably every other time I run the emulator. Hitting some sound key ten times, not as convenient.
If that's the case, then we're really fucked. Prepare for the barrage of complaints. Unless of course, you don't go through with your aggressive defaults...
Let's at least wait and get more numbers, and then decide on the best defaults. I'd rather target working on 90-95% of systems, so that we don't have to go extreme for the edge cases. Maybe we should make a thread for that?
And it's really tempting to just combine the two syncs, so much damn simpler. What would the costs be of doing this?
Sync to video limits the framerate to your monitor's refresh rate, whereas just sync to audio lets you run up to 120fps with perfectly smooth audio. The blockiness in sync to video when your monitor isn't running at the game's rate, and/or if you are using frame skipping, could be quite unbearable to some, as well.
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

grinvader wrote:
blargg wrote:Slowed SNES: 60 Hz video, 31992 Hz audio

Then we just resample the audio to 48000 Hz. There's no need to resample twice, from 32040 to 31992, then to 48000, so we just resample once from 32040 to 48000 Hz, using an interpolator rate (step) of 0.6675.
Wait, you lost me there.
Wouldn't you have to resample 31992 to 48000 (0.6665) ?
Thanks! You are correct and I made an error. By displaying only 60 frames per second, the emulator won't be running as fast, therefore it will only generate 31992 samples per second, BEFORE any resampling. So like you say, the resampler starts with 31992, not 32040. I corrected my original post.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Whew. No problem. ^^
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Snark
Trooper
Posts: 376
Joined: Tue Oct 31, 2006 7:17 pm

Post by Snark »

Ok, for me anything between 40 and 200 produce very minimal cracking. On average slight crackling once each 30-45secs. So weirdly enough, whether I set it to 200max or 40 it doesn't seem to make a difference (so obviously I would set it to 40 to get minimal audio lag) Anything below that produce constant crackling.

edit I should add though that my box is not fast enough to run bsnes at full speed without frameskip.
I want to fry~~ Sky Hiiiiiiiiigh~
Let's go-o-o-O~ togeda~
Locked