Search found 429 matches

by James
Fri Jan 20, 2017 6:19 pm
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

Thanks for testing it out. I've uploaded a short video of how nemulator behaves on my system (and this is typical of how it behaves on other systems I've tested on): https://youtu.be/3pmTXkYb1_s. I just don't see (or hear) the issues you're describing, so I guess I'm at a loss as to why you're exper...
by James
Fri Jan 20, 2017 3:04 pm
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

I don't have much experience with SDL audio, so perhaps it has something to do with how different audio devices deal with the callback mechanism. I've tested the DirectSound version on a wide range of hardware, and haven't run into any issues. If you get a chance, and don't mind taking a few minutes...
by James
Fri Jan 20, 2017 2:41 pm
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

rainwarrior wrote:Here, I made a recording. Does this sound significantly different than it does in your own tests?
It does. I hear the oscillation on your sample as well. Is this from a Windows box or something else?
by James
Fri Jan 20, 2017 2:02 pm
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

Also you misquoted this; I said it, not lidnariq. Sorry about that -- copy/paste error. Fixed. so you don't get audio distortion from constantly changing it to try and match If the audio rate change is sufficiently small, there is no audible distortion. I meant adjust the fixed rate (once at startu...
by James
Fri Jan 20, 2017 11:34 am
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

lidnariq wrote:I've seen the aforementioned oscillation show up all of the above audio methods.
In nemulator, there's some code to look for this condition and reset, but I didn't include that here. I'll update it.

No idea re: clicking issues with alsa. I'll see if I can reproduce it.
by James
Fri Jan 20, 2017 10:57 am
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

Whatever's going on here is mixing really badly with linux ALSA dmix, continuously emitting the "sample underrun" sound even without warning about it in the terminal. Is vsync working/is it running at relatively consistent 60fps? You may need to reduce the callback frequency (try changing wanted.sa...
by James
Fri Jan 20, 2017 7:11 am
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

Re: A/V synchronization

Just for reference ... is the audio supposed to be a clean square wave? Yes, a 240Hz square wave. Hmm, do you find that the aliasing/distortion resulting from the jittering pitch is a worthwhile tradeoff though? Absolutely. I find visual artifacts, like stuttering while scrolling, to be intolerable...
by James
Thu Jan 19, 2017 10:20 pm
Forum: General Stuff
Topic: How to properly playback audio when creating an emulator
Replies: 8
Views: 3087

Re: How to properly playback audio when creating an emulator

I've posted a thread in the NESemdev forum describing the method used in nemulator, with links to an example implementation: viewtopic.php?f=3&t=15405
by James
Thu Jan 19, 2017 10:19 pm
Forum: NESemdev
Topic: A/V synchronization
Replies: 36
Views: 11243

A/V synchronization

In this thread, gdkchan asked about A/V synchronization in his emulator. Here, I'll discuss the method I developed for nemulator. Most emulators sync to the audio playback rate and adjust the video rate to accommodate. This results in tearing (no vsync) or stuttering when scrolling (vsync). nemulato...
by James
Tue Jan 17, 2017 3:39 pm
Forum: General Stuff
Topic: How to properly playback audio when creating an emulator
Replies: 8
Views: 3087

Re: How to properly playback audio when creating an emulator

We're talking about two different, but related, issues here. I'm referring to synchronization in the context of this particular method of adjusting audio rate. In other words, how to (re-)determine the correct audio playback rate following a desync event. The issue you're referring to is applicable ...
by James
Tue Jan 17, 2017 2:04 pm
Forum: General Stuff
Topic: How to properly playback audio when creating an emulator
Replies: 8
Views: 3087

Re: How to properly playback audio when creating an emulator

So when you say "there's not much you can do about this" my reaction is "Uh, what?" -- you halt the emulator internals the instant said messages are received, and resume once the situations have ended (mouse button released, etc.). "This" meaning things getting out of sync. Recovery from this scena...
by James
Tue Jan 17, 2017 12:27 pm
Forum: General Stuff
Topic: How to properly playback audio when creating an emulator
Replies: 8
Views: 3087

Re: How to properly playback audio when creating an emulator

So, the question is, how this is usually done? Most emulators sync to the audio playback rate and adjust the video rate to accommodate. This results in tearing (no vsync) or stuttering when scrolling (vsync). You're doing the opposite: adjusting the audio rate to match the video rate. I think this ...
by James
Thu Dec 22, 2016 10:21 am
Forum: NESemdev
Topic: iNES emulator by Marat Fayzullin
Replies: 17
Views: 7320

Re: iNES emulator by Marat Fayzullin

You can convert binary pal files to iNES format with hexdump (on Linux, etc.):

Code: Select all

hexdump -ve '3/1 "%02X " "\n"' bin.pal > ines.pal
by James
Wed Nov 30, 2016 8:00 am
Forum: NESemdev
Topic: Cycle-accurate Nintendo NES emulator in ~1000
Replies: 8
Views: 3880

Re: Cycle-accurate Nintendo NES emulator in ~1000

I like his use of templates for handling opcodes. I've been working on a Genesis emulator on-and-off for a while, but have struggled with finding a good way to deal with the 68000 CPU. I may borrow some of these techniques for that. Bisqwit also made a ~1k line emulator in his youtube video a while ...
by James
Fri Nov 04, 2016 7:53 am
Forum: NESemdev
Topic: What is wrong with the NES Classic Edition noise emulation?
Replies: 42
Views: 30471

Re: What is wrong with the NES Classic Edition noise emulati

Seems like their MMC3 emulation is incorrect. The status bar glitch in SMB3 doesn't look right: http://nemulator.com/images/smb3_glitch.png This is how it should look. It's missing on the NES classic. In the videos I watched, scrolling isn't particularly smooth either, but I suppose that could be th...