Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZSNES vs. AMD64, round two! [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
reteo
n00b
n00b


Joined: 26 Dec 2004
Posts: 62
Location: Phoenix, Arizona

PostPosted: Mon Oct 23, 2006 2:39 am    Post subject: ZSNES vs. AMD64, round two! [solved] Reply with quote

Well, I spent a while working on a way to get ZSNES working on my system. Ultimately, I simply downloaded the CVS version of the program, compiled it in the 32-bit chroot, and then ran the make install in the main system.

As of right now, it is responding at full clip with two notable, and frustrating, exceptions.

1: Disabling stereo sound or altering the sampling rate will lock the program hard.
2: If the program is not locked (the above options are not changed), then sound carries a mild and annoying static buzz, indicative of a sound stream that is not fast enough to keep up with the timing.

During all this, the program is running a 2 load, with the process at 100% CPU.

All through this, I have stripped the options down to the barest minimum, with no luck, even when reducing the window size. All emulation libraries have been installed, and are linked to by the executable.

If I'm missing something, it's not all that obvious at this time. Has anyone else possessed this problem and found a solution?

BTW: The system is an AMD Athlon64 3500+, running at 2200 MHz, w/1GB of RAM on an Asus M2NPV-VM motherboard. If there's any info needed, please let me know.

First, here is the emerge --info:
Code:

Portage 2.1.1-r1 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.12.5
Last Sync: Mon, 23 Oct 2006 00:00:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=k8 -pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac aalib acpi alsa amr arts asf bash-completion berkdb bitmap-fonts bittorrent bzip2 cairo cdparanoia cdr cli cpudetection cracklib crypt css cups curl dga dlloader dmi dri dts dv dvb dvd dvdr dvdread elibc_glibc exif extrafilters festival ffmpeg firefox flac fortran fpx ftp gcc64 gcj gdbm gif gimp glut gnome gnutls gopher gphoto2 gpm graphviz gs gstreamer hal ieee1394 imagemagick input_devices_evdev input_devices_joystick input_devices_keyboard input_devices_mouse ipv6 isdnlog jack java javascript jbig joystick jpeg2k kde kernel_linux lcms libcaca libclamav libfame libg++ live lm_sensors lzo mad mikmod mjpeg mng mp3 mpeg mpi mplayer mudflap musepack mysql ncurses network nls nntp nptl nptlonly nsplugin nvidia oav objc objc++ objc-gc offensive ogg openal openexr opengl pam pcre pdf perl png postgres povray ppds pppd python qt qt3 quicktime readline reflection rtc samba scanner sdl sdlaudio session sndfile speex spl ssl svg symlink syslog tcpd tetex tga theora tiff transcode truetype truetype-fonts type1-fonts udev unicode userland_GNU v4l vcd video_cards_nv video_cards_nvidia video_cards_v4l video_cards_vesa video_cards_vga vorbis wav wmf x264 xanim xine xorg xpm xprint xscreensaver xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY


Next, ldd /usr/local/bin/zsnes:
Code:

        linux-gate.so.1 =>  (0xffffe000)
        libz.so.1 => /emul/linux/x86/lib/libz.so.1 (0xf7f3b000)
        libSDL-1.2.so.0 => /emul/linux/x86/usr/lib/libSDL-1.2.so.0 (0xf7edb000)
        libpthread.so.0 => /lib32/libpthread.so.0 (0xf7ec8000)
        libpng12.so.0 => /emul/linux/x86/usr/lib/libpng12.so.0 (0xf7ea5000)
        libGL.so.1 => //usr/lib32/opengl/nvidia/lib/libGL.so.1 (0xf7e1f000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32/libstdc++.so.6 (0xf7d40000)
        libm.so.6 => /lib32/libm.so.6 (0xf7d1b000)
        libgcc_s.so.1 => /lib32/libgcc_s.so.1 (0xf7d11000)
        libc.so.6 => /lib32/libc.so.6 (0xf7bf6000)
        libdl.so.2 => /lib32/libdl.so.2 (0xf7bf2000)
        libX11.so.6 => /emul/linux/x86/usr/lib/libX11.so.6 (0xf7b02000)
        libXext.so.6 => /emul/linux/x86/usr/lib/libXext.so.6 (0xf7af4000)
        /lib/ld-linux.so.2 (0xf7f6f000)
        libGLcore.so.1 => //usr/lib32/opengl/nvidia/lib/libGLcore.so.1 (0xf7331000)
        libnvidia-tls.so.1 => //usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.1 (0xf732f000)
        libXau.so.6 => /emul/linux/x86/usr/lib/libXau.so.6 (0xf732c000)
        libXdmcp.so.6 => /emul/linux/x86/usr/lib/libXdmcp.so.6 (0xf7326000)

_________________
Lampros Liontos (aka. Reteo Varala)

The Penguin Producer - Tips, tricks, and techniques for producing various forms of media with Linux tools.


Last edited by reteo on Sun Oct 29, 2006 7:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Mon Oct 23, 2006 7:19 am    Post subject: Reply with quote

well i got zsnes to run ok. though mine does lock up if i try to go back to the game after entering the gui, it doesn't bother me that much because once i have the settings right i rarely have to go into the gui and change them.
Back to top
View user's profile Send private message
Zythran
n00b
n00b


Joined: 04 Dec 2005
Posts: 38
Location: Raleigh, NC, USA

PostPosted: Fri Oct 27, 2006 5:34 am    Post subject: Reply with quote

OK, here's what I've heard, and some of it may be wrong so take it with a grain of salt:

ZSNES has large parts of its code as pure, hand-optimized x86 assembly, from what I've been told. This means that when running under AMD64 mode, it will certainly pose problems, since there are architecture differences including renamed registers, etc. However, running a 32-bit version from portage poses no problems for me, and I'm on very similar hardware to yours, reteo. It doesn't lock up or anything on any of the games that I've played. Just in case it helps:

$ ldd /usr/games/bin/zsnes
linux-gate.so.1 => (0xffffe000)
libz.so.1 => /emul/linux/x86/lib/libz.so.1 (0xf7ec6000)
libSDL-1.2.so.0 => /usr/lib32/libSDL-1.2.so.0 (0xf7e6e000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf7e5b000)
libpng12.so.0 => /emul/linux/x86/usr/lib/libpng12.so.0 (0xf7e38000)
libGL.so.1 => /usr/lib32/opengl/nvidia/lib/libGL.so.1 (0xf7dab000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xf7ccf000)
libm.so.6 => /lib32/libm.so.6 (0xf7caa000)
libgcc_s.so.1 => /lib32/libgcc_s.so.1 (0xf7ca0000)
libc.so.6 => /lib32/libc.so.6 (0xf7b85000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7b81000)
libX11.so.6 => /emul/linux/x86/usr/lib/libX11.so.6 (0xf7a91000)
libXext.so.6 => /emul/linux/x86/usr/lib/libXext.so.6 (0xf7a83000)
/lib/ld-linux.so.2 (0xf7f06000)
libGLcore.so.1 => /usr/lib32/opengl/nvidia/lib/libGLcore.so.1 (0xf71fe000)
libnvidia-tls.so.1 => /usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.1 (0xf71fc000)
libXau.so.6 => /emul/linux/x86/usr/lib/libXau.so.6 (0xf71f9000)
libXdmcp.so.6 => /emul/linux/x86/usr/lib/libXdmcp.so.6 (0xf71f3000)

I noticed that my libstdc++.so.6 is pointing to a different place than yours. Not quite sure what this means, as I'm not familiar with ldd, but I hope it helps you solve your problem.
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Fri Oct 27, 2006 7:30 pm    Post subject: Reply with quote

here is my emerge info and ldd zsnes if your wondering.
emerge -info
Code:

Portage 2.1.1-r1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Turion(tm) 64 X2 Mobile Technology TL-52
Gentoo Base System version 1.12.5
Last Sync: Sat, 21 Oct 2006 22:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -msse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=athlon64 -msse3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig candy distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X acpi aim alsa berkdb bitmap-fonts cairo cdr cdrw cli cracklib crypt dbus dlloader dri dvd dvdr dvdread eds elibc_glibc emboss encode esd firefox font-server fortran gdbm gif gnome gpm gstreamer gtk gtk2 hal input_devices_keyboard input_devices_mouse input_devices_synaptics isdnlog java joystick jpeg kernel_linux ldap libg++ mad mikmod mp3 mpeg msn ncurses nls nptl nptlonly nvidia ogg oggvorbis opengl pam pcre pdf perl png pnp ppds pppd python qt3 qt4 quicktime readline reflection samba sdl session spell spl ssl svg symlink tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa vorbis win32codec xine xml xorg xpm xv xvid zlib zvbi"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY


ldd zsnes
Code:

 linux-gate.so.1 =>  (0xffffe000)
        libz.so.1 => /emul/linux/x86/lib/libz.so.1 (0xf7f7e000)
        libSDL-1.2.so.0 => /emul/linux/x86/usr/lib/libSDL-1.2.so.0 (0xf7f1e000)
        libpthread.so.0 => /lib32/libpthread.so.0 (0xf7f0b000)
        libpng12.so.0 => /emul/linux/x86/usr/lib/libpng12.so.0 (0xf7ee8000)
        libGL.so.1 => //usr/lib32/opengl/nvidia/lib/libGL.so.1 (0xf7e62000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32/libstdc++.so.6 (0xf7d83000)
        libm.so.6 => /lib32/libm.so.6 (0xf7d5e000)
        libgcc_s.so.1 => /lib32/libgcc_s.so.1 (0xf7d53000)
        libc.so.6 => /lib32/libc.so.6 (0xf7c37000)
        libdl.so.2 => /lib32/libdl.so.2 (0xf7c33000)
        libX11.so.6 => /emul/linux/x86/usr/lib/libX11.so.6 (0xf7b43000)
        libXext.so.6 => /emul/linux/x86/usr/lib/libXext.so.6 (0xf7b35000)
        /lib/ld-linux.so.2 (0xf7faa000)
        libGLcore.so.1 => //usr/lib32/opengl/nvidia/lib/libGLcore.so.1 (0xf7372000)
        libnvidia-tls.so.1 => //usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.1 (0xf7370000)
        libXau.so.6 => /emul/linux/x86/usr/lib/libXau.so.6 (0xf736d000)
        libXdmcp.so.6 => /emul/linux/x86/usr/lib/libXdmcp.so.6 (0xf7367000)
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Sat Oct 28, 2006 2:05 am    Post subject: Reply with quote

i think i just found out why it does this.
i did not have the second problem you had untill i upgraded to the latest stable alsa libs/headers/etc while using in kernel drivers.
Back to top
View user's profile Send private message
reteo
n00b
n00b


Joined: 26 Dec 2004
Posts: 62
Location: Phoenix, Arizona

PostPosted: Sat Oct 28, 2006 3:28 am    Post subject: Reply with quote

Actually...

Code:

# emerge -p  alsa-driver

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-sound/alsa-driver-1.0.11


I didn't use the in-kernel drivers, because I like using the /etc/init.d/alsa script which comes with the gentoo ALSA drivers.

And Zythran, I downloaded and compiled the program in the 32-bit chroot.
I simply installed it in the 64-bit system. It is a 32-bit binary.

*chuckle* After emerging it in the 64-bit system, the mouse moved and stopped in a regular pattern, and the program ran much more slowly. Thus, the 32-bit chroot compile.
_________________
Lampros Liontos (aka. Reteo Varala)

The Penguin Producer - Tips, tricks, and techniques for producing various forms of media with Linux tools.
Back to top
View user's profile Send private message
andrewd18
Guru
Guru


Joined: 11 Apr 2004
Posts: 364
Location: Wisconsin, USA

PostPosted: Sat Oct 28, 2006 2:28 pm    Post subject: Reply with quote

Zythran wrote:
ZSNES has large parts of its code as pure, hand-optimized x86 assembly, from what I've been told. This means that when running under AMD64 mode, it will certainly pose problems, since there are architecture differences including renamed registers, etc. However, running a 32-bit version from portage poses no problems for me, and I'm on very similar hardware to yours, reteo.

I hung around with the developers online for about a year, and I can verify that this is the case... there's a LOT of x86 assembly.
_________________
Keep Your Toolchain Stable! - emwrap.sh

There's no place like ::1
Back to top
View user's profile Send private message
reteo
n00b
n00b


Joined: 26 Dec 2004
Posts: 62
Location: Phoenix, Arizona

PostPosted: Sun Oct 29, 2006 7:16 pm    Post subject: Reply with quote

I found the solution.

It would seem that the neoportage version of ZSNES does not lock up,
and it would seem that the sound static problem goes away when the sampling rate is 48000 Hz.

Of course, it fails to emerge in 64-bit mode, but after compiling it in the chroot with the -B switch, and emerging it in the native environment with the -K switch, I am now using a fully-functional version of ZSNES with no flaws.
_________________
Lampros Liontos (aka. Reteo Varala)

The Penguin Producer - Tips, tricks, and techniques for producing various forms of media with Linux tools.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum