I've watched the plethora of replies here about people desperately trying different drivers and hardware configurations and Nestopia settings to try to get rid of sound skipping and/or input lag. I figured it was finally time for me to clear some things up.
As of Windows Vista, DirectSound isn't what it used to be. It is no longer hardware-accelerated, but is instead emulated in software in the audio driver. It looks like Microsoft deprecated DirectSound with Vista because it had so many problems and limitations and was so difficult for programmers to get right (as evidenced by Nestopia), but of course they had to still support it through emulation for legacy compatibility reasons.
Any programs written using DirectSound need to provide a dedicated background thread to continuously supply new audio data to the DirectSound playback buffer to avoid skips or breaks in the audio playback. FCEUX is written this way (go look at its source code), but Nestopia is not. Nestopia does all the DirectSound work on the main emulation thread, which sets up an unpredictable race condition between the main emulation loop and the audio playback buffer. On some systems the main emulation loop is fast enough and the DirectSound emulation in the audio driver is fast and accurate enough that everything mostly works, but that's not the case for most systems. On most systems you get sound skipping (as the main emulation loop can't keep up with the DirectSound playback buffer), input lag (as the main emulation loop gets held up), or some combination of the two.
There are only two ways to fix this probem in Nestopia:
1) Do a significant re-write of Nestopia's audio stack to offload all the DirectSound audio buffer stuff to a background thread, and create an intermediary audio buffering system, very similar to what FCEUX does.
2) Do a significant re-write of Nestopia's audio stack to use Microsoft's new XAudio API instead of DirectSound. XAudio's API set is designed to eliminate exactly this kind of problem, and the driver support should be much better for it.
Either way, it's a non-trivial change to Nestopia's source code, and one I haven't had the time to implement. I still have the idea at the back of my mind and one of these days when I finally have the time I intend to do a rewrite (probably using XAudio) to fix these problems permanently.
If you are lucky enough to get my unofficial Nestopia release (or any previous release) working smoothly, than just consider yourself lucky. But if you run into sound skipping or input lag problems, then my advice to you is to stop trying to muck with priority settings or driver versions or hardware configurations because ultimately none of it will help. The flaw is in Nestopia itself, and it's nearly impossible to predictably work around. For the time being, you are best off using FCEUX or some other NES emulator that doesn't suffer from these problems.