Monday, February 20, 2012

Linux, OpenJDK, Pulseaudio, Catacomb Snatch, and You!

When I first tried to play Mojang's Mojam game, Catacomb Snatch, I was immediately met with crashing and, consequently, my own sadness. Looking at the garbled errors, I saw that it had something to do with the audio. To make a long story short, it seems that OpenJDK has a bug in it which prevents it and pulseaudio from playing nice together.

I was able to resolve the problem by installing Sun's JRE. I recognize that this isn't a perfect solution, but if you just want to play the game, you might not care where your JRE came from. This is a very well written guide for installing Sun Java on a Fedora/RHEL/CentOS machine: http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-6-on-fedora-centos-red-hat-rhel/ It may be a bit heady if you aren't terribly familiar with Linux, but you should be able to muddle through alright. If you're on Ubuntu, check this out: https://github.com/flexiondotorg/oab-java6

Once I verified that I was running Sun Java, I attempted to run CS again. No crashing! Unfortunately, the sound wasn't working anymore. On a hunch, I tried running it with padsp. My sound now works perfectly. Running a program with padsp is really simple. Instead of typing:

java -jar mojam.jar

I just typed instead:

padsp java -jar mojam.jar

Enjoy playing Catacomb Snatch! (You will, trust me.)