Frequent slowdowns + cpu usage side effects

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
ASk
New Member
Posts: 4
Joined: Mon Aug 30, 2004 10:53 am

Frequent slowdowns + cpu usage side effects

Post by ASk »

Under Windows XP SP2 (and XP / XP SP1), both ZSNES 1.36 and latest ZSNES WIP (aug 03) have frequent input lag - for example:

* the mouse cursor visibly slows down or just refuses to accept input for a short period of time, then jumps to the new location.
* Sometimes, a key press is not registered or a key press registers multiple times (most noticeable with Enter and arrow keys during menu navigation)

This is greatly magnified when high priority mode is unchecked. Possibly because ZSNES uses 100% CPU at all times, and when not in high priority, it can't get all 100% to itself - perhaps something should be done against the constant CPU usage

In addition, the fact that ZSNES uses 100% cpu at all times, has frequent ill-side effects on the rest of the system - even when high priority mode is unchecked, which should give the rest of the running processes enough breathing space - network connections fail (i.e the gmail notifier, which consistently can't establish a connection once ZSNES is running), the antivirus/firewall combo that I use fails to acquire status information from the various components.

I've remember using ZSNES 1.36 on Windows 98, both the DOS and Windows versions of it - none of the above has ever happened.

[edit] Just to add - I also used one of the early ZSNES builds (0.9something) on my old machine - a P90 - under Win98. While I had to play in something like fs8-9, the gui itself was smooth [/edit]


PC Specs:

P3 733 (Coppermine, not Celeron)
256MB RAM
GF2 GTS
HDDs work @7200RPM
Any reply will be appreciated.
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

Make sure you have the drivers for everything. (Video card, sound, and etc.) And make sure you do a clean install of the WIP version.
Try out CCleaner and other free software at Piriform
Image
rage46
Lurker
Posts: 117
Joined: Wed Jul 28, 2004 4:02 am
Location: nowhere special

Post by rage46 »

This probably won't fix the problem but I do suggest adding more ram and at least a 1 GHZ cpu to run XP. Minimum requirements are just lies, 300MHz... Psh as if maybe if you made it look like windows 2000.
Some people are like slinky's not really good for anything but you can't help smile when one falls down the stairs.
Oblivion
What?
Posts: 177
Joined: Wed Jul 28, 2004 1:32 pm
Location: You'd want to know, wouldn't you?

Post by Oblivion »

rage46 wrote:This probably won't fix the problem but I do suggest adding more ram and at least a 1 GHZ cpu to run XP. Minimum requirements are just lies, 300MHz... Psh as if maybe if you made it look like windows 2000.
I can guarantee that he has a good enough system to run Windows XP. That eye candy in XP isn't exactly needed either.
Everything I say is a lie.
Spoony
Hazed
Posts: 78
Joined: Wed Jul 28, 2004 2:10 am
Location: Peg city

Post by Spoony »

rage46 wrote:This probably won't fix the problem but I do suggest adding more ram and at least a 1 GHZ cpu to run XP. Minimum requirements are just lies, 300MHz... Psh as if maybe if you made it look like windows 2000.
Stop fucking talking. XP can be run adequately on a 233 with 96mb of ram.
[url=http://www.alexchiu.com/affiliates/clickthru.cgi?id=spoony]Immortality[/url]
rage46
Lurker
Posts: 117
Joined: Wed Jul 28, 2004 4:02 am
Location: nowhere special

Post by rage46 »

Spoony wrote:
rage46 wrote:This probably won't fix the problem but I do suggest adding more ram and at least a 1 GHZ cpu to run XP. Minimum requirements are just lies, 300MHz... Psh as if maybe if you made it look like windows 2000.
Stop fucking talking. XP can be run adequately on a 233 with 96mb of ram.
Um it can run adequately? Or it can run with everything off and nothing XPish about it turned on?
Some people are like slinky's not really good for anything but you can't help smile when one falls down the stairs.
Spoony
Hazed
Posts: 78
Joined: Wed Jul 28, 2004 2:10 am
Location: Peg city

Post by Spoony »

A default XP install.
[url=http://www.alexchiu.com/affiliates/clickthru.cgi?id=spoony]Immortality[/url]
JuddMan
New Member
Posts: 7
Joined: Thu Aug 26, 2004 3:09 pm
Contact:

Post by JuddMan »

default install yes, but you cant install anything else or it falls over :P

J/K

i had it running on an old 500 with 192 mb ram, that's the lowest i'd want to go. and zsnes is crunchy at best on that.
ASk
New Member
Posts: 4
Joined: Mon Aug 30, 2004 10:53 am

Post by ASk »

Now that we have finished to discuss the minimum requirements for WinXP, and what PCs it can run on, can we please get on with the original issue?

@snkcube - latest drivers for everything, clean install
@rage46 - everything else (including other SNES emulators) runs fine
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

My excessively powerful laptop had this problem, even after removing all of the removable bloatware that came on the system. I had to format and install Windows freshly. There's no way to tell what your system builder has done to Windows.

Still, you should remove as much bloat as possible. For instance, most OEM's will include a third-party media playing application on your computer. If your music and videos (excluding DVD's) open in an application other than Windows Media Player, it's surely bloated semi-spyware that your system builder was paid to install. WMP is fine for music and video. Uninstall all that other shit.
ASk
New Member
Posts: 4
Joined: Mon Aug 30, 2004 10:53 am

Post by ASk »

heh
my system is not OEM, nor it has been touched by a system builder (unless you consider me one)

I know what I have on my system, and believe it or not, I don't like WMP, because it's too bloated. I don't use explorer.exe as a shell, rather settling for bb4win.

To prevent upcoming posts - I also don't have any sort of viruses / trojans / adware / spyware - and see, I am not a newbie computer user, so the posts about OEM and such do not really apply.

I have my own speculations as to why zsnes behaves as it does, however my knowledge of x86 asm is not enough to validate it
Could be because it doesn't look like it's multi-threaded, therefore if using while(1) { do_stuff(); sleep(10); } method would lead to jumpy input , and possibly the gui/input loops run without any sort of delay, taking all the available CPU time. But those are just my speculations, I am probably completely wrong

So really, this thread is reminding me more and more of the tech support farse, along the lines of "Sir, I must read my script line by line, I don't care that you know what the problem is". Let's not keep it this way.
rage46
Lurker
Posts: 117
Joined: Wed Jul 28, 2004 4:02 am
Location: nowhere special

Post by rage46 »

You seem to know your stuff quite well. If you haven't tried it already you can try shutting down individual services in XP until you find the one that causes slowdowns, as for the code I don't think so because not many computer are affected by this.
Some people are like slinky's not really good for anything but you can't help smile when one falls down the stairs.
Kagerato
Lurker
Posts: 153
Joined: Mon Aug 09, 2004 1:40 am
Contact:

Post by Kagerato »

The fact that the ZSNES WIPs operates under 99/100% CPU usage while in the GUI loop has been discussed to death already. Prior examples have shown it to hurt nothing. Other full-screen programs (especially games) do this, and they also do not hurt anything.

The NT kernel automatically allows applications to steal CPU time away from other programs when they need it. Anything that runs in the background will still do this.

ZSNES 1.36 and earlier used 100% CPU while the GUI was not active, exactly the inverse of what it is now. It's quite amusing, and it's still completely harmless.

The fact that you are experiencing the input lag in both ZSNES 1.36 and the later WIPs shows that it has nothing to do with the program using CPU.

By the way, setting a process to high priority causes the NT kernel to favor it more highly, resulting in other programs having a much harder time taking CPU cycles away from it. I recommend against high priority processes, regardless of what you're doing with them.

Input problems may be related to DirectInput, but I doubt it. I do not know how ZSNES handles the mouse and keyboard precisely. It may only use DirectInput for controller-related functions.

I'd investigate all the pertinent differences between the 98 system you were using before and the one you're using now.
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

If it's not bloatware, it could be crappy drivers.

Alternative shell interfaces tend to be bloated.

Which Media Player software do you have installed?
ASk
New Member
Posts: 4
Joined: Mon Aug 30, 2004 10:53 am

Post by ASk »

the alternative shell that I'm using is BB4win - whoever ran *box on *nix can vouch for it being the most non-bloated shell possible

I have foobar2000 and MPC installed as my media players. Both are quite non-bloated and minimalistic.

WMP is there somewhere, but I never started it since I installed Windows.

As for drivers, they are the most recent available for my hardware
Esturk
Lurker
Posts: 114
Joined: Wed Jul 28, 2004 7:07 pm
Location: Edmonton, Alberta, Canada

Post by Esturk »

rage46 wrote:This probably won't fix the problem but I do suggest adding more ram and at least a 1 GHZ cpu to run XP. Minimum requirements are just lies, 300MHz... Psh as if maybe if you made it look like windows 2000.
That's not entirely true. I ran XP on several CPU's of varying speeds from 450Mhz to 1.4Ghz and they all ran Zsnes perfectly under XP. Although some more graphical intense games choked on the 450Mhz Celeron, I've found that 600Mhz and up is perfect for running Zsnes. Of course this is all without filters of any kind to slow anything down.
Cebu
Rookie
Posts: 21
Joined: Mon Aug 30, 2004 10:52 pm

Post by Cebu »

Kagerato wrote:The fact that the ZSNES WIPs operates under 99/100% CPU usage while in the GUI loop has been discussed to death already. Prior examples have shown it to hurt nothing. Other full-screen programs (especially games) do this, and they also do not hurt anything.

The NT kernel automatically allows applications to steal CPU time away from other programs when they need it. Anything that runs in the background will still do this.

ZSNES 1.36 and earlier used 100% CPU while the GUI was not active, exactly the inverse of what it is now. It's quite amusing, and it's still completely harmless.
I take it that the 100% CPU usage in the GUI loop will still be there in 1.40? While it may not "hurt" anything for desktop users, it certainly does for those of us with laptops. If I do any switching at all between ZSNES and other apps, it kills my battery life considerably.

I would imagine that for anyone that has a desktop system capable of throttling the speed & voltage supplied to the processor, the extra CPU usage is going to result in higher electricity consumption. (probably won't increase your electric bills by a significant amount, but you never know)
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

Wow, another thread thats been brought from the dead...
Try out CCleaner and other free software at Piriform
Image
tcaudilllg

Post by tcaudilllg »

I daresay that the vsync code can be improved. ZSNES has always ran chronically slow under vsync, and I've never fully understood why. Can it be that hard to redraw a screen at 60 fps? ZSNES is just an interpreter, after all.
illegal eagle
Savestate Pimp
Posts: 129
Joined: Thu Jul 29, 2004 2:15 pm
Contact:

Post by illegal eagle »

Have you spotted a bug in the source? If yes then you can say if it's easy to fix or not.

PS: ZSNES' internal stuff (SNES) has not much to to with the external stuff (PC).
"Other people can give you more suggestions as I just lost all my motivation to respond further to this post."
[i] - Nightcrawler[/i]

[url=http://www.geocities.com/illegal_eagle_2003/]vSNES v2.00[/url]: My SNES savestate viewer.
tcaudilllg

Post by tcaudilllg »

I wasn't suggesting that there was a bug, rather that a reorganization of the source may be in order. But no, I have not researched the ZSNES vsync system, as there is only assembly source and no overarching design documentation. I, like most people, don't have the time to trace the gigantic ZSNES code tree.

I will look at the source again, though, to deduce whether or not documentation efforts have improved in recent months.


EDIT:
Alright, I looked. For an hour. Didn't find a whit about the vertical retrace anywhere, although it's probably in the timing sections or the CPU sections or some such. (but why not the graphics!?!?!?) Anyway, I'm not about to put my heart and soul into deciphering seemingly endless spans of assembler when even the variable names are excessively abbreviated and cryptic. It's unreasonable to expect outside assistance in the maintenance of a system so unnecessarily obtuse.
Post Reply