Home Page
Posted By: c0d3h4x0r Nestopia 1.41 unofficial release - 03/30/10 04:03 AM
Nestopia 1.41 unofficial release:

Binaries: http://c0d3h4x0r.0catch.com/Nestopia-1.41-unofficial-x86.zip

Source: http://c0d3h4x0r.0catch.com/Nestopia-1.41-unofficial-x86-src.zip

NESTOPIA RELEASE NOTES

-------------------------------
1.41 for Win32 (March 29, 2010)
-------------------------------
This is an unofficial maintenance release I created to fix an annoying joystick lag issue. This lag was particularly bad when VSync was enabled. The original Nestopia author (Martin
Freij) appears to have abandoned the official Nestopia project on SourceForge and has not responded to any of my e-mails, so I am left with no choice but to provide this unofficial release as a public service to the emulation community.

Changes:

1. Removed manual option to set priority of Nestopia's main emulation loop thread. Instead, Nestopia now boosts its own process base priority AND its own main emulation thread priority whenever it is the active foreground window (and/or running in full-screen mode). This brings Nestopia much closer to real-time performance and responsiveness.

2. Removed some screwy input polling logic, and added some calls to input.Poll(), to ensure that the input devices are always polled immediately before the input state is utilized. This was the key change that got rid of most of the lag.

3. Removed some screwy input timing logic that was causing input polling to work only on certain clock intervals, rather than allowing it to work every time it was called.

(As far as I can tell on my own hardware configuration, these three changes taken together have completely eliminated the lag problems that have been present in Nestopia for several releases. Your mileage may vary.)

4. Updated the Visual Studio solution/project to build successfully under Visual C++ 2008 Express Edition.

5. Added this releasenotes.txt file and bumped the version number to 1.41.

- Keith Kelly (c0d3h4x0r@hotmail.com)
Posted By: crawler Re: Nestopia 1.41 unofficial release - 03/30/10 10:22 AM
brilliant! this is why i love open source projects; they can never truly die!
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/01/10 09:30 PM
Very true. I just registered here to say thank you for fixing these issues and releasing your work. It even compiles fluidly now! The difference is remarkable.

That said, I wonder if you'd be so kind to perhaps look at another issue which is particularly galling for Win7 and Vista users: It's the choppy sound as reported both on the ZSNES board (scrolling way down to FireBrandX's post: http://board.zsnes.com/phpBB2/viewtopic.php?t=11629&start=0) and here, too (http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=56805#Post56805).
Both Nintendulator and FCEUX sound fine, which, aside from your work here, are the only recent still-developed NES emus, I believe. Could it be connected to the higher latency of Vista's and 7's DirectSound implementation? Or might it be a problem of the timing thread having issues with refresh rate syncing? Vista and 7 are known to confuse some badly programmed games in VSync with its more exact monitor refresh rate determination (59 vs. 60 Hz, though I've tried various refresh rates, even exact NTSC [59.94], and it doesn't work). Or a funny combination of both?
Hardware differences don't seem to affect it and no setting fixes it completely. Setting the latency to 1 in the sound options merely reduces it. It appears that audio and video go out of sync and Nestopia's timing thread snaps the audio thread back into place, producing clicking sounds every 2-3 seconds. Setting both Windows and Nestopia to use the same sampling rate does not work and neither does setting them both to a lower value. Otherwise, that's a commonly known workaround for this kind of problem for both video playback and regular games.

I've tried everything I know and I'm at my wits' end. I'm a novice in C++ and not familiar at all with Nestopia's extremely complex-looking codebase. Perchance you'd like to give it a try?

Thanks again for your time.
Posted By: Mighty Mo Re: Nestopia 1.41 unofficial release - 04/02/10 01:01 PM
I wish Marty would start working on his emulator again. Such a great program to just forget about.

Does anyone know if there's a way to have the cheat files automatically load into the cheat window when a game is loaded? Maybe by using it's SHA? Can't be CRC, because they vary.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/06/10 12:06 PM
I haven't experienced any issues with choppy sound on any of my three Win7 x64 machines using my unofficial 1.41 build.

FireBrandX's issue sounds like either a bad audio driver or something wrong with his particular hardware. It wouldn't surprise me if the other Nestopia users reporting this problem have the same faulty audio driver or hardware.

Anyway, for anyone reporting this issue (or any other issue) in the future, it's incredibly important that you provide detailed repro steps (including all your Nestopia settings, running fullscreen or not, what ROM(s) you are using, and your hardware configuration) so that developers like me can actually reproduce the problem. If you don't provide enough information and we can't reproduce your problem, then there's nothing we can do to investigate it or fix it.

Just for the record, I am playing NTSC roms on an NTSC PC with the monitor refresh set to 60fps, VSync enabled, fullscreen, timings set to "synchronize to screen refresh", and sound latency set to "1". This is using my 1.41 unofficial release.

My primary desktop hardware:
Windows 7 amd64 RTM + all latest Windows Updates
Gigabyte GA-X58A-UDR3 motherboard (Intel X58 chipset)
HPET (High-Precision event timer) enabled and set to "64-bit mode" in the BIOS
Intel Core i7-920 CPU overlocked to 3.2 GHz
8GB RAM
ATI Radeon HD 4890
Integrated Realtek HD Audio
all latest drivers/firmwares/BIOSes installed
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/06/10 01:18 PM
I'm sorry for not providing those details. As I said in my original post, hardware differences seemed not to matter during my testing with three different machines here. I am indeed surprised that you do not experience this. It seems there's more going on than I originally thought. I better stop assuming for now smile

Okay, this happens on the following systems, playing NTSC-U ROMs, monitor refresh rate forced or set to 60 Hz (it originally registered as 59 on one monitor here, which is a known "problem" with 7, as I detailed above -- though it doesn't make a difference whether I use other monitors or whether I force it to 59 or 60 Hz) via the NV control applet or otherwise, VSync plus triple buffering enabled, timings set to "synchronize to refresh rate" and sound latency to "1", fullscreen or not makes no difference:

Win7 x64 RTM plus all updates
ASUS Rampage II Extreme on AHCI mode, Intel ICH10R chipset
Intel Core i7-920 down-voltmodded & overclocked to 3.6 GHz
6GB OCZ DDR3-1600 RAM at 1443 GHz
NVIDIA Geforce GTX 295 (w/ 3D profile overclocked & VBIOS-down-voltmodded to decrease heat generation)
Creative SB X-Fi PCIe Titanium Fatal1ty Pro
All the latest drivers/firmwares/BIOSes through Station Drivers et al.
Everything's stress-tested and stable.
(ASUS provides no HPET option in their R2E BIOS. The device manager thus lists it but says that "no drivers are installed for this device." I guess that means I'm still on RTC?)

Next was on a laptop:
Win7 x64 RTM plus all updates
CLEVO M570RU-U, Intel ICH8R chipset
Intel Core2Duo T-9300, 2.5 Ghz
4GB DDR2-600 RAM
NVIDIA Geforce 8800M GTX VBIOS-modded to 9800GT (w/ 3D profile overclocked)
Integrated Realtek HD Audio
All the latest drivers/firmwares/BIOSes through Station Drivers et al.
(Of course, no HPET option here either. Phoenix TrustedCore BIOS options are notoriously sparse.)

And another desktop:
Win7 x64 RTM plus all updates
ASUS P5B Deluxe, Intel ICH8R chipset
Intel Core2Duo E6400, 2.1 Ghz overclocked to 3.01 Ghz
4GB DDR2-800 RAM
Sapphire ATI Radeon HD 5870 Vapor-X, Rev. 2
SoundMAX Integrated Digital HD Audio (AD1989)
All the latest drivers/firmwares/BIOSes through Station Drivers et al.
(No HPET option here either.)

New Forceware drivers finally curbed the latency issues on my laptop. DPC Latency Checker now shows no latency abnormalities on all of them.

I typically use Megaman 2 to test this, as its intro's long notes demonstrate it quite well, though it happens on all of them. As I said, setting sound latency to "1" merely reduces the problem. The ROMs themselves are known good ROMs. This is all done using your 1.41 release. CPU usage on the C2Ds never exceeds 8% and my Core i7 registers 4,5% maximum as reported by the newest Process Explorer 12.01.

So there you go. Let me know if you need any further help tracking this down. I'm willing smile
Thank you for the taking the time to help!
Posted By: buzbard Re: Nestopia 1.41 unofficial release - 04/06/10 02:48 PM
I had a similar problem using my Acer Aspire One netbook, the problem turned out to be Stardock's CursorFX. It's a kind of mouse pointer skin thing. If I disable it Nestopia runs fine but while it's enabled Nestopia runs really choppy, very slow frame rate and choppy unsynchronized sound.

Just my 2 cents.
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/06/10 04:54 PM
For what it's worth, it also does not appear to matter whether Aero is activated or not. Normally, I run with it disabled, since it causes tearing for me in a number of non-DWM-compliant applications (mostly emulators requiring high precision in hitting VBlanks and MPC-HC's syncing code).

Buzbard:
In Stardock's forums, there is talk of a bug or something causing extremely high CPU usage or maybe your netbook's just not powerful enough to run a skinning program besides something rather demanding like Nestopia.
What OS do you run? XP like most Aspire Ones? Then you might not encounter this particular peculiarity as described by me. Does the music in games otherwise sound in any way choppy? If not, consider yourself lucky smile
Thanks to c0d3h4x0r, Nestopia's pretty much close to perfect now for my needs. I'm very glad he's decided to help smile
Posted By: buzbard Re: Nestopia 1.41 unofficial release - 04/06/10 09:39 PM
Yea, I'm running XP. My netbook does run Nestopia fine, just not while CursorXP is enabled, I've stopped using it anyway.

I see you're running Win7, did you know that Microsoft has a free download that gives you WinXP mode for Win7? So you can run older software.

Here's the link: http://www.microsoft.com/windows/virtual-pc/default.aspx

You might give that a try.

And yes, thank you c0d3h4x0r for the update, well done!
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/08/10 07:36 AM
Thank you gummybear for the detailed error report. I will look into this sometime over the next week or two and let you know if I am able to reproduce the issue and maybe find out what's causing it.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/10/10 09:14 PM
gummybear, can you please post the contents of both your Nestopia.log and Nestopia.xml files?

1. Launch Nestopia
2. run the game and wait for the problem to happen some
3. close Nestopia
4. Go to the directory where you ran Nestopia.exe from
5. copy and paste the file contents to this thread.

I am still suspicious that this may have something to do with the PC's hardware timer. Nestopia consults the hardware timer to determine if it needs to skip frames (to catch up to the actual time it should be at) or wait (to slow down to the actual time it should be at) to keep the emulation running at the right speed.

Nestopia can use an HPET if available, but then falls back on a multimedia timer. Or, if you are running with VSYNC enabled and "synchornize to refresh rate" checked AND your monitor refresh rate matches the ROMs framerate, it will just rely on Direct3D's built-in VBlank waiting (which is implemented via a multimedia timer anyway) to throttle the emulation.
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/11/10 12:03 AM
Okay, there you go:

Nestopia log file version 1.41
-----------------------------------

Language: loaded "english.nlg" version 1.41.0.01
Direct3D: initializing..
Direct3D: enumerating device - name: NVIDIA GeForce GTX 295, GUID: D7B71E3E-46A0-11CF-6355-45261FC2C535
Direct3D: dynamic textures: supported
Direct3D: texture bilinear filtering: supported
Direct3D: max texture dimensions: 8192x8192
Direct3D: scanline effect: supported
Direct3D: vsync on every second refresh: supported
Direct3D: vsync on every third refresh: supported
Direct3D: found 38 display modes
Direct3D: supported monitor frequencies: 50hz, 59hz, 60hz, 75hz
Direct3D: creating HAL device #0
Direct3D: entering 1920x1200x32 60hz window mode
DirectSound: initializing..
DirectSound: enumerating device - name: Primary Sound Driver, GUID: unspecified
DirectSound: enumerating device - name: Speakers (Creative SB X-Fi), GUID: 44B322E5-BB9A-4774-BAF9-0B27B0DE8EF9
DirectSound: creating device #1
DirectInput: initializing..
DirectInput: enumerating device - name: Saitek Cyborg Pad for PC/Xbox 360, GUID: 6F333D40-E29F-11DE-8006-444553540000
DirectInput: found 1 attached joystick(s)
Direct3D: enabling VSYNC
Timer: performance counter present (3525351 hz)
Kaillera: found "kailleraclient.dll" version 0.9
Launcher: database file "launcher.xml" not present
Fds: BIOS ROM ok
Database: 2894 items imported from internal DB
Configuration: warning, unused/invalid parameter: "x"
Configuration: warning, unused/invalid parameter: "y"
Emulator: loading "D:\Emulator Games\NEStopia\Games\Mega Man 2 (U).nes"
Ines: 256k PRG-ROM set
Ines: vertical mirroring set
Ines: NTSC set
Ines: mapper 1 set
Board: NES-SGROM
Board: 256k PRG-ROM
Board: 8k V-RAM
Board: MMC rev. B2
Direct3D: entering 1920x1200x32 60hz full-screen mode
Direct3D: entering 1920x1200x32 60hz window mode
Emulator: unloaded "D:\Emulator Games\NEStopia\Games\Mega Man 2 (U).nes"


And here are the settings:

<?xml version="1.0" encoding="UTF-8"?>
<configuration version="1.41">
<cheats>
<show-hex-code-view>no</show-hex-code-view>
<show-hex-main-view>no</show-hex-main-view>
</cheats>
<image-database>
<external>no</external>
<file />
<internal>yes</internal>
</image-database>
<input>
<allow-simultaneous-axes>no</allow-simultaneous-axes>
<auto-fire-speed>3</auto-fire-speed>
<joysticks>
<joystick>
<deadzone>50</deadzone>
<device>6F333D40-E29F-11DE-8006-444553540000</device>
<enabled>yes</enabled>
<scan>
<p0>yes</p0>
<p1>yes</p1>
<p2>yes</p2>
<p3>yes</p3>
<rx>yes</rx>
<ry>yes</ry>
<rz>yes</rz>
<x>yes</x>
<y>yes</y>
<z>yes</z>
<z0>no</z0>
<z1>no</z1>
</scan>
</joystick>
</joysticks>
<keys>
<crazyclimber>
<left-down>S</left-down>
<left-left>A</left-left>
<left-right>D</left-right>
<left-up>W</left-up>
<right-down>H</right-down>
<right-left>G</right-left>
<right-right>J</right-right>
<right-up>Z</right-up>
</crazyclimber>
<emulation>
<alt-speed>Tabulator</alt-speed>
<insert-coin-1>F2</insert-coin-1>
<insert-coin-2>F3</insert-coin-2>
<rewind>Rück</rewind>
</emulation>
<excitingboxing>
<body>Nach-unten</body>
<left-hook>K</left-hook>
<left-jab>,</left-jab>
<left-move>Nach-links</left-move>
<right-hook>L</right-hook>
<right-jab>.</right-jab>
<right-move>Nach-rechts</right-move>
<straight>Nach-oben</straight>
</excitingboxing>
<file>
<exit>Alt+X</exit>
<launcher>Alt+L</launcher>
<load-state>F7</load-state>
<open>Strg+O</open>
<quick-load-state-1>1</quick-load-state-1>
<quick-load-state-2>2</quick-load-state-2>
<quick-load-state-3>3</quick-load-state-3>
<quick-load-state-4>4</quick-load-state-4>
<quick-load-state-5>5</quick-load-state-5>
<quick-load-state-6>6</quick-load-state-6>
<quick-load-state-7>7</quick-load-state-7>
<quick-load-state-8>8</quick-load-state-8>
<quick-load-state-9>9</quick-load-state-9>
<quick-load-state-newest>0</quick-load-state-newest>
<quick-save-state-1>Umschalt+1</quick-save-state-1>
<quick-save-state-2>Umschalt+2</quick-save-state-2>
<quick-save-state-3>Umschalt+3</quick-save-state-3>
<quick-save-state-4>Umschalt+4</quick-save-state-4>
<quick-save-state-5>Umschalt+5</quick-save-state-5>
<quick-save-state-6>Umschalt+6</quick-save-state-6>
<quick-save-state-7>Umschalt+7</quick-save-state-7>
<quick-save-state-8>Umschalt+8</quick-save-state-8>
<quick-save-state-9>Umschalt+9</quick-save-state-9>
<quick-save-state-oldest>Umschalt+0</quick-save-state-oldest>
<save-screenshot>Alt+E</save-screenshot>
<save-state>F5</save-state>
</file>
<help>
<readme>F1</readme>
</help>
<horitrack>
<a>.</a>
<b>,</b>
<down>Nach-unten</down>
<left>Nach-links</left>
<orientation>D</orientation>
<right>Nach-rechts</right>
<select>Umschalt rechts</select>
<speed>S</speed>
<start>Eingabe</start>
<up>Nach-oben</up>
</horitrack>
<karaokestudio>
<a>H</a>
<b>J</b>
<mic>G</mic>
</karaokestudio>
<machine>
<change-disk-side>Umschalt+B</change-disk-side>
<hard-reset>Umschalt+T</hard-reset>
<no-sprite-limit-toggle>Umschalt+U</no-sprite-limit-toggle>
<pause>Umschalt+P</pause>
<power>Umschalt+D</power>
<soft-reset>Umschalt+R</soft-reset>
</machine>
<mahjong>
<a>Q</a>
<b>W</b>
<c>E</c>
<chi>B</chi>
<d>R</d>
<e>T</e>
<f>A</f>
<g>S</g>
<h>D</h>
<i>F</i>
<j>G</j>
<k>H</k>
<kan>C</kan>
<l>J</l>
<m>K</m>
<n>L</n>
<pon>V</pon>
<reach>N</reach>
<ron>M</ron>
<select>X</select>
<start>Y</start>
</mahjong>
<nsf>
<next-song>Umschalt+Nach-rechts</next-song>
<play-song>Umschalt+Nach-oben</play-song>
<previous-song>Umschalt+Nach-links</previous-song>
<stop-song>Umschalt+Nach-unten</stop-song>
</nsf>
<pachinko>
<a>.</a>
<b>,</b>
<down>Nach-unten</down>
<left>Nach-links</left>
<right>Nach-rechts</right>
<select>Umschalt rechts</select>
<start>Eingabe</start>
<up>Nach-oben</up>
</pachinko>
<pad-1>
<a>(joy 0) 1</a>
<auto-fire-a>(joy 0) 3</auto-fire-a>
<auto-fire-b>(joy 0) 2</auto-fire-b>
<b>(joy 0) 0</b>
<down>(joy 0) +p0y</down>
<left>(joy 0) -p0x</left>
<mic>0 (zehnertastatur)</mic>
<right>(joy 0) +p0x</right>
<select>(joy 0) 6</select>
<start>(joy 0) 7</start>
<up>(joy 0) -p0y</up>
</pad-1>
<pad-2>
<a>X</a>
<auto-fire-a>W</auto-fire-a>
<auto-fire-b>Q</auto-fire-b>
<b>Y</b>
<down>V</down>
<left>C</left>
<mic>M</mic>
<right>B</right>
<select>A</select>
<start>S</start>
<up>F</up>
</pad-2>
<pad-3>
<a>...</a>
<auto-fire-a>...</auto-fire-a>
<auto-fire-b>...</auto-fire-b>
<b>...</b>
<down>...</down>
<left>...</left>
<mic>...</mic>
<right>...</right>
<select>...</select>
<start>...</start>
<up>...</up>
</pad-3>
<pad-4>
<a>...</a>
<auto-fire-a>...</auto-fire-a>
<auto-fire-b>...</auto-fire-b>
<b>...</b>
<down>...</down>
<left>...</left>
<mic>...</mic>
<right>...</right>
<select>...</select>
<start>...</start>
<up>...</up>
</pad-4>
<partytap>
<unit-1>Q</unit-1>
<unit-2>W</unit-2>
<unit-3>E</unit-3>
<unit-4>R</unit-4>
<unit-5>T</unit-5>
<unit-6>Z</unit-6>
</partytap>
<pokkunmoguraa>
<row-1-button-1>T</row-1-button-1>
<row-1-button-2>Z</row-1-button-2>
<row-1-button-3>U</row-1-button-3>
<row-1-button-4>I</row-1-button-4>
<row-2-button-1>G</row-2-button-1>
<row-2-button-2>H</row-2-button-2>
<row-2-button-3>J</row-2-button-3>
<row-2-button-4>K</row-2-button-4>
<row-3-button-1>B</row-3-button-1>
<row-3-button-2>N</row-3-button-2>
<row-3-button-3>M</row-3-button-3>
<row-3-button-4>,</row-3-button-4>
</pokkunmoguraa>
<powerglove>
<move-in>A</move-in>
<move-out>Y</move-out>
<roll-left>X</roll-left>
<roll-right>C</roll-right>
<select>Umschalt rechts</select>
<start>Eingabe</start>
</powerglove>
<powerpad>
<side-a-1>Q</side-a-1>
<side-a-10>X</side-a-10>
<side-a-11>C</side-a-11>
<side-a-12>V</side-a-12>
<side-a-2>W</side-a-2>
<side-a-3>E</side-a-3>
<side-a-4>R</side-a-4>
<side-a-5>A</side-a-5>
<side-a-6>S</side-a-6>
<side-a-7>D</side-a-7>
<side-a-8>F</side-a-8>
<side-a-9>Y</side-a-9>
<side-b-10>M</side-b-10>
<side-b-11>N</side-b-11>
<side-b-2>U</side-b-2>
<side-b-3>Z</side-b-3>
<side-b-5>K</side-b-5>
<side-b-6>J</side-b-6>
<side-b-7>H</side-b-7>
<side-b-8>G</side-b-8>
</powerpad>
<view>
<fullscreen>Alt+Eingabe</fullscreen>
<screen-size-1x>Alt+1</screen-size-1x>
<screen-size-2x>Alt+2</screen-size-2x>
<screen-size-3x>Alt+3</screen-size-3x>
<screen-size-4x>Alt+4</screen-size-4x>
<screen-size-5x>Alt+5</screen-size-5x>
<screen-size-6x>Alt+6</screen-size-6x>
<screen-size-7x>Alt+7</screen-size-7x>
<screen-size-8x>Alt+8</screen-size-8x>
<screen-size-9x>Alt+9</screen-size-9x>
<screen-size-max>Alt+S</screen-size-max>
<toggle-fps>Strg+F</toggle-fps>
<toggle-menu>Esc</toggle-menu>
<toggle-status-bar>Strg+B</toggle-status-bar>
<toggle-window-on-top>Strg+T</toggle-window-on-top>
</view>
</keys>
</input>
<language>
<file>D:\Emulator Games\NEStopia\language\english.nlg</file>
</language>
<launcher>
<search>
<directories />
<files>
<any-extension>no</any-extension>
<archive>yes</archive>
<duplicates>no</duplicates>
<fds>yes</fds>
<nes>yes</nes>
<nsf>yes</nsf>
<patch>yes</patch>
<unf>yes</unf>
<xml>yes</xml>
</files>
</search>
<view>
<colors>
<background>0x00FFFFFF</background>
<foreground>0x00000000</foreground>
</colors>
<columns>
<column>file</column>
<column>system</column>
<column>mapper</column>
<column>prg</column>
<column>chr</column>
<column>wram</column>
<column>vram</column>
<column>battery</column>
<column>dump</column>
</columns>
<show>
<grid-lines>yes</grid-lines>
<image-database-adjusted>yes</image-database-adjusted>
<on-top>no</on-top>
</show>
</view>
</launcher>
<machine>
<adapter>auto</adapter>
<auto-select-controllers>yes</auto-select-controllers>
<dip-switches-on-load>yes</dip-switches-on-load>
<no-sprite-limit>yes</no-sprite-limit>
<port-1>pad1</port-1>
<port-2>pad2</port-2>
<port-3>unconnected</port-3>
<port-4>unconnected</port-4>
<port-5>unconnected</port-5>
<region>auto</region>
</machine>
<netplay>
<fullscreen>no</fullscreen>
</netplay>
<nsf>
<play-in-background>yes</play-in-background>
</nsf>
<paths>
<cheats>
<auto-load>no</auto-load>
<auto-save>no</auto-save>
<directory>D:\Emulator Games\NEStopia\cheats\</directory>
</cheats>
<fds>
<bios>D:\Emulator Games\NEStopia\disksys.rom</bios>
<led>screen</led>
<save-method>patch</save-method>
</fds>
<images>
<directory>D:\Emulator Games\NEStopia\Games\</directory>
<recent-directory>D:\Emulator Games\NEStopia\Games\</recent-directory>
<use-recent-directory>no</use-recent-directory>
</images>
<patches>
<auto-apply>no</auto-apply>
<bypass-validation>no</bypass-validation>
<directory>D:\Emulator Games\NEStopia\patches\</directory>
</patches>
<recent>
<directories>
<directory>D:\Emulator Games\NEStopia\Games\</directory>
<locked>no</locked>
</directories>
<files>
<file>D:\Emulator Games\NEStopia\Games\Mega Man 2 (U).nes</file>
<locked>no</locked>
</files>
</recent>
<samples>
<directory>D:\Emulator Games\NEStopia\samples\</directory>
</samples>
<saves>
<directory>D:\Emulator Games\NEStopia\save\</directory>
<force-read-only>no</force-read-only>
</saves>
<screenshots>
<directory>D:\Emulator Games\NEStopia\screenshots\</directory>
<format>png</format>
</screenshots>
<states>
<auto-export>yes</auto-export>
<auto-import>yes</auto-import>
<directory>D:\Emulator Games\NEStopia\states\</directory>
<use-compression>yes</use-compression>
</states>
<tapes>
<file />
<use-image-name>yes</use-image-name>
</tapes>
</paths>
<preferences>
<appearance>
<icon-style>nes</icon-style>
<menu-desktop>
<custom-color>0x00EFCA18</custom-color>
<use-custom-color>no</use-custom-color>
</menu-desktop>
<menu-fullscreen>
<custom-color>0x00EFCA18</custom-color>
<use-custom-color>no</use-custom-color>
</menu-fullscreen>
</appearance>
<application>
<allow-multiple-instances>no</allow-multiple-instances>
<autostart>yes</autostart>
<confirm-exit>no</confirm-exit>
<confirm-reset>no</confirm-reset>
<exit-power-off>no</exit-power-off>
<favored-system>nes-ntsc</favored-system>
<favored-system-always-ask>no</favored-system-always-ask>
<run-background>no</run-background>
<start-fullscreen>no</start-fullscreen>
<suppress-warnings>no</suppress-warnings>
</application>
<save>
<cheats>yes</cheats>
<launcher>yes</launcher>
<logfile>yes</logfile>
<netplay-list>yes</netplay-list>
<settings>yes</settings>
<window-launcher>yes</window-launcher>
<window-main>yes</window-main>
</save>
</preferences>
<sound>
<adjust-pitch>no</adjust-pitch>
<buffers>1</buffers>
<device>44B322E5-BB9A-4774-BAF9-0B27B0DE8EF9</device>
<memory-pool>hardware</memory-pool>
<sample-bits>16</sample-bits>
<sample-rate>96000</sample-rate>
<speakers>stereo</speakers>
<volumes>
<apu>
<dpcm>85</dpcm>
<noise>85</noise>
<square-1>85</square-1>
<square-2>85</square-2>
<triangle>85</triangle>
</apu>
<external>
<fds>85</fds>
<mmc5>85</mmc5>
<n163>85</n163>
<s5b>85</s5b>
<vrc6>85</vrc6>
<vrc7>85</vrc7>
</external>
<master>35</master>
</volumes>
</sound>
<timing>
<auto-frame-skipping>
<enabled>no</enabled>
<max-frames>8</max-frames>
</auto-frame-skipping>
<performance>
<high-precision-timer>yes</high-precision-timer>
<triple-buffering>yes</triple-buffering>
<vsync>yes</vsync>
</performance>
<rewinder>
<enabled>no</enabled>
<sound>yes</sound>
<speed>60</speed>
<use-native-speed>yes</use-native-speed>
</rewinder>
<speed>
<alt-speed>120</alt-speed>
<alt-speed-sound>yes</alt-speed-sound>
<default-speed>60</default-speed>
<use-native-speed>yes</use-native-speed>
</speed>
</timing>
<video>
<auto-display-frequency>yes</auto-display-frequency>
<colors>
<brightness>100</brightness>
<contrast>100</contrast>
<hue>0</hue>
<saturation>100</saturation>
</colors>
<decoder>
<by>
<angle>15</angle>
<gain>1.015</gain>
</by>
<gy>
<angle>251</angle>
<gain>0.351</gain>
</gy>
<ry>
<angle>105</angle>
<gain>0.570</gain>
</ry>
<yellow-boost>no</yellow-boost>
</decoder>
<device>D7B71E3E-46A0-11CF-6355-45261FC2C535</device>
<filters>
<2xsai>
<bilinear>no</bilinear>
</2xsai>
<hqx>
<bilinear>no</bilinear>
<scale>auto</scale>
</hqx>
<ntsc>
<artifacts>100</artifacts>
<auto-tuning>yes</auto-tuning>
<bilinear>no</bilinear>
<colorbleed>100</colorbleed>
<field-merging>auto</field-merging>
<fringing>100</fringing>
<resolution>100</resolution>
<scanlines>0</scanlines>
<sharpness>100</sharpness>
<tv-aspect>yes</tv-aspect>
</ntsc>
<scalex>
<bilinear>no</bilinear>
<scale>auto</scale>
</scalex>
<standard>
<bilinear>no</bilinear>
<scanlines>0</scanlines>
</standard>
<type>2xsai</type>
</filters>
<fullscreen>
<bpp>32</bpp>
<height>1200</height>
<width>1920</width>
</fullscreen>
<memory-pool>video</memory-pool>
<palette>
<file />
<type>auto</type>
</palette>
<region>
<ntsc>
<bottom>231</bottom>
<left>0</left>
<right>255</right>
<top>8</top>
</ntsc>
<pal>
<bottom>239</bottom>
<left>0</left>
<right>255</right>
<top>1</top>
</pal>
</region>
<screen-curvature>10</screen-curvature>
<tv-aspect-ratio>no</tv-aspect-ratio>
</video>
<view>
<show>
<fps>no</fps>
<on-top>no</on-top>
<status-bar>yes</status-bar>
<window-menu>yes</window-menu>
</show>
<size>
<fullscreen>matched</fullscreen>
<window>4</window>
</size>
<window-position>
<bottom>1070</bottom>
<left>412</left>
<right>1448</right>
<top>71</top>
</window-position>
</view>
<window-size>
<x>0</x>
<y>0</y>
</window-size>
</configuration>

I just noticed that Nestopia's FPS counter most of the time shows me 60.5 FPS and very shortly from time to time jumps to exactly 60.0 and then back again.

Unfortunately, I know nothing of the high-resolution multimedia timer functions of Direct3D. The most I've needed until now was Windows' timer queue API (haven't dealt with the waitable timer nor QPC yet), which is surely awful for multimedia smile
Maybe I should just go bug ASUS to activate HPET in their BIOSes... It IS about time it's implemented everywhere.

If it's any help: NVIDIA's control applet registers the GTX 295's pixel clock at 154.1306 MHz when I force the driver to use 60.001 Hz. It's 154.1280 MHz when set exactly to 60.000 Hz. Like I said, changing around the refresh rate does nothing (not even when set to exactly 59.94 Hz, which is NTSC officially).

What hardware timer does Nestopia call? The performance counter via QPC, right (judging by the log)? I'd really like to help, but as you can see, my knowledge is limited smile
I understand that newer CPUs' speedstepping messes up the counters (laptops like to do this), but I've got Windows' power profile set to "high performance" and NVIDIA's graphics card equivalent to the same, so speedstepping shouldn't come into this, CPU or GPU. I'll try disabling it in the BIOS anyway. Anything else you might like me try? I'm open for suggestions smile

It's just funny that FCEUX (and Nintendulator), for instance, works flawlessly. It too uses a high-precision timing thread in order to be TAS-safe. Plus: Nestopia works fine on XP. Though I've yet to try buzbard's suggestion of using the XP virtual mode, Win7's compatibility option does nothing. I'm puzzled.
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/11/10 12:33 PM
Okay, it was a long shot, but yeah, disabling speedstepping and C1E in the BIOS didn't work.

I should also mention that though Nestopia appeared to work fine on XP, I also used a different PC altogether then.

Still puzzled, though smile
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/11/10 05:16 PM
Thank you for the detailed info, gummybear. I will continue to look into this as I have time to. My first priority is to see if I can reproduce this on my end, and that means I need to see what all might be different between your setup and mine. This is where the Nestopia.xml and Nestopia.log files will be very helpful.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/12/10 02:44 AM
Originally Posted By gummybear
Timer: performance counter present (3525351 hz)

This line from your log indicates that you DO have an HPET enabled and accessible to Windows and Nestopia. For comparison, here's the output from my Nestopia.log:

Quote:
Timer: performance counter present (3125029 hz)

As you can see, your HPET actually runs at a slightly faster frequency than even mine does, so that clearly isn't the problem.

Originally Posted By gummybear
Direct3D: entering 1920x1200x32 60hz full-screen mode

Any particular reason you are running Nestopia in such an incredibly high resolution mode and color depth? It's completely unnecessary and just makes your PC work harder. The original NEs color palette and resolution can easily fit within 16-bit color and 1024x768 resolution. I typically just run mine at 1024x768x16 -- that's plenty enough resolution to display the old NES graphics and even still take advantage of nice filters such as Hqx. You might see if dropping to a lower resolution mode fixes your issue.

Originally Posted By gummybear
<sound>
<adjust-pitch>no</adjust-pitch>
<buffers>1</buffers>
<device>44B322E5-BB9A-4774-BAF9-0B27B0DE8EF9</device>
<memory-pool>hardware</memory-pool>
<sample-bits>16</sample-bits>
<sample-rate>96000</sample-rate>
<speakers>stereo</speakers>
</sound>

Why in the world do you have your audio "sample-rate" set to 96000Hz? That's awfully high, and again completely unnecessary. The human ear can't even distinguish frequencies over 48000Hz anyway. If you right-click the speaker icon in Windows 7 and choose "Playback devices", then right-click on the same playback device you've chosen in Nestopia and choose "Properties", and then go to the "Advanced" tab, what bit-depth and sample rate is it configured for? In general, it's a bad idea to configure a program to use a different sample rate for output than the sample rate of your output device as configured in Windows. If the sample rates do not match, then the Windows audio stack has to do on-the-fly sample-rate conversion, which can result in all sorts of audio artifacting. Try setting both Nestopia and your audio device to 44100Hz and see if that fixes your issue.

Originally Posted By gummybear
<timing>
<auto-frame-skipping>
<enabled>no</enabled>
<max-frames>8</max-frames>
</auto-frame-skipping>
<performance>
<high-precision-timer>yes</high-precision-timer>
<triple-buffering>yes</triple-buffering>
<vsync>yes</vsync>
</performance>
</timing>

When you have both "synchronize to refresh rate" and "vsync" enabled, and you are running in a full-screen mode that matches the ROM's frame rate, Nestopia doesn't even need to use a hardware timer explicitly; it just relies on the fact that Direct3D's "vsync" implementation uses a multimedia timer under the hood to implement vertical scan synchronization. So the hardware timer can be ruled out here as the cause of the problem.

Originally Posted By gummybear
I just noticed that Nestopia's FPS counter most of the time shows me 60.5 FPS and very shortly from time to time jumps to exactly 60.0 and then back again.

Yep, mine does that too. The FPS calculation and display code is actually pretty badly-written and inaccurate. I'm actually working on improving it for my next unofficial release. Regardless, it has no relevance to the sound glitching problem.

Originally Posted By gummybear
Maybe I should just go bug ASUS to activate HPET in their BIOSes... It IS about time it's implemented everywhere.

As your Nestopia.log file shows, you have one, and it is enabled. So you're good there.

Originally Posted By gummybear
If it's any help: NVIDIA's control applet registers the GTX 295's pixel clock at 154.1306 MHz when I force the driver to use 60.001 Hz. It's 154.1280 MHz when set exactly to 60.000 Hz. Like I said, changing around the refresh rate does nothing (not even when set to exactly 59.94 Hz, which is NTSC officially).

Why are you forcing your NVIDIA driver to use 60.001Hz? It's possible this could be the cause of your glitching, but I would have to add more analysis and logging output and give you a private build to run to get a better idea of what is going on in your case surrounding the refresh rates.

Originally Posted By gummybear
What hardware timer does Nestopia call? The performance counter via QPC, right (judging by the log)?

That would be correct only if you were NOT using "synchronize to refresh rate" AND "vsync" AND running in a full-screen 60Hz mode. Some multi-core CPUs are buggy in that different cores can report different counter values, so MSDN recommends always forcing the thread onto CPU 0 before calling QPF/QPC, which I noticed Nestopia doesn't bother to do. But again, your configuration isn't even causing Nestopia to use the timer, so that shouldn't be the issue here.

Originally Posted By gummybear
Nestopia works fine on XP.

It works fine on Windows 7 too, just not for you. By saying "Nestopia works fine on XP" you are implying that the OS is the cause of the problem, but it clearly isn't since it works fine for me. There's something deeper going on here that we just haven't pinned down yet, but in the meantime it doesn't help to make generalized sweeping statements like this one. All it does is suggest things that aren't true.

I know you've done a lot to try to help me diagnose this already, but I'm wondering if you could do one more thing for me -- can you e-mail me (or post a download link to) an MP3 recording of the sound glitching? Since I'm unable to repro it on any of my machines, I don't even know what it sounds like or the severity of what we're dealing with here.
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/12/10 01:15 PM
First of all, thank you again for taking the time!

Thought so about the FPS counter. Thanks for confirming that.

Good to know the log indicates I do have an HPET. I know Windows Vista was the first Windows consumer OS to support it, so its presence in the system devices was no surprise. "No drivers are installed for this device" therefore does not mean its absence, does it? Various forums suggested otherwise, so please excuse my misconception. Since you're a Windows developer, I clearly trust your knowledge more smile
What's sad is that even relying on HPET and not D3D's multimedia timer does not fix this. Please realize that I've, by now, tried every type of configuration I could think of. I'm not stuck in the above.

I know about the resolution and I know about the limitations of the human ear. Pay no mind to either values, as they do not appear to matter in the slightest concerning this problem (well, here they don't). Please think back to my previous posts: I've already tried numerous resolutions (16 and 32 bit) and numerous sampling rates; every option present. I stated twice that I aligned them with my playback device's set sampling rate, so Windows would not have to do software resampling (which I, too, know about wink ). I was merely trying different things out. I'm sorry for the confusion.

As for the refresh rate, please look here: http://support.microsoft.com/kb/2006076/
Then here: http://www.sevenforums.com/tutorials/33641-screen-refresh-rate-custom-nvidia-brand.html
As I stated before, this has been by design since Vista and is a known "problem". It is more accurate than what XP was doing (rounding up), but it causes issues with VSync in quite a number of even recent games (Modern Warfare, for one), because they're apparently badly coded: Their VSync expectation of 60 Hz seems to be hardcoded into them, so supplying any other frequency results in stuttering. Setting it to 60.001 Hz in the NV control applet fixes that. My monitor is an HP LP2475w. I've got its 2.0.0.0 drivers installed via Windows Update.
Yet again, as I mentioned before, supplying other frequencies to Nestopia for VSyncing does nothing to fix its audio stuttering. I apologize if I seem patronizing. As a Windows dev, you might know all this already.

Edit: One more thing: Forcing the maximum pre-rendered frames option up or down in the NV driver applet does nothing to fix this as well and neither does forcing Nestopia to use only a single GPU.

I qualified my XP statement (I used another computer altogether), so I believe I reigned in my initial generalization. Please take it as just another observation. That was an old machine: Athlon 64 3500+, MSI K8N Neo4 Platinum, Geforce 7800 GT, 1GB DDR2 RAM. I used XP SP3. My Nestopia configuration was the same, though with a lower sampling rate (44100 Hz) and my old monitor's native resolution (1280×1024). I've tried those in Win7 on this new machine and they don't fix it.
Please bear with me, I'm just supplying you with information here smile

I'll e-mail you an MP3 right away.

Edit: And I did, but for any other people having this issue and wanting to confirm that it's indeed theirs as well, here's a download link: http://www.sendspace.com/file/wlqyqp
It was done with "synchronize to refresh rate" set, VSync and triple buffering on, sound latency set to "1" and in window mode. Fullscreen is the same. My monitor refresh rate was forced to 60.001 Hz. Changing that back to default or other values near or precisely 60 Hz has no effect here. "Use high precision timer" is set as well, but disabling it had no effect, too. My recording software is Audacity.
If anyone else wants to chime in, please feel welcome. Maybe you can provide c0d3h4x0r with some more info he might need smile
Posted By: buzbard Re: Nestopia 1.41 unofficial release - 04/12/10 11:07 PM
Originally Posted By c0d3h4x0r
Originally Posted By gummybear
Direct3D: entering 1920x1200x32 60hz full-screen mode

Any particular reason you are running Nestopia in such an incredibly high resolution mode and color depth? It's completely unnecessary and just makes your PC work harder. The original NEs color palette and resolution can easily fit within 16-bit color and 1024x768 resolution. I typically just run mine at 1024x768x16 -- that's plenty enough resolution to display the old NES graphics and even still take advantage of nice filters such as Hqx. You might see if dropping to a lower resolution mode fixes your issue.


Just curious, how do lower the resolution of Nestopia? My system resolution is 1680x1050x32 60hz and in Nestopia in the video options I have 1024x768x16, but when I run Nestopia and then check the Nestopia.log file I see this:

Direct3D: entering 1680x1050x32 60hz window mode


Also, I was wondering if anyone had tried the XP mode for Win7 that I suggested above, I don't have Win7 so was just curious to see if it actually works.
Posted By: R. Belmont Re: Nestopia 1.41 unofficial release - 04/13/10 03:42 AM
XP mode in Win 7 is Virtual PC and has all the limitations for games/emulators that implies - no D3D acceleration, etc, etc.

(VMWare 7.1 beta has fantastic D3D9 and OGL 2.1 acceleration in the guest though so I'd be surprised if MS didn't try to catch up).
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/14/10 06:00 AM
Originally Posted By buzbard
Direct3D: entering 1680x1050x32 60hz window mode

That line indicates that you are not running Nestopia in full-screen mode. The resolution you pick in the video settings dialog only applies to fullscreen mode. You have to switch Nestopia to fullscreen mode by using View->Fullscreen from Nestopia's menu or by pressing ALT+ENTER.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 04/14/10 06:08 AM
Originally Posted By R. Belmont
XP mode in Win 7 is Virtual PC and has all the limitations for games/emulators that implies - no D3D acceleration, etc, etc.


Correct.

Originally Posted By R. Belmont
(VMWare 7.1 beta has fantastic D3D9 and OGL 2.1 acceleration in the guest though so I'd be surprised if MS didn't try to catch up).


When it comes to virtualization, the money is overwhelmingly in the server scenarios, where D3D and OGL support are irrelevant. But hey, you never know.
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/19/10 06:23 PM
Alright, guys, I think me and c0d3h4x0r have finally gotten to the bottom of this. It turned out to be driver issue. The newest Creative drivers for my soundcard and the newest SoundMAX drivers for my onboard chip both exhibited this issue. As soon as I uninstalled either one I had installed for testing and used the standard Windows HDAD drivers, this issue disappeared completely on two of my desktop machines here.
Yes, it appears only Realtek and Microsoft have gotten it right so far--Of course, I'd also like to hear that from CMedia, IDT, and Sigmatel chip users. Funny thing is, I immediately also noticed more FPS (beyond the usual margin of error) in both recent games and demanding emulators such as Dolphin and PCSX2. So the solution for now is to use Windows' standard HDAD drivers and go bug SoundMAX and especially Creative to fix their buggy mess. It's sad to not be able to use your manufacturer's drivers, but hey, if there are alternatives available...

By the way, FireBrandX managed to fix his problems via upping the 2D clocks of his ATI 5770 HD card's CCC profile. He was actually suffering from a known problem which can also cause stuttering issues watching 1080p movies via DXVA.
Posted By: han7solo Re: Nestopia 1.41 unofficial release - 04/21/10 02:09 AM
hi all,

i'm having a small issue with nestopia that i'm hoping i can get resolved.

i recently installed "soft 15" so that i can get my 800x600 arcade monitor to display 1024x768. i've gone thru al my emu's and with a bit of tweaking, i've gotten them all to display correctly.

nestopia tho pans vertically. meaning, to see the top/bottom of the screen, i have to use the mouse to scroll up/down. i have the monitor mirrored to my projector and it is displaying correctly (the projector handles 1024x768 natively).

i was having this same panning issue within windows and a few other emus but after forcing the refresh rate, they became fine.

so, my long winded question, is there a way to select a ustom refresh rate within nestopia or force nestopia to use the desktop resolution/refresh rate?

fyi, my refresh rate is set at 84.

thanks all for any input
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 04/24/10 11:26 AM
han7solo: Does unchecking "auto" under "monitor frequency" in the video options fix the problem?
Posted By: han7solo Re: Nestopia 1.41 unofficial release - 04/24/10 07:38 PM
checked, unchecked, no difference. i also checked/unchecked the vsynch option under timing, still the same.

i'm at a loss, those are the exact kind of options in other emu's that fixed my issue...
Posted By: han7solo Re: Nestopia 1.41 unofficial release - 04/26/10 09:16 PM
couldn't get it to behave with my set up so unfortunately, i had to move over to fceux

EDIT! i take that back, i found a setting in my ati catalyst control center that forces apps that aren't playing nice to run at my specified refresh rate.
Posted By: LordKarnov42 Re: Nestopia 1.41 unofficial release - 05/09/10 02:29 AM
I'm still getting the input lag when running in fullscreen.

PC Specs:
Windows 7 x64
3.0GHz Intel Core2Duo
4GB RAM
nVidia GeForce 9800GT
Monitor 1:1920x1080 [This it the one I am running NESTopia on]
Monitor 2:1440x900

NESTopia Settings:
Video:
Device: NVIDIA GeForce 9800GT
Mode: 1024x768
Filter: Standart [No Scanlines, no Bilinear]
16 bit
Memory Pool: Video
Monitor Frequency: Auto

Timing:
Synchronize to Refresh Rate
VSync
Use high-precision timer
Enable triple buffering
Default speed

I think that's comprehensive enough. If not let me know and I'll post the log/xml.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 05/09/10 04:36 AM
Please either post your log file or send it to me in a private mail.
Posted By: LordKarnov42 Re: Nestopia 1.41 unofficial release - 05/09/10 06:27 PM
nestopia.xml

nestopia.log

EDIT: Those files are taken after I ran it with fullscreen set to 1920x1080 to see if maybe the lag had something to do with downscaling the resolution to 1024x768 on the LCD monitor. It didn't.
Posted By: BootGod Re: Nestopia 1.41 unofficial release - 05/22/10 07:40 PM
Thank you very much gummybear and c0d3h4x0r! I had been having the exact same problem gummybear described for a while now and spent countless hours trying to determine the source. I knew it wasn't specifically a problem with Win7 x64, because Nestopia had been working great for me. I noticed the problem after installing a new video card a while back, going from an nVidia to an ATI one. So I was under the misguided belief that it was a video driver issue and the sound glitching was some side effect of it being unable to sync correctly.

When I think back, I do believe I updated Creative drivers sometime around exchanging video cards. I guess I'm not surprised it's a problem with their drivers, they are notoriously shitty. Only reason I still use their cards is because all others seem to have problems with multichannel sound in games.

Anyways, what I've done is left my Creative X-Fi as the default system device and reinstalled my HT Omega Claro+ (C-Media based) and have Nestopia use that card. Then I hooked up the line out of the Claro to the line in of the X-Fi so I get the best of both worlds.

BTW, how did you determine it was a sound driver issue? How is Nestopia using it in such a way that causes problems but no other emulators (or anything else) have this problem?
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 05/27/10 10:45 AM
It was really very simple in the end: Uninstalling Creative's bad drivers and using Windows' default high definition audio device driver fixed the stuttering completely. I could reproduce this every time I tried.

As for why only Nestopia seems to suffer from this, I'm not really sure and c0d3h4x0r hasn't ventured any guess so far. I thought it may be the DSBCAPS_GETCURRENTPOSITION2 flag in NstDirectSound.cpp, as I've read that the GetCurrentPosition implementation in Creative's shitty drivers messes up the hardware buffers, but I'm really very much out of my league here and this is something c0d3h4x0r would have to investigate. He doesn't seem to have a Creative card and couldn't reproduce the problem in the first place, so I'm not sure if he'd be successful.

By the way, FirebrandX also demonstrated that due to ATI's cards being underclocked by their drivers too much in 2D mode, this can also manifest as unstable VSYNCing and thus be followed by sound stuttering. If you've already edited your CCC profile to rectify this and the Creative card was still the culprit, well, that only adds to the evidence against Creative's drivers.

Their drivers are a buggy, bloated mess which barely works adequately, and yet over there no one seems to care. I understand they've been going through rough financial times (they're slowly becoming obsolete thanks to integrated chips) and might not have had as much to spend on driver development, but the state they've left them in is in disarray. Their forums are filled with complaints regarding that.
Posted By: BootGod Re: Nestopia 1.41 unofficial release - 05/27/10 09:11 PM
Originally Posted By gummybear

By the way, FirebrandX also demonstrated that due to ATI's cards being underclocked by their drivers too much in 2D mode, this can also manifest as unstable VSYNCing and thus be followed by sound stuttering. If you've already edited your CCC profile to rectify this and the Creative card was still the culprit, well, that only adds to the evidence against Creative's drivers.


Yeah I saw that post a while back in my quest to solve this problem, and while it didn't help me with nestopia, it did fix some other problems by bumping the clock rate.

Originally Posted By gummybear

Their drivers are a buggy, bloated mess which barely works adequately, and yet over there no one seems to care.


Yeah if only I could find a non-Creative card that works as well in 3D games (new and old), I'd ditch this one in a heartbeat.
Posted By: x_loto Re: Nestopia 1.41 unofficial release - 06/04/10 07:59 AM
I've been having the same problems with skipping audio on my system, but I'm not very knowledgeable about all the technical stuff and I don't want to break my sound. :-/ I'm seeing 18 sound drivers, and I'm not sure how to tell which (if any) is causing a problem for me. I see several by Microsoft, IDT, and SRS Labs. Apparently Microsoft is good, but are there any known problems with the others? I can give more details if you need, but I'm not sure what you'd need to know.... v_v
Posted By: x_loto Re: Nestopia 1.41 unofficial release - 07/01/10 03:34 AM
*crickets chirping*

...Anybody? :-/
Posted By: BuddMan Re: Nestopia 1.41 unofficial release - 07/08/10 02:48 AM
I still have the input lag when vsync is enabled. It's a little bit better, but I still can notice it in Mike Tyson's Punch Out - it's enough to affect the gameplay. My specs:

Windows 7 x64
ATI 5850 with latest CATs installed
Core i7
4GB of RAM
Resolution at 1280x720 @ 60Hz

Timing:
Synchronize to Refresh Rate
VSync
Use high-precision timer
Enable triple buffering
Default speed

I'm using a Logitech Rumblepad 2 if that makes any difference. Disabling vsync resolves the input lag, but I get screen tearing of course.
Posted By: Clutz450 Re: Nestopia 1.41 unofficial release - 08/01/10 08:58 AM
First, I want to say thank you to c0d3h4x0r for updating this emulator. I downloaded the emulator from your link, unzipped it, didn't touch any of the settings, and opened up Super Mario Bros in full screen. Unfortunately I still seem to have the lag on my controller when vsync is enabled. And if I disable vsync I get the screen tearing. Any advice?
Woah!!!

This is great news!

I am surprised that somebody took it upon themselves to continue where the original Author left off.

It's sad that the original Author has abandoned his creation & if he could only be contacted I'd really want him to answer a few questions that has bugged me after he released version 1.38 of the emulator.

First off, why did he removed the emulator's support, or rather the emulator's ability to recognize & emulate games that use a few Mappers, mostly once used by Unlicensed &/or prototype games such a Free Fall? I know a lot of these games that uses the mapper boards he removed support from his emulator are bad games, but still they are a part of the rich history that the NES/FamiCom had. Instead of removing mappers, shouldn't he had added more, so that the emulator could be "perfect"?

My next question is, why did he make his emulator so "perfect" that it will not recognize & run ROMs that are hard patched with translations &/or ROM Hacks? Sure to compensate he did made it so that soft patching will work, but a lot of ROM Hackers are avoiding Nestopia like the plague because of this feature.

Because of those two improvements, I've stuck with version 1.37 of the emulator & I'd really would have loved it if the 2xSAI filter was already present in that version LOL!

To be honest, I absolutely love this emulator especially since it's currently the one I use that is capable of emulating the FamiCom Disk System perfectly smile A lot of people say that FCEUX beats Nestopia, but I could never get that damn emulator to run FDS Games, even though both emulators use the "disksys.rom" ROM Image of the FDS BIOS.

I wish you sir would consider re-adding those mappers the original Author took out or even add a few more, so the emulator can play a lot more stuff. And I also hope you can do something about that "modified ROM identified, I will not run/load this" issue as well smile
Posted By: Just Desserts Re: Nestopia 1.41 unofficial release - 08/12/10 11:57 AM
Originally Posted By CahosRahneVeloza
My next question is, why did he make his emulator so "perfect" that it will not recognize & run ROMs that are hard patched with translations &/or ROM Hacks?


This is just a wild guess, but I expect it's because it's senseless to shit up an internal DB with such magnum opuses as "Penis Mario" and such.

Originally Posted By CahosRahneVeloza
A lot of people say that FCEUX beats Nestopia


Not to be too snarky, since you're not agreeing with those people, but a lot of people say pretty stupid things, that being one of them. I'd be curious to hear one of those people give details as to the universe they live in, because I personally would like to know in what universe FCEUX "beats" Nestopia. Certainly not one where accuracy is king, because in that regard FCEUX is shit.
Posted By: R. Belmont Re: Nestopia 1.41 unofficial release - 08/12/10 02:35 PM
AFAIK NST will load things that aren't in the database according to standard iNES rules, but of course there's no guarantee it gets things right in the many ambiguous cases.

As far as hacks/patches, I think soft patching is preferable - it uses less disk space, and it keeps the total number of ROMs you have more manageable.
Posted By: AWJ Re: Nestopia 1.41 unofficial release - 08/12/10 05:19 PM
The translations he's talking about are of games with "bad" iNES mappers--cases where two incompatible boards got lumped under the same mapper number, so that you need either an internal DB or some kind of heuristic identification (ugh) to emulate the iNES-format ROM.
Originally Posted By Just Desserts
Originally Posted By CahosRahneVeloza
My next question is, why did he make his emulator so "perfect" that it will not recognize & run ROMs that are hard patched with translations &/or ROM Hacks?


This is just a wild guess, but I expect it's because it's senseless to shit up an internal DB with such magnum opuses as "Penis Mario" and such.

Originally Posted By CahosRahneVeloza
A lot of people say that FCEUX beats Nestopia


Not to be too snarky, since you're not agreeing with those people, but a lot of people say pretty stupid things, that being one of them. I'd be curious to hear one of those people give details as to the universe they live in, because I personally would like to know in what universe FCEUX "beats" Nestopia. Certainly not one where accuracy is king, because in that regard FCEUX is shit.


As far as I can tell, ROM Hackers love FCEUX because of the fact that it is not such a bitch with Fan Translation & Hack patches & they are raving about the emulator's debugger that as the claim is way more friendlier than Nestopia's.

But I couldn't agree with you more that FCEUX IS NOT better than Nestopia.

Originally Posted By AWJ
The translations he's talking about are of games with "bad" iNES mappers--cases where two incompatible boards got lumped under the same mapper number, so that you need either an internal DB or some kind of heuristic identification (ugh) to emulate the iNES-format ROM.


Also, most NES ROM Fan Translations that were made prior to 2004 are hosted on ROMs hosting sites pre-patched onto the target ROM so you essentially will be getting a modified ROM off hand & if Nestopia doesn't like these off hand then it kinda is of a bother.
Posted By: koitsu Re: Nestopia 1.41 unofficial release - 08/29/10 07:15 AM
c0d3h4x0r, any chance of fixing the below bug in your unofficial release? This exists in 1.40 official too. On Windows XP SP3:

- Use windowed mode
- Options -> Timing -> Synchronize to refresh rate (enable)
- Options -> Timing -> Vsync (enable)
- Options -> Preferences -> Run in background (enable)
- Cover the entire Nestopia drawing surface with another window (so there's absolutely no DirectX content being shown)

The emulator then runs as fast as possible and CPU usage hits 100% for that core (e.g. 25% on a 4-core system).

Disabling Vsync fixes this problem. Shouldn't be too hard to fix.
Posted By: nyijedi Re: Nestopia 1.41 unofficial release - 08/30/10 12:53 AM
Thanks for taking the time to update nestopia. Unfortunately, like a few previous posters, I am still suffering from input lag when vsync is enabled, and disabling vsync causes annoying tearing. This is so frustrating.

EDIT: Also, FWIW, if I change my TV's refresh rate from 60 Hz to 59 Hz, and then set nestopia to 59 Hz as well, the input lag disappears when I enable vsync, but the screen tearing still occurs. I'm not sure if this sheds light on the situation at all. This vsync/input lag problem has been driving me crazy for months.
Posted By: xam925 Re: Nestopia 1.41 unofficial release - 09/01/10 12:22 AM
i wonder,why with screen set @75hz the emu,when it switch the resolution in full screen @60,dosen't lag :?

maybe the emulator force the 60hz,and so try to sub timing at all the inputs? (if you force the timing of the emulator on 75hx,everything speed up O_o)

hope to help,good luck,we're all with you ^_^
Posted By: BuddMan Re: Nestopia 1.41 unofficial release - 09/07/10 02:46 PM
For those still suffering from the input lag issue - give VirtuaNES a try. I don't see any issue with vsync and input lag with it and works great. I'm using that while we wait for a true fix for the input lag issue.
Posted By: xam925 Re: Nestopia 1.41 unofficial release - 09/08/10 11:40 AM
thanks for the hint,but virtuanes didn't have so many option like nestopia,ex (datach system,if you wanna "resolve" the input lag issue,just set,for now,your refresh screet at 75hz ^_^

hope someone resolve the bug,anyway =)
Posted By: nyijedi Re: Nestopia 1.41 unofficial release - 09/09/10 05:18 PM
Unfortunately I use nestopia on my HDTV, which doesn't go up to 75 Hz. Are there any other workarounds that anyone knows about?
Posted By: twotone8 Re: Nestopia 1.41 unofficial release - 09/13/10 07:20 PM
registered to thank original poster. it's so refreshing to find that someone else out there is bothered by input lag enough to actually do something about it.

unfortunately, i'm still experiencing a noticeable amount of input lag with vsync on in your release of nestopia, but at least you're on the right track.

i don't understand why vsync and input lag have to be related in so many different programs. it seems like very few people in the gaming industry have any interest whatsoever in rectifying the problem.
Posted By: Sessh Re: Nestopia 1.41 unofficial release - 09/19/10 07:46 PM
I just wanted to report a bug in movie recording. I am using Nestopia 1.40 and haven't changed any settings or anything.

I have used the movie recording feature successfully on several games, but I have found one it refuses to work with. That game is Metal Gear. I tried it with Metal Gear (E) (!) and now with Metal Gear (U) and the result is the same.

If I record a movie, the playback is always completely screwed up (ie: character doing things I didn't do, game pausing and un-pausing and other senseless actions). If I try to export to AVI, it gives me a "File is Corrupt!" error followed by an AVI recording error and no file is saved. I immediately tried it with a random game (Baseball Simulator 1000) and it worked fine, but another try with Metal Gear (both versions) do the exact same thing.

Should be easy enough to reproduce. Just record the first 10 seconds of gameplay and see for yourself. This is the only game I have found to have this problem.
Posted By: Coolie Re: Nestopia 1.41 unofficial release - 10/02/10 06:58 AM
Why not set the "TV Aspect" to be 4:3 ?
I hate 290x240 !
Posted By: regha Re: Nestopia 1.41 unofficial release - 11/18/10 09:50 AM
In case anyone still has problems with Nestopia and their X-Fi card:
I solved the chopped-up sound by using ALchemy (Creative's DSound->OpenAL wrapper).
I set buffers to 4, duration to 1, and with a Nestopia sound latency setting of 1, I don't get any crackling or chopped-up sound anymore.

Seems like the wrapped dsound works better than native dsound, which is kinda hilarious.
Posted By: gummybear Re: Nestopia 1.41 unofficial release - 11/20/10 11:25 PM
Well, I'll be damned: Using ALchemy actually works and fixed the choppy sound here completely, too. Great find, regha! Finally, I can again enjoy the best NES emulator as it was meant to be smile
Posted By: sartris Re: Nestopia 1.41 unofficial release - 11/21/10 03:21 AM
Sorry if this has been covered already

I'm trying to use 1.41 on a Dell Inspiron 5100 laptop running Win XP SP 3. When I put Nestopia in full screen mode, I lose the ability to use any input devices. The program continues to run, but I can't actually do anything. I don't have this problem with Nestopia 1.40 official on the same screen, strangely enough. I also have no issues with my desktop running 1.41 in full screen (Intel Quad Core, Win 7 64 bit)

I tried copying my 1.41 config to my 1.40 directory and everything works fine so it's not an issue there.

Any help would be greatly appreciated
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 12/06/10 11:08 PM
Hello,

Having the same choppy/skippy sound issue as well with Windows 7 64-bit and Nestopied v .139-.141. I have a Sound Blaster Audigy SE sound card, NVidia Evga 8800 GTS OC @ 640MB video card, Gigabyte GA-MA790GP-UD4H Motherboard, 4GB Corsair Dominator RAM @ 1066mhz 5-5-5-15, and AMD Phenom II X4 940 Deneb 3.0Ghz.

In Nestopia my settings are:
Device: NVIDIA GeForce...
Mode: 1024x768
Filter: Standard (rest default)

Sound:
Device: Primary Sound Driver
Output 44100 1 bit Mono
Latency - 1
Rest default

Timing:
Synchronize to refresh rate
Use hih-preceisiojn timer enable
Enable triple buffering enabled
Vsync enabled
Rest default

Anyone have any suggestions? Nestopia is the most compatible and best functioning emulator, I only have an issue with sound and a bit of input lag...I would greatly appreciate any help!

Thanks

Mike

I should mention I've tried different drivers for my Audigy SE sound card (both from Creative site and from Windows Update) to no avail. Not sure it's a driver issue at this point. Currently I have driver version 5.12.1.2016 installed...I've also tried with version .2020 with the same results).
Posted By: echoes Re: Nestopia 1.41 unofficial release - 12/07/10 06:58 PM
just a shot in the dark here mbard20, but have you tried adjusting the latency?
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 12/08/10 12:47 AM
Hello,

Thank you for responding. Unfortunately I have tried adjusting the latency (both up and down) and it does not seem to make a difference. This emulator would be absolutely perfect if I could get this issue resolved in the input lag wasn't present smile

I used Nestopia build 140 on the same box when running XP 32-bit and didn't have any issues with sound or input lag...very strange.

Mike
Posted By: Tafoid Re: Nestopia 1.41 unofficial release - 12/08/10 12:57 AM
Try setting the processor affinity for the application to use only 1 core and see if that helps. This is, assuming, you are using a 64-bit 2 or more core processor. I've had it help other emulators using older compile tools - so you might have some luck with it.




Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 12/08/10 12:52 PM
Hi Tafoid,

Thanks very much for the suggestion. I will give that a try tonight when I get home.

Mike
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 12/09/10 02:09 AM
Tried setting affinity to use only one processor (I have a quad-core processor and tried using 2 different ones) and unfortunately I have the same results. I read that using "ALchemy" seemed to work...I do have this installed but cannot figure out how to force the emu to use these settings. Does anyone have any input on this? I may try to disable my SB Audigy sound card and see if I can find Win7 64-bit drivers for my onboard sound card if the problem goes away...
Posted By: koitsu Re: Nestopia 1.41 unofficial release - 01/14/11 06:35 AM
Regarding sound latency: Things to try, one at a time:

* Options->Sound -- Adjust the Latency slider (increase it or decrease it one notch). It sounds like you've already tried this though.
* Options->Video -- Turn off High Precision Timer
* Options->Video -- Turn off Triple Buffering
* Options->Video -- Disable Vsync

You may need to try all the combinations of these to find something that works. I'm familiar with XP, not Windows 7. I also use an SB Audigy series card in my system w/out any audio skipping (Latency slider is set to 2), but again, I use XP. Windows 7's audio layer is *significantly* different, and this isn't just tech forum l33tg4m3rd00d nonsense I'm stating.
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 01/27/11 10:15 PM
Hi koitsu,

Thanks for the suggestions. I have played with triple buffering and vsync with no luck (I actually need vsync bc I have an lcd monitor I I get pretty bad screen tearing w/out it). However not sure I've tried messing with the timer option. I will def play with this. I also have not had a chance to test my onboard card yet so I have a few things to play with. With the same hardware on winxp 32bit I had 0 problems, which is why this is so frustrating! Thanks again.

Mike
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 01/29/11 07:20 PM
Hi,

The choppy sound issue was my damn sound card as suspected (I finally had a chance to test with my onboard one). Sound is perfect. However, input lag is still very evident in v139+ with v-sync on (only). Found v109 in my archives and I have no issues with sound or input lag (in case anyone still has these issues). Yay!

Mike
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/08/11 06:03 PM
Tried everything mentioned in this thread, and I still get the odd sound desync (randomly occurs, not sure what's causing it). Is there a known fix for this yet? I'd rather not go back to VirtuaNES because it has some pretty nasty input lag issues in some games, but the sound desync is REALLY killing it for me.

When it does happen, it takes some time before it really starts to become obvious, as it's slowly but surely de-syncing.

EDIT: Just saying, I'm not experiencing any "choppy" or "scratchy" sound problems, just the random desyncs.
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 02/14/11 11:32 PM
What are your system specs?
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/21/11 04:41 PM
Sorry for the late reply, but here are my specs:

Operating System: Windows Vista Home Premium

Card name: Intel(R) G45/G43 Express Chipset

Processor: Intel Pentium Dual-Core E5200 (2.50Ghz)

RAM: 4.00 GB

The emulator "runs" perfect, it's the audio I'm having issues with.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/21/11 05:46 PM
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.

Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/21/11 07:09 PM
Good to know, c0d3h4x0r! I'm looking forward to a new release! Take your time. smile
Posted By: R. Belmont Re: Nestopia 1.41 unofficial release - 02/21/11 08:25 PM
Originally Posted By c0d3h4x0r
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.


Wrong. Yes, DirectSound was rewritten in Vista, but the results are that in the normal case it's significantly more reliable and breaks up less.

There are tens of thousands of games, emulators, and audio editing/production programs which use DirectSound and show no audio drama on Vista/7 without the use of a separate thread. This includes MAME/MESS, FBA, Raine, ElSemi's Model 2 emulator, bsnes, pSX, and pretty much anything else you might have played.

Quote:
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.


Unless the system is too slow to maintain 100% frame rate, there is no problem. All the programs cited above show this principle quite nicely.

Quote:
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.


And in the process destroy the audio/video cycle sync that is the heart of NEStopia.

Quote:
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.


This might fix it by accident, but the real problem is simply that there is a bug in recent versions of NEStopia. This is proven by the fact that these sound problems don't exist in e.g. 1.08 on the same PCs that exhibit problems with 1.41.

That said, the part about "stop fiddling with NEStopia, you can't fix it" is true. Use an older version of NEStopia or some other emulator (MESS runs most NES games very nicely nowadays and it's on this same forum).
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/21/11 08:57 PM
Originally Posted By R. Belmont
Wrong. Yes, DirectSound was rewritten in Vista, but the results are that in the normal case it's significantly more reliable and breaks up less.

Not if you have a buggy audio driver, which has proven to be the cause for the majority of people who have hit this issue.

Originally Posted By R. Belmont
There are tens of thousands of games, emulators, and audio editing/production programs which use DirectSound and show no audio drama on Vista/7 without the use of a separate thread. This includes MAME/MESS, FBA, Raine, ElSemi's Model 2 emulator, bsnes, pSX, and pretty much anything else you might have played.

Have you examined the source code for ALL of those? This is quite a sweeping claim to make, especially coming from someone who has spent all of... what, 5 minutes?... looking into this problem.

I've looked at source code for many other emulators, and they mostly do it the way FCEUX does it (e.g. the way I've described).

Originally Posted By R. Belmont
Unless the system is too slow to maintain 100% frame rate, there is no problem.

Wrong. The issue here is the correctness of the DirectSound ring buffer playback implementation inside the audio driver. Some drivers (specifically a lot of Creative Labs' drivers) get it wrong, causing the lock/write calls to the buffer to stall and/or reporting incorrect information back to the application about the current state of the buffer. Both problems can cause audio skips regardless of how fast the rest of your system is.

Originally Posted By R. Belmont
And in the process destroy the audio/video cycle sync that is the heart of NEStopia.

Absolutely wrong. Creating a dedicated background thread that pulls audio data out of a software buffer and jams it into the DirectSound playback ring buffer in no way destroys audio/video sync. All it does is (1) eliminate buffer contention, and (2) guarantee that the DirectSound buffer never gets starved for data due to a momentary hiccup in the performance of the main emulation thread.

Originally Posted By R. Belmont
these sound problems don't exist in e.g. 1.08 on the same PCs that exhibit problems with 1.41

What proof do you have to back up this claim?
Posted By: R. Belmont Re: Nestopia 1.41 unofficial release - 02/21/11 09:09 PM
Quote:
Have you examined the source code for ALL of those? This is quite a sweeping claim to make, especially coming from someone who has spent all of... what, 5 minutes?... looking into this problem.


As it happens, yes. I've looked at the source code for pretty much every source-available emulator out there at one time or another, and fully-threaded audio is generally rare (except for ones still using MMIO/WaveOut where it's a really good idea).

Quote:
Some drivers (specifically a lot of Creative Labs' drivers) get it wrong, causing the lock/write calls to the buffer to stall and/or reporting incorrect information back to the application about the current state of the buffer. Both problems can cause audio skips regardless of how fast the rest of your system is.


Yes, I know. I programmed the audio for one of the early PC games to support the SB Live. Great hardware, the driver team should be shot.

But seriously, the reason DirectSound is done in software in Vista/7 is exactly to eliminate those problems. The software DSound doesn't misreport buffer positions or get the units wrong or the number of other things I've seen "in the wild" in driver implementations. I've never seen a problem with it - there may *be* one, but on balance it's miles ahead of the previous situation with IHV drivers.

Quote:
Creating a dedicated background thread that pulls audio data out of a software buffer and jams it into the DirectSound playback ring buffer in no way destroys audio/video sync. All it does is (1) eliminate buffer contention, and (2) guarantee that the DirectSound buffer never gets starved for data due to a momentary hiccup in the performance of the main emulation thread.


In the case where you don't mean running the entire APU on up on a separate thread, yes, that can work, although ideally you'd want the emulation running a frame or 2 ahead of the audio thread to ensure you always have buffer if a hiccup occurs.

Quote:
Originally Posted By R. Belmont
these sound problems don't exist in e.g. 1.08 on the same PCs that exhibit problems with 1.41

What proof do you have to back up this claim?


1) The complaints didn't start coming in until around 1.35ish, and 2) users having them have posted that rolling back to older versions did fix the issue.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/21/11 09:22 PM
Originally Posted By R. Belmont
I programmed the audio for one of the early PC games to support the SB Live. Great hardware, the driver team should be shot.

At least we agree on something :-)

Originally Posted By R. Belmont
But seriously, the reason DirectSound is done in software in Vista/7 is exactly to eliminate those problems. The software DSound doesn't misreport buffer positions or get the units wrong or the number of other things I've seen "in the wild" in driver implementations. I've never seen a problem with it - there may *be* one, but on balance it's miles ahead of the previous situation with IHV drivers.

Actually, the software DSound does misreport buffer positions or take an abnormally long time to return from the app Lock()ing the buffer, when using certain buggy audio drivers. I experienced it myself on the integrated audio on my previous motherboard, with Windows 7 amd64 RTM.

Originally Posted By R. Belmont
In the case where you don't mean running the entire APU on up on a separate thread, yes, that can work

Yes. All I'm suggesting is that instead of the main emulation thread asking "how much room is there in the DSound buffer?" and fetching that much audio from the emulation and jamming it into the DSound buffer, it should instead just ask a software buffer implementation "how much data should I give you right now to more or less keep feeding you at the same rate you are consuming?", jam that amount into a software buffer (no contention), then the background thread retrieves data from that buffer and feeds it into the DSound ring buffer. That's essentially what FCEUX does, and it works great.

Originally Posted By R. Belmont
1) The complaints didn't start coming in until around 1.35ish, and 2) users having them have posted that rolling back to older versions did fix the issue.

I've diff'ed the source code going back to before 1.35, and I've never found anything that looks like it should cause or impact this issue.

Unfortunately, I do not have any audio hardware at this time that exhibits this issue under Windows 7, so I am unable to further analyze this problem myself.

EDIT: I see that an Audigy SE board is reported to exhibit this issue, and I also see that Audigy SE boards are under $35 US on newegg.com. Can someone please confirm that this Audigy SE board causes the audio problem with Nestopia using the latest drivers available from Creative Labs? If so, I'll order one and see if I can get a repro.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:01 AM
Would any of this have something to do with the odd decoupling of audio from the video?
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/22/11 12:02 AM
Originally Posted By Samurai Fox
Would any of this have something to do with the odd decoupling of audio from the video?

What "odd decoupling of audio from the video" are you referring to?
Posted By: R. Belmont Re: Nestopia 1.41 unofficial release - 02/22/11 12:16 AM
There's a problem he and some people have where the audio slowly gets behind the video as you play. I don't have even the beginning of an explanation for that.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/22/11 12:21 AM
Originally Posted By R. Belmont
There's a problem he and some people have where the audio slowly gets behind the video as you play. I don't have even the beginning of an explanation for that.

Thanks for explaining. It wasn't clear from his posts what the nature of the "desync" was exactly. My first guess would be that he might have his audio device's playback sample rate set to something non-standard.

Samurai, can you please let us know what sound device you have, what version of the driver is installed for it, and how you have it configured? Thanks.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:22 AM
Yeah, exactly. I hope there can be a fix for this. As stated before, I'm not experiencing any scratchiness or skipping in the sound, just that one issue. smirk
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:23 AM
Uh, how do I look up my sound device? All I can seem to dig up is "Speakers (High Definition Audio Device)"
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/22/11 12:30 AM
Originally Posted By Samurai Fox
Uh, how do I look up my sound device? All I can seem to dig up is "Speakers (High Definition Audio Device)"

Right-click on "Computer" (or "My Computer", depending on your version of Windows), choose "Manage", then drill down on Device Manager and expand "Sound, video, and game controllers".

If all that your Device Manager shows is something like "Microsoft High Definition Audio Device", that indicates that you are using a default/generic driver, which may not be suitable for your hardware. If you are just using the integrated audio device on your motherboard, then just provide the brand and model number of your motherboard and we can look up what audio device it has onboard.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:38 AM
High Definition Audio Device
Driver Date: 6/21/2006
Driver version : 6.0.6002.18005
Digital Signer : microsoft windows
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:41 AM
Originally Posted By c0d3h4x0r
If all that your Device Manager shows is something like "Microsoft High Definition Audio Device", that indicates that you are using a default/generic driver, which may not be suitable for your hardware. If you are just using the integrated audio device on your motherboard, then just provide the brand and model number of your motherboard and we can look up what audio device it has onboard.


How do I do that without opening my system up? My PC is one of those all-in-one monitor things (like an iMac, but doesn't quite suck). It's kinda like a glorified laptop.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/22/11 12:42 AM
Originally Posted By Samurai Fox
How do I do that without opening my system up? My PC is one of those all-in-one monitor things (like an iMac, but doesn't quite suck). It's kinda like a glorified laptop.

What is the brand and model of your entire computer then?
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:45 AM
It's a Sony VAIO VGC-JS210J
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 12:46 AM
I feel like I should mention this as well. Prior to this PC, I had a beast of a machine (Abit motherboard), running XP. I had the same issues.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/22/11 12:48 AM
Originally Posted By Samurai Fox
High Definition Audio Device
Driver Date: 6/21/2006
Driver version : 6.0.6002.18005
Digital Signer : microsoft windows

That's definitely a generic driver. You should download and install the latest Intel chipset drivers from here:

http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=19597&ProdId=816&lang=eng

Do that and reboot.
Then check your audio device in Device Manager again and let us know what it says now.
Then try Nestopia again and let us know if the desync problem still happens.

EDIT: you may also need to download and install the latest Realtek HD Audio driver, from here:

http://www.realtek.com.tw/downloads/down...p;GetDown=false
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 01:10 AM
Thanks, I'll try it. laugh
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 03:31 AM
Okay, got the most current realtek drivers for my computer (hey, this is pretty cool), but that didn't seem to help matters any.

HOWEVER. I did find a solution to the problem and it seems to be working pretty well so far. Instead of using the option "Sync to Refresh Rate, use Auto Frameskip instead. It still plays smoothly and there doesn't seem to be any sound de-syncs at all.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/22/11 04:50 AM
Originally Posted By Samurai Fox
Instead of using the option "Sync to Refresh Rate, use Auto Frameskip instead. It still plays smoothly and there doesn't seem to be any sound de-syncs at all.

What vertical refresh rate is your monitor set to use?

Can you please send me your Nestopia log file?
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 04:27 PM
I'm back. My refresh rate is set at 60Hz (I can choose between 59Hz and 60Hz). All that needed to be done was to enable auto-frameskip (which consequently disables the "sync to monitor refresh" option.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/22/11 10:13 PM
Well, spoke too soon. I was playing Contra Force and the sound started to sync out again. Not sure what to do at this point. This is indeed one strange problem.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/23/11 01:26 AM
Update: Okay, before my previous post, I had been using NTSC filtering exclusively, and not any other display mode. Since then, I've tried using Standard and things are good with the sound so far (no sound de-syncs). I'll continue testing throughout the rest of the day and see if I still encounter problems.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 02/23/11 02:38 AM
Okay, I give up trying. Sound still de-syncs no matter what I do.
Posted By: Trebor Re: Nestopia 1.41 unofficial release - 02/23/11 02:41 AM
Originally Posted By c0d3h4x0r
Can someone please confirm that this Audigy SE board causes the audio problem with Nestopia using the latest drivers available from Creative Labs? If so, I'll order one and see if I can get a repro.


I have not tested that card with the latest driver. I do have and utilize that sound card though.

It does not cause any sound problems for me. Under both XP SP2 & SP3 for any version of Nestopia, including the latest official and unofficial versions all perform fine; including applying the NTSC filter and HQ filters with a P4 2.8Ghz desktop. I have the following driver installed for years now with that card:

Driver Date: 8/11/2006
Driver Version: 5.12.4.1196

I have had no sound issues with any of the following emulators and more: dsemul, CPS3, Crystal, Daphne, FB Alpha, MAME, Mjolnir, Model 2, Modeler, Makaron T12, Nebula, RAINE, Viva nonno, ZiNc, AppleWin, XGS32, kat5200, STeem, AdamEm, CCS64, WinVice, WinUAE, blueMSX, WinX68k HighSpeed, Stella, MESS, Nostalgia, Project64, ePSXe, Kega (Fusion), MekaW, ZSNES, bsnes, Ootake, Magic Engine, 'MADrigal' simulators, Mednafen, Visualboy Advance, Neopop, Visual Pinball/VPinMAME, Atari800 Win(Plus), Altirra, Handy, ProSystem, pSX, SainT, DOSBOX, ScummVM...

As well as a slew of PC games. :-)

I have read the nightmares, and rather not break something that works beautifully in my system. In another couple of months, once I finally buy a new machine, I may be able to test then. For anyone else with that card, I of course highly recommend the driver listed above.
Posted By: koitsu Re: Nestopia 1.41 unofficial release - 02/26/11 09:48 PM
I have an Audigy SE card in a system (XP SP3) and cannot reproduce this problem. I can also state that the X-Fi devices work fine (which I tend to use) as well (again, XP SP3). I've been using the driver set which came out about a year ago, as well as the one released a few weeks ago -- no issues/desync.
Posted By: c0d3h4x0r Re: Nestopia 1.41 unofficial release - 02/26/11 10:26 PM
Originally Posted By koitsu
I have an Audigy SE card in a system (XP SP3)

Thanks, but I guess I should have been more specific: can someone please verify that a particular sound device (such as an Audigy SE 7.1 PCI card) and driver version (windows 7 64-bit driver) reproduces the problem on a system where the OS is Windows 7 64-bit (amd64/X64)?

Reports of this happening on Windows XP are not helpful to me because (1) I do not have Windows XP on any PCs I use, and (2) the DirectSound implementation in the OS changed between Windows XP and Windows Vista.
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 03/01/11 03:00 AM
c0d3h4x0r, my issues have not been resolved after all if you've seen my last post. Would you still care to see my Nestopia configurations?
Posted By: Samurai Fox Re: Nestopia 1.41 unofficial release - 03/25/11 09:52 PM
Seems like adjusting the timing, even by one frame eliminates all instances of sound crackling and popping. I thought I didn't have this particular issue before until I've noticed it today (doesn't happen terribly often on my end). Whether or not this fixes the sound occasional sound lagging isn't known, but I'll do more testing and see how it goes.

For now, forcing the speed to 61 instead of 60 seems to work wonders so far.
Posted By: mbard20 Re: Nestopia 1.41 unofficial release - 05/07/11 09:56 PM
hi everyone,

Have not checked this thread in a while but wanted to see if there were any updates.

@c0d3h4x0r: in win7 x64 with the sb audigy, I def had the crazy sound issue. Using my onboard (gigabyte mobo) sound card fixed the issue. However I still had pretty bad input lag. A much older version of nestopia made this go away. If someone would like me to post, id me happy to.

Mike
Posted By: Geestarraw Re: Nestopia 1.41 unofficial release - 05/17/11 08:01 PM
Hello everyone!

I've now created a new version of Nestopia. Checkout Nestopia 1.41.1 unofficial release.

/Geestarraw
Posted By: koitsu Re: Nestopia 1.41 unofficial release - 12/04/11 08:55 AM
Both download links in the first post return 404. :-( I found them here instead:

Binaries: http://www.mediafire.com/?qunnnlkprn7h76b
Source: http://www.multiupload.com/HF_CBPYR3RXBI

But these uploads are probably someone elses doing, not c0d3h4x0r, so user beware. :-)

Else, try Geestarraw's build/release.
Posted By: Geestarraw Re: Nestopia 1.41 unofficial release - 02/26/12 04:13 PM
My version is based on c0d3h4x0r's changes so apart from my improvements they are equal to each other.
© Forums