Really high CPU usage in ZSNES 1.42 Linux!?

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Really high CPU usage in ZSNES 1.42 Linux!?

Post by kyo-KUSANAGI »

Is it just me, or is ZSNES being a CPU hog on my VIA C3 running Gentoo Linux? Because ZSNES consistently gets 40+fps with 512x448 resolution, no filters and 60%CPU (X takes up the other 30% or so), while my Athlon 1800+ does the same thing with 1% CPU, running Windows XP. Not exactly a fair comparison, but I would like to know if this is Linux's fault or VIA's fault.
You all know Gentoo, it's a source distro, my CFLAGS are -Os -march=c3 -m3dnow -mmmx. Except that that won't really help, because ZSNES is all assembly for x86, right?
EDIT: just in case somebody points out that my Athlon is really really good like that, a Pentium II Celeron 433MHz (win98) gave better frame rates than this VIA C3 at 933MHz.
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

You should check to make sure X is set up properly and DRI is working.
[u][url=http://bash.org/?577451]#577451[/url][/u]
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

DRI only is about 3D acceleration, and ZSNES is about 2D graphics. Right? (I got DRI working before, but I had to sacrifice my framebuffer and some stability)
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

DRI makes a difference for OGL modes. Also try CVS, the Linux port has better CPU handling.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

OK, now that i enabled Direct Rendering, performance is up by 6 fps. Before: 29fps on Star Ocean Software Rendering, Now: 35fps on OGL. Enabling anything else, like the bilinear filter, drops frames drastically. Man I thought 3D chips were supposed to take care of bilinear filtering like icing on a cake! Who knows what kind of perf I'll get when I tell it to do Trilinear!
Is there anything else I can do to speed it up? I'm really reluctant to try the CVS, to be honest. I already have enlightenment-0.17 CVS and xorg-x11 CVS on the computer, I don't want to waste more time on CVS -d:pserver and stuff. Besides, I don't know how to uninstall it once I install it separately from Gentoo's emerge command!
Would 3dNow help? How can i find if it's compiled in already?
EDIT: just for curiosity's sake, what CPU usage do you guys have on Linux using which graphics rendering method (OGL, software)? Because the writer of ZDOOM said that X11 really sucked for games on his website... so I wonder if this kind of performance is considered acceptable on Linux.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

kyo-KUSANAGI wrote:Besides, I don't know how to uninstall it once I install it separately from Gentoo's emerge command!
Delete source. Delete executable. BAM
just for curiosity's sake, what CPU usage do you guys have on Linux using which graphics rendering method (OGL, software)? Because the writer of ZDOOM said that X11 really sucked for games on his website... so I wonder if this kind of performance is considered acceptable on Linux.
P4 1.8GHz 448MB RAM, mode 1024x768 ODS F
-> max cpu usage 10% with only bilinear filter on, autoframeskip + max frameskip 0
[max is 85% with bilinear + hq2x, autoframeskip + max frameskip 9]
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

P4 1.8GHz 448MB RAM, mode 1024x768 ODS F
-> max cpu usage 10% with only bilinear filter on, autoframeskip + max frameskip 0
[max is 85% with bilinear + hq2x, autoframeskip + max frameskip 9]
Right, I know how to uninstall now (hey don't blame me Windows has all that registry stuff to clean!)
96.9% with ODR 512x448, no other filters, autoframeskip + max frameskip 9. Sound 44KHz.
You know, a very interesting thing is, whenever I start zsnes, it just uses all the CPU. Like, before I've loaded a ROM, and I'm just at the GUI, bam! It uses all my CPU, just by running the program. The difference now with direct rendering is, my mouse moves smoother than the software rendering method inside the GUI, but zsnes still uses all the CPU.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

kyo-KUSANAGI wrote:96.9% with ODR 512x448, no other filters, autoframeskip + max frameskip 9. Sound 44KHz.
You know, a very interesting thing is, whenever I start zsnes, it just uses all the CPU. Like, before I've loaded a ROM, and I'm just at the GUI, bam! It uses all my CPU, just by running the program. The difference now with direct rendering is, my mouse moves smoother than the software rendering method inside the GUI, but zsnes still uses all the CPU.
Hmm... sounds like you don't have the version in which we fixed that.
Just checked - yeah, we fixed that in post v1.42 WIPs.

Grab cvs...
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

BTW, trilinear filtering is rather pointless for ZSNES.

Oh, and try running it in Blackbox or something instead of Enlightenment.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Kinleb
New Member
Posts: 9
Joined: Mon Apr 25, 2005 5:09 pm

Post by Kinleb »

*Excuse_me!!*

What the hell is zsnes "WIP"!?!?!?!?....
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I direct you to read the first thread on the forum.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

Kinleb wrote:*Excuse_me!!*

What the hell is zsnes "WIP"!?!?!?!?....
Work in progress.
Try out CCleaner and other free software at Piriform
Image
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

Odd..... I put zsnes in my xinitrc, so now it's the only X program running.
With software 512x448, idle, no ROM loaded, zsnes takes up 85% or so of my CPU.
With OpenGL 512x448, idle, no ROM loaded, zsnes takes up only around 1% CPU. Oddly enough, it wouldn't let go of the CPU when I ran it in XFCE even in OpenGL mode.
However, frame rates have not improved. 45fps on the Tales of Phantasia world map, and the same for the Star Ocean title screen too. Is there no way to speed this up further?
AspiringSquire
Born to Rule... Impatiently
Posts: 265
Joined: Wed Nov 17, 2004 8:21 pm
Location: Everywhere I want to be.
Contact:

Post by AspiringSquire »

From the FAQ:

Code: Select all

Q: Why is ZSNES slow?
A: Try changing your video mode to different settings until you find the mode
   that's optimal in performance. There are two things that will probably impact
   speed the most (for the better): using a fullscreen setting (instead of a
   'windowed' mode) and a resolution lower than that of your desktop. The lower
   the display resolution used in ZSNES, the better the overall performance will
   be, due to lesser processing requirements. 'R' modes are also faster than 'S'
   modes because they maintain the original display ratio rather than stretching
   it to fill the monitor's current resolution.

   Ensure that MMX Support is enabled in the Options window; this mode should
   provide a noticeable speed increase for computers that can use it.

   Emulating a SNES is slow because it is a complex system. Also, make sure that
   you meet the system requirements.

   Vsync, by nature of syncing to the monitor, is also slower. So if speed is
   paramount to you, Vsync should be disabled. You should also disable all
   interpolation and graphic filters, and use auto frame rate and frame skip. If
   you still need more speed, disable sound. Then, if that's not enough, disable
   SPC emulation (you must exit and reopen ZSNES for the option to take effect);
   this will cause some games to not work, though.
Perhaps we could have this info stickied somewhere...
[url=http://board.zsnes.com/phpBB2/viewtopic.php?t=3298][color=brown]My [u]NES palette[/u][/color][/url] - better colors with any emulator.

"the more you know, and the more you can do... the more you are."
- [url=http://www.danielbohman.com][color=brown][u]daniel bohman[/u][/color][/url]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

In other words sticky the entire FAQ...

I don't like that idea. Having the FAQ someplace online though would make sense.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
awk
New Member
Posts: 4
Joined: Wed May 04, 2005 2:13 pm
Contact:

Very slow on Mepis

Post by awk »

I'm also having a problem of poor performance in SimplyMepis 3.3 (based on Debian Gnu/Linux) that may be related (using kernel 2.4.29). Haven't checked CPU usage but I suspect it's high. Zsnes (v 1.40, I think) worked great on same system in Mepis 2004-4, in many two-palyer games, full-screen, with good sound, two USB gamepads and default options, now, after Mepis upgrade, even using mouse in Zsnes is painfully slow and games run slow with very choppy sound. System has an old PII-266MHz, 192MB RAM, Nvidia Geforce FX 5200 (128MB). Same issue in Debian binary v. 1.40 and in compiled 1.42 and 1.43 WIPs (used autogen.sh, everything looked good to me, had all dependencies from Debian testing/unstable). Haven't tried all FAQ suggestions yet. No problems in other games and GL apps. I made sure to delete .zsnes folder with configs before every zsnes upgrade.
kieran_
Mugwump
Posts: 824
Joined: Fri Jul 30, 2004 9:05 pm

Post by kieran_ »

What is the difference between Disable Spc Emulation and Disable Sound? IIss tthe SPC sstill being emulated when just sound is disabled?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

kieran wrote:What is the difference between Disable Spc Emulation and Disable Sound? IIss tthe SPC sstill being emulated when just sound is disabled?
Exactly. SPC emulation is required for accurate emulation, but requires more CPU work, of course.
Disabling sound just mutes the output.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
awk
New Member
Posts: 4
Joined: Wed May 04, 2005 2:13 pm
Contact:

slow on Mepis

Post by awk »

Solved this problem using OpenGL video mode (oops). Didn't get to this before because version 1.40 persistently crashes when I change the video modes (complete freeze, destabilization of X). Same after upgrading Nvidia driver from version 6629 to 7174. Later versions of Zsnes don't do this. Without using OpenGL, I get 80% cpu usage without any games running, 99% with games. With OGL, 2% and 95%. With bilinear filtering, 10% just sitting in the GUI. Running in Fluxbox. I've also had good performance running Zsnes in Blackbox, somewhat less so in KDE (naturally).
Sol
Rookie
Posts: 14
Joined: Sun Jan 09, 2005 7:36 am

Re: Really high CPU usage in ZSNES 1.42 Linux!?

Post by Sol »

kyo-KUSANAGI wrote:Is it just me, or is ZSNES being a CPU hog on my VIA C3 running Gentoo Linux? Because ZSNES consistently gets 40+fps with 512x448 resolution, no filters and 60%CPU (X takes up the other 30% or so), while my Athlon 1800+ does the same thing with 1% CPU, running Windows XP. Not exactly a fair comparison, but I would like to know if this is Linux's fault or VIA's fault.
You all know Gentoo, it's a source distro, my CFLAGS are -Os -march=c3 -m3dnow -mmmx. Except that that won't really help, because ZSNES is all assembly for x86, right?
EDIT: just in case somebody points out that my Athlon is really really good like that, a Pentium II Celeron 433MHz (win98) gave better frame rates than this VIA C3 at 933MHz.
<troll>
The hell is wrong with you Gentoo people? Oh wait, someone's got that covered:
http://www.funroll-loops.org

Using -Os is just begging for trouble...along with most Cflags; it probably would explain a number of problems. I could not make X take up 30% of my CPU if I begged it to, and I'm on a 900 mhz machine. Cflags will not help you; they MAY save you 1/10 of a second...but its a trade-off for instability, un-explainable bugs and a much longer amount of time required to compile. Think about it.

I bet if you rebuilt your system with *just* -O and -march=c3, you wouldn't have any problems...or better yet, used a binary distro.
</troll>
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Sol wrote:Using -Os is just begging for trouble...along with most Cflags; it probably would explain a number of problems.
(...)
they MAY save you 1/10 of a second...but its a trade-off for instability, un-explainable bugs and a much longer amount of time required to compile. Think about it.
Pah. Seriously, you think some optimizations will create unstable builds ?
The zsnes source isn't as fucked up as you make it sound.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Re: Really high CPU usage in ZSNES 1.42 Linux!?

Post by Noxious Ninja »

Sol wrote:
kyo-KUSANAGI wrote:Is it just me, or is ZSNES being a CPU hog on my VIA C3 running Gentoo Linux? Because ZSNES consistently gets 40+fps with 512x448 resolution, no filters and 60%CPU (X takes up the other 30% or so), while my Athlon 1800+ does the same thing with 1% CPU, running Windows XP. Not exactly a fair comparison, but I would like to know if this is Linux's fault or VIA's fault.
You all know Gentoo, it's a source distro, my CFLAGS are -Os -march=c3 -m3dnow -mmmx. Except that that won't really help, because ZSNES is all assembly for x86, right?
EDIT: just in case somebody points out that my Athlon is really really good like that, a Pentium II Celeron 433MHz (win98) gave better frame rates than this VIA C3 at 933MHz.
<troll>
The hell is wrong with you Gentoo people? Oh wait, someone's got that covered:
http://www.funroll-loops.org

Using -Os is just begging for trouble...along with most Cflags; it probably would explain a number of problems. I could not make X take up 30% of my CPU if I begged it to, and I'm on a 900 mhz machine. Cflags will not help you; they MAY save you 1/10 of a second...but its a trade-off for instability, un-explainable bugs and a much longer amount of time required to compile. Think about it.

I bet if you rebuilt your system with *just* -O and -march=c3, you wouldn't have any problems...or better yet, used a binary distro.
</troll>
Oh, shut up. I build ZSNES myself, and I use Windows. I compile it with -Os and I've never had problems.
[u][url=http://bash.org/?577451]#577451[/url][/u]
bztunk
Hazed
Posts: 84
Joined: Mon Dec 27, 2004 9:08 pm
Location: In A.D. 2101, war was beginning.

Post by bztunk »

grinvader wrote:Pah. Seriously, you think some optimizations will create unstable builds ?
The zsnes source isn't as fucked up as you make it sound.
Maybe the zsnes source isn't, but gcc could be...

(but I tought that -Os was safe)
darklegion
New Member
Posts: 5
Joined: Fri Oct 22, 2004 1:40 pm

Post by darklegion »

Are any of you usnig psx controllers,through the parallel port by chance? I've had significant performance problems when ever using a psx controller with the gamecon driver loaded.You can tweak the driver so that it hurts performance a fair amount less but I could never get it to work flawlessly.As for CFLAGS -Os is perfectly safe for pretty much everything and is actually quite conservative.
Tallgeese
Justice is Blind
Posts: 620
Joined: Wed Jul 28, 2004 3:33 pm
Location: Test
Contact:

Post by Tallgeese »

grinvader wrote:
kieran wrote:What is the difference between Disable Spc Emulation and Disable Sound? IIss tthe SPC sstill being emulated when just sound is disabled?
SPC emulation is required for accurate emulation, but requires more CPU work, of course.
...So why exactly is there an option to kill it? Sure there's more CPU used, but if disabling it breaks games...
Post Reply