Saturday, November 15, 2008

How to run ZSNES Super Nintendo Emulator on 64-bit Ubuntu Linux

ZSNES is my favorite SNES emulator in the Windows world, but it can be a real pain to get going in 64-bit Linux. Most tutorials will suggest you set up a chroot jail and maintain a parallel set of 32-bit libs so that you can run the 32-bit version, but this is both a hassle and overly complex for many users.

I tried to compile my own binaries from source to avoid this, but I kept running into architecture errors and ended up throwing in the towel after a few hours of fiddling. Luckily, a ZSNES developer known as Nach has provided specialized precompiled binaries for a variety of architectures that worked a treat for me.

Just follow this link, scroll down a bit, and then download the binary that matches your architecture. I have an Athlon 64 X-2 4000+, so I selected the Athlon64-SSE3 binary.

Next, install libsdl-dev either through Synaptic or by typing sudo aptitude install libsdl-dev into a terminal.

Once downloaded and decompressed, you should find your binary inside, which you can run by double-clicking it or typing ./zsnes into a terminal. If you double-click and nothing happens, try running it through the terminal to spot any errors. I personally encountered this error:
Unable to poll /dev/input/event8. Make sure you have read permissions to it
repeated 9 times (1 for each /dev/input/event* 0-8).

I was able to get around this by running ZSNES as root (i.e., sudo ./zsnes), which is certainly not ideal, but I haven't found a way around it yet.

If you take this route, be aware that the default location for saved games will not be ~/.zsnes as it normally would be. Instead, it will be located in /root/.zsnes (since you're running as root). This in mind, you may have to copy your .srm files into this directory for them to be recognized. When I first got my copy to run, I couldn't get it to recognize any of my saved files, even though I tried changing the path for saved files under the preferences. However, once I copied the files into the /root/.zsnes directory, everything showed up just dandy.

Using the native 64-bit binary referenced above also had another unexpected (perhaps coincidental) positive effect of making my gamepad's d-pad work correctly. Using dfreer's zsnes32 binary worked well for me in most respects, but it just wouldn't recognize my Logitech Precision gamepad's d-pad. The buttons worked fine, but when it came time to assign the directions, it would just sit there dumbly, even though jscalibrator and cat /dev/input/js0 both showed plenty of action. This problem remained no matter how many kernel modules I loaded (usbhid, analog, etc.), until I tried Nach's binary. Now it works just fine. Go figure...

This information was written for Ubuntu 8.10 Intrepid Ibex, but it should be applicable to other distros as well.

3 comments:

srmatanza said...

thanks man you saved my life!

awanteeeeeeee!

Daniel said...

BTW, the joystick problem you are experiencing is actually the result of using jscalibrator. Why people even install it in the first place is beyond me, since most gamepads work just fine out of the box with no need for calibration.

Anyways, here's some links to threads concerning the use of jscalibrator messing up controller axis, and one contains the correct removal of jscalibrator in order to fix this problem.

Note that sometimes simply removing the USB gamepad and then inserting into another USB port will cause the kernel to register the pad as a new controller, and as long as you don't run jscalibrator on the controller again, it will work fine.

http://board.zsnes.com/phpBB3/viewtopic.php?f=22&t=12253&start=0
http://ubuntuforums.org/showthread.php?t=729049
http://snes9x.com/phpBB2/viewtopic.php?p=25185#25185

Also, as a side note:
Unable to poll /dev/input/event8. Make sure you have read permissions to it
You should be able to simply ignore this error as it has no effect on gameplay. Running zsnes as root, or any program for that matter that doesn't explicitly need root privileges, is as always not recommended.

Hunter K. said...

It's been a long time since I wrote this post, so it's likely that the problems I encountered back then have been resolved by now. In my case, I couldn't ignore the polling errors because they were causing the program to crash before it even loaded a window and running as root--however inadvisable--was the only fix I could find. As for the gamepad issue, my directions were nonfunctional from the start and I only installed jscalibrator to troubleshoot the issue, as I was aware of the horrible issues it can cause. Regardless, none of that matters to me anymore because I found bsnes, which is more stable, more accurate and more feature-filled than zsnes. :D

Analytics Tracking Footer