zsnes segmentation faulting with libao2

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

Moderator: ZSNES Mods

Post Reply
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

zsnes segmentation faulting with libao2

Post by dfreer »

Hey everyone! First off, I've used zsnes for a long time and have always been a fan, but never registered on forums till now (never needed to!).

I am currently trying to make a .deb for amd64 ubuntu users of zsnes. I know, I know that zsnes is for 32-bit users only, what I am trying to do (and have done!) is make a .deb that installs the 32-bit compiled version on the amd64 machine with all the needed 32-bit libraries installed.

If I compile with --enable-release or vanilla, version 1.51 and svn 1.52 runs and plays perfectly on the 64-bit system, although sound is scratchy (due to using SDL). if I compile with --enable-libao, version 1.51 segmention faults (core dumped) on a 64-bit machine (it works perfectly on 32-bit!). the svn 1.52 will play, but only SDL output will work.

anyways, does anyone know why libao2 would cause a segmentation fault? I can provide links to the binaries I compiled, the lib32ao2 package that contains the 32-bit libraries I used, whatever you may need. This would help tremendously as there is a big interest in getting zsnes 1.51 to run in amd64, thanks in advance!

EDIT: I have made a amd64/32-bit .deb available for anyone who wants it (although the amd64 version does not have libao2 support for the above reasons), the link is here:
http://ubuntuforums.org/showthread.php?t=432642
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

libao, not libao2 is supposed to be used.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Post by dfreer »

thanks for the reply!

hmmm. well, the reasons I was using libao2 was:
(1) when trying to execute zsnes with --enable-libao on a 64-bit system, it complains about "libao.so.2" missing. libao.so.2 is only found in the ubuntu/debian package libao2

http://www.debian.org/distrib/packages#search_contents
http://packages.ubuntu.com/cgi-bin/sear ... &arch=i386

(2) installing libao2 on the 32-bit system solves this problem and works fine.
(3) there is no libao package in ubuntu/debian

Any other ideas anyone? I'm going to go through all the dependencies for libao2, maybe it is getting hung up on something and failing to let me know about it.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Look for the libao-dev package.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

You're not installing libao2, don't start confusing badly named packages with what the packages actually are.

And I'd imagine it won't work right under 64 bit because of a shared object file conflict.
I'd run strings on the libao shared object and see where it's getting its plugins from. Mine are in "/usr/lib/ao/plugins-2". I'd make sure that wherever it's looking, you have the 32 bit plugins there.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Post by dfreer »

Look for the libao-dev package.
Ok, I repackaged libao-dev so that it will install it's libraries in /usr/lib32, and zsnes 1.51 (with --enable-libao --enable-release) still seg faults. BTW, before I installed the 32-bit libraries for zsnes this was a vanilla feisty AMD64 install.
You're not installing libao2, don't start confusing badly named packages with what the packages actually are.
? I'm guessing that you mean that libao2 is actually libao? Yeah, debian/ubuntu really needs to get it's act together on the naming convention.
And I'd imagine it won't work right under 64 bit because of a shared object file conflict.
I'd run strings on the libao shared object and see where it's getting its plugins from. Mine are in "/usr/lib/ao/plugins-2". I'd make sure that wherever it's looking, you have the 32 bit plugins there.
Well, I don't think it is a shared object file conflict, if you are referring to the libraries. I am installing the 32-bit libraries in /usr/lib32/, that way ldconfig (i believe I am correct in saying this) will add them to it's cache and I can use both the x86_64 and x86 libraries alongside each other. But if I'm wrong please correct me I don't always know what I am talking about. Here's a list of the files in /usr/lib32/ao/plugins-2 (/usr/lib/ao/plugins-2/ has the exact same files, only of the ELF64 class):

Code: Select all

$ ls -l /usr/lib32/ao/plugins-2/
total 92
-rw-r--r-- 1 root root  8110 2006-07-01 12:59 libalsa09.a
-rw-r--r-- 1 root root   856 2006-07-01 12:59 libalsa09.la
-rw-r--r-- 1 root root 10196 2006-07-01 12:59 libalsa09.so
-rw-r--r-- 1 root root  2318 2006-07-01 12:59 libarts.a
-rw-r--r-- 1 root root   947 2006-07-01 12:59 libarts.la
-rw-r--r-- 1 root root  4196 2006-07-01 12:59 libarts.so
-rw-r--r-- 1 root root  2606 2006-07-01 12:59 libesd.a
-rw-r--r-- 1 root root   863 2006-07-01 12:59 libesd.la
-rw-r--r-- 1 root root  4456 2006-07-01 12:59 libesd.so
-rw-r--r-- 1 root root  3370 2006-07-01 12:59 libnas.a
-rw-r--r-- 1 root root   818 2006-07-01 12:59 libnas.la
-rw-r--r-- 1 root root  5612 2006-07-01 12:59 libnas.so
-rw-r--r-- 1 root root  4358 2006-07-01 12:59 liboss.a
-rw-r--r-- 1 root root   804 2006-07-01 12:59 liboss.la
-rw-r--r-- 1 root root  5896 2006-07-01 12:59 liboss.so
Should I just dump my 32-bit libraries in /usr/lib/ao/plugins-2/? That's exactly the sort of thing I was hoping to avoid, but if it is the only way... I don't see why /usr/lib32/ won't work.

Sorry nach, I've never run strings before... I'll try looking up a guide on how to do that. If you could help by telling me how to do so it would be appreciated. I assume this means you have successfully run zsnes 1.51 in a 64-bit system with libao support?
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

dfreer wrote:Here's a list of the files in /usr/lib32/ao/plugins-2 (/usr/lib/ao/plugins-2/ has the exact same files, only of the ELF64 class):
If you're not going to run strings on it, you have no idea where it's looking, and I doubt they were intelligent enough to make it look in the right place.

I already answered this question in another thread, search for it.
dfreer wrote: Should I just dump my 32-bit libraries in /usr/lib/ao/plugins-2/? That's exactly the sort of thing I was hoping to avoid, but if it is the only way... I don't see why /usr/lib32/ won't work.
In the other thread, I explained about linking them under different names.
dfreer wrote: If you could help by telling me how to do so it would be appreciated.
You type strings followed by the name of the shared object, using grep could help too.

I did:

Code: Select all

strings /usr/lib/libao.so.2 | grep /
Of course correct the path to your shared object file, make it lib32 or whatever.
dfreer wrote: I assume this means you have successfully run zsnes 1.51 in a 64-bit system with libao support?
My only Linux install I'm currently using is 64 bit, and I'm a ZSNES developer, and it was I who added the libao support. Take a guess.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Post by dfreer »

ok, I used strings, and I see what you mean. it sure is looking in /usr/lib/ instead of /usr/lib32/. dumb me, but hey I'm learning, so evidently libao.so.2 is hardcoded to look for the /ao/plugins-2/ directory under /usr/lib/? fuck debian developers for not making things multiarch.

anyways, so I spent the last hour, first trying several different search terms and then by going through posts in your profile nach (116 pages goddamn you post a lot!) and I cannot find this thread you are referring to.You say try linking them under different names? so all existing libs in /usr/lib/ao/plugins-2/ should be changed, and then I copy my 32 bit libs in there (or change the 32-bit lib names, whichever)? Will this affect any 64-bit programs that use libao? looks like I'm so close to getting this working...
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

dfreer wrote: anyways, so I spent the last hour, first trying several different search terms and then by going through posts in your profile nach (116 pages goddamn you post a lot!) and I cannot find this thread you are referring to.
I searched for libao in subject and nach in author, and only got 5 matches, was easy enough to find.
dfreer wrote: You say try linking them under different names? so all existing libs in /usr/lib/ao/plugins-2/ should be changed, and then I copy my 32 bit libs in there (or change the 32-bit lib names, whichever)? Will this affect any 64-bit programs that use libao? looks like I'm so close to getting this working...
Follow the directions: http://board.zsnes.com/phpBB2/viewtopic ... =75#137039
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Post by dfreer »

oops, It seems I looked in every thread BUT that one because the thread title didn't have 64-bit or libao mentioned. I didn't even think to limit searches to post by you nach, duh.

anyways, works like a charm. seems like I can proceed to package things now, probably include a readme or a default conf file that says to use OSS output and change the sample rate to 48000hz or so for best sound. now to figure that out... thanks for your help nach and deathlike2!
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

dfreer wrote:oops, It seems I looked in every thread BUT that one because the thread title didn't have 64-bit or libao mentioned. I didn't even think to limit searches to post by you nach, duh.

anyways, works like a charm. seems like I can proceed to package things now, probably include a readme or a default conf file that says to use OSS output and change the sample rate to 48000hz or so for best sound. now to figure that out... thanks for your help nach and deathlike2!
use 32000hz if you want to make any audio related bug reports.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Post by dfreer »

i was debating about leaving that option alone, for that reason and because it can be changed easily in the GUI (where as specifying which output/driver to use needs to be done with the -ad switch or by editing the zsnesl.cfg file). but I felt that it was better to make it sound good then to worry about whether the users can make an official sound bug report. they can always change it back to 32000 if needed.
Post Reply