Greetings once again.

I very much like to run MAME games in attract mode as my screensaver. 
I used to do this with xscreensaver and xmame 0.36, and was very
pleased with the result.  I broke my old xmame distribution by
updating libz or something, so I started over with xmame 0.100.

I'm running Solaris 8 on a Sun Ultra 60 with 2 500MHz Ultra-2 CPU's
and an Elite 3D video board.  I've got xmame 0.100, and xscreensaver
4.19.

With xmame 0.100, when I run xmame on the root window, using effect 7
(deluxe scanlines), the game uses roughly 35% of the total CPU, as
reported by top.  Xsun uses up another roughly 14%.  The total CPU
usage report from top is around 50%, with 50% idle (Solaris top
doesn't break cpu usage out by processor, it only gives a total). 
xmame.x11 and Xsun are often on different CPU's.  Things don't change
much, if at all, when I run the game in a regular X window as opposed
to on the root window.  The game runs at seemingly full framerate
(39.065040 fps), using this command:

$ xmame.x11 -root -skip_disclaimer -skip_gameinfo -volume -32 pacman

When run, xmame reports:

info: trying to parse: /usr/local/share/xmame/xmamerc
info: trying to parse: /home/jschonme/.xmame/xmamerc
info: trying to parse: /usr/local/share/xmame/xmame-x11rc
info: trying to parse: /home/jschonme/.xmame/xmame-x11rc
info: trying to parse: /usr/local/share/xmame/rc/pacmanrc
info: trying to parse: /home/jschonme/.xmame/rc/pacmanrc
loading rom 0: pacman.6e
loading rom 1: pacman.6f
loading rom 2: pacman.6h
loading rom 3: pacman.6j
loading rom 4: pacman.5e
loading rom 5: pacman.5f
loading rom 6: 82s123.7f
loading rom 7: 82s126.4a
loading rom 8: 82s126.1m
loading rom 9: 82s126.3m
done
MIT-SHM Extension Available. trying to use... Success.
Using Shared Memory Features to speed up
Initialized deluxe scanlines (v): bitmap depth = 16, color format =
RGB 888 (32bpp)
info: sound device is a onboard1 SUNW,CS4231 version g
info: audiodevice SUNW,CS4231 set to 16bit linear stereo 44100Hz
info: sysdep_dsp: using solaris plugin
info: sysdep_mixer: using solaris plugin

All is well and good up to this point.  However, when I run the exact
same command as a child process of xscreensaver, the game simply
crawls.  There is a very marked decrease in performance.  It looks to
be dropping half of the frames or so.  I don't know how to get the
actual frames per second report from xmame.x11 in this case, since
xscreensaver is spawning it, and thus I don't get the stdout from it
when it exits.  When xmame.x11 runs as a child process of
xscreensaver, it uses only 13% CPU, and Xsun uses 17% CPU, as reported
by top.  Total cpu usage is roughly 31% as reported by top, with 69%
idle.

Anyone have any ideas what could be causing this? I've googled high
and low for things that might cause some throttling in both
xscreensaver and xmame, but haven't found any clues.

Here are some things I've tried, but to no avail:

I replaced the vroot.h that comes with xmame 0.100 with the one that
JWZ distributed with xscreensaver 4.19, and recompiled xmame.x11.  No
difference.

I set xscreensaver's nice value to 0, such that it does not nice it's
subprocesses.  Even at nice 0, xmame.x11 running as a child of
xscreensaver is terribly slow.  No difference.

I manually niced xmame.x11, by issueing this command:

$ nice -10 xmame.x11 -root -skip_disclaimer -skip_gameinfo -volume -32

And the game runs just as fast as when I don't nice it.  Full frame rate.

I configured xscreensaver to spawn xmame.x11 with the -nothrottle
argument.  This made the game run far, far slower, but it wasn't
skipping as many frames, if it was skipping any at all.

I tried xscreensaver's MIT-SCREEN-SAVER extension capability, as well
as without (JWZ suggests not using it, but thought I'd try it).

Note that other screen hacks, both ones that come with xscreensaver
and others, such as Xaos and xearth, don't exhibit this issue.  They
seem to run at constant speed whether from the command line or via
xscreensaver.

One clear difference between these two cases is that when spawned from
the command line, xmame.x11 gets to draw on the "real" root window,
whereas when xscreensaver spawns it, it must draw on a "virtual" root
window.  I don't see how that would make xmame.x11 run at much lower
CPU usage and much lower framerate, but who knows? Perhaps it's
relavent.

I'd appreciate any clues, thoughts, suggestions, or other info that
might somehow point to the problem.

_______________________________________________
Xmame mailing list
Xmame@toybox.twisted.org.uk
http://toybox.twisted.org.uk/mailman/listinfo/xmame

Reply via email to