Mame Cabinets – Things learned thus far

Blk and FroggerWe’re about halfway through the whole Mame project hullaballoo, so, since I inflicted my Mame cabinet on Ubercon a week and a half ago, it’s really only fitting I take a few minutes to contemplate the lessons learned so far.

First and foremost, I have no regrets embarking on this whole rigamarole. It’s been a tremendous amount of work, but it’s work that’s resulted in something tactile. I can point to the cabinet and say “See that? I built that. And those folks gaming on it? Yep, they’re enjoying themselves because of my handiwork. Rock on.”

That’s not to say the path hasn’t been without it’s bumps and bruises. None of the decisions I’ve made so far are gruesome enough to regret, but it’s certainly time for a bit of reflection. Lets see what’s working, and what isn’t.

Works

Lets start things out on a positive note. What’s working?

  • Xmame
    Because I’m using an older version of MythTV on deathstar, I’m still using Xmame. In the retrogaming world, Xmame is a dinosaur. Most serious Linux-runners have moved on to SDL-mame, which is more up to date and has had some wonderful work done to it. Having said that, Xmame has behaved swimmingly for running my games. I will certainly migrate away from it to SDL mame soon, but for the time being, it’s working great.

  • I-Pac from Ultimarc
    Originally I was going to hack in the console controllers using USB-based gamepads modified for the pushbuttons and joysticks. But after thinking about it, using a $39 iPac keyboard encoder seemed to be by FAR the path of least pain. The board arrived, and was up and running in no time. In the basic configuration, it’s awesome (and they even have a USB version now. Double-bonus).

  • Plywood
    I had my misgivings about using raw plywood on the cabinet. However, it’s working out remarkably well. Cheap, easy to build with, quick to assemble. Once the entire cabinet is done, I’ll sand, paint, and finish the surfaces so they’re less rough on the skin, but all in all, I’m pretty happy.

  • Panel layout
    I was very nervous about this one. I came up with my own joystick / button panel layout, after looking at various ones online. It’s not a massive variation from standard 6-button + JS arrangements, but it was also not from any known template. Single player and dual player gameplay worked just fine, with the joysticks and buttons and other controls all working the way they should, and players being comfortable with where everything was.

Needs Improvement

Since the project is only halfway done, what’s really on my mind are the things that don’t work so well. So here’s my punchlist of stuff I want to work on…

  • deathstar
    This makes me sort of sad, but I have to really take it into account. deathstar has been my all-around mythtv / retrogaming box for several years now, and it’s showing it’s age. It’s a mere Athlon 1400, and the larger games were not running well on it. That, combined with it being a full size chassis (heavy!) means that there are better options for the brains of the box. A new machine is really needed

  • Mythgame
    This is the component in MythTV that is used for playing retrogames. In theory, it has a nice GUI interface that allows basic menu navigation, even using the joystick and buttons. In practice, it works VERY poorly. Keystrokes were misplaced, the menus were hard to navigate, and searching through large game lists was nigh on impossible. There are several other Linux front ends kicking around on the net, it’s time to explore the others.

  • 4 way Joysticks
    I picked up the standard el cheapo 4 way microswitch based joysticks off ebay. They’re.. okay. I can feel the springs already wearing out on the left hand controller (it now has ‘slop’ in the neutral position). I’ll need to replace them with 4 / 8 way joysticks with a restrictor plate at some point.

  • Cabinet stability
    If anything pointed out that an arcade cabinet needs to be stable, it’s schlepping the whole thing to a convention and back, and letting others bang on it. The cabinet needs to be SOLID. The current incarnation is getting there, but I’ll need to pay more attention to stability.

  • Monitor size
    I used a spare 15″ LCD monitor, sitting on the cabinet, for gameplay. While this was ‘okay’,it missed a lot of the arcade experience. A 19″ ‘high mounted’ display, which I’m planning for the upper part of the cabinet, is definitely going to be the way to go.

All in all? I’m reasonably happy with the progress. I can see where I need to improve things, and see where things are working. I’m still playing games on it and enjoying it, but I also want to improve and expand it. All good traits, I think.

It’s 8AM, and you are…listening…

… to rain.
This week has me down in New Jersey visiting my client. These visits are invariably very productive, very tiring, and very important in maintaining an even keel and a steady course on the work that’s being done. (I blame the rain for all the nautical references. Hopefully it doesn’t carry over into my drive to the office). The visit is pretty much a repeat of the other times I’ve been here. The seasons just keep changing, so sometimes it’s hot, sometimes it’s snowing, today, it’s rain.
One thing that has struck me is that I’m actually commuting to work. Up in the morning, do my morning stuff, pack up, drive to the office, do that stuff, then drive back to the hotel. It’s a short commute, only about 9 miles (I keep saying I’ll bike to the office some day, but haven’t yet), but it’s far more of a commute than I have when I’m at home. I’m still not sure about which one is better for me in the long run, but the variation lets me have perspective on it.
In a year, there’ll be a whole new living situation, so it’s not like we’re in a long term situation with the commute. There’s change-a-comin.

Zorching Memory Leaks. I Am Teh Stud

Tonight, I am Da Man.

It’s rare I get to sit down and see, so directly, a problem in the code I’m working on. In this case, while running at Ubercon the other weekend, I noticed that CONGO was showing every sign of a memory leak. After a while I’d get sluggish performance, and eventually I’d get an OutOfMemory error from the JVM. Didn’t look good.

This had me in somewhat of a panic, since Arisia is right around the corner, and I need the system stable and useable for the event. With the help of the wonderous tool that is JConsole, I was able to actually see the memory usage going up in the JVM as I worked with the server. There was definately a problem.

It turns out my hastily set up code to handle changes to my JDBC driver was not being handled correctly. Apparently with the old mm.mysql driver, SQL handles were automatically closed at the end of use. With the new Connector/J driver from MySQL, you had to explicitely issue a close() statement on any Statement, or the handle would never be freed. This was probably always the case, it was just my sloppy code and a twitch of the old driver that made it never come up.

Unfortunately, this necessitated changing just about every SQL call in the server, all 10,000 lines of it. It was long, painful, boring work. I had some help from blk, but it still took a good week of off-hour fiddling to finish the changes and do some basic regression tests.

Tonight, I made the last set of changes, did some basic runthroughs, and didn’t have a single crash. With someone trembling fingers, I started up JConsole again, connected to the application server, and started working with CONGO. Registrant lookups, reports, modifications, creations, subscriptions, convention detail editing – throughout it all, JConsole happily continued showing the normal ‘sawtooth’ pattern of memory usage. Things would get allocated, used, and then the garbage collector would come along and reap the memory.

Success! I had successfully searched for, found, and fixed a major memory leak that was persistent throughout the code.

For those insisting on the details, here’s a properly structured, Prepared, and appropriately exception-managed call to get a number from the database. (And, before I get abusive comments all over the place, the Exception handling here is VERY POOR, and will result in a clean result coming back from the method, even though the call may have crashed. I know, thank you, now go away).

private static int calcRegistered(int cid, String typeName) {
PreparedStatement p = null;
ResultSet rset = null;
String sql = "SELECT count(*) AS total FROM reg_state " +
"WHERE state_cid=? AND state_regtype=? " +
"AND state_registered=1";
int value = 0;
try {
p = cserver.Conn.prepareStatement(sql);
p.setInt(1,cid);
p.setString(2,typeName);
rset = p.executeQuery();
if (rset.next()) {
value = rset.getInt("total");
logger.debug("tcalcRegistered: count for conference '" + cid + "', type '" +
typeName + "' is --: " + value);
}
}
catch (Exception e) {
dumpException(e);
}
finally {
try { p.close(); }
catch (Exception e) { dumpException(e); }
}
return value;
}

I feel all geeklystudly.

Next is to start seriously hammering away at the buglist, and get a test environment set up so other CONGO users can test out the new Merge function against ‘real’ data. If all goes well, we’ll roll this version into production in time to run Arisia.

Oops :(

IMG_1468.JPGI have a lot of laserdiscs. Last count had it around 210. Since we moved almost 2 years ago, about half of these were stored in the basement in what I thought was a stable box.
Well, it wasn’t.
Apparently the box had shifted and moved around a lot, and ended up with the discs leaning over on one side, where they stayed for a year. The end result is I now have a dozen or so burrito shaped laserdiscs.
I’ve reconfigured the stack, and owing to the fact that laserdiscs weigh a helluva lot, I’ve placed the ‘bent’ discs interleaved at the bottom, and placed the rest on top of them. Hopefully this will restore some sort of flatness.
If I have to write off the bad discs, it won’t be the end of the world. Most are available now on DVD (and have the benefits thereof, like better resolution and added features and stuff), but I don’t like having to replace movies I already own.

Yawl gets a new face.




New Desktop

Originally uploaded by eidolon

Investing in hardware for my workspace is always hard, particularly when it could easily be interpreted as “Oh, that’s just for FUN.”

But with the price of LCD monitors dropping, it was time to take the plunge and replace my 17″ 1280×1024 monitor with a Dell 2001FP 19″ 1600×1200 version. Ebay helped me find one for just a hair under $200, and a few days later, here it is.

Gutsy on yawl was very easy to reconfigure, using the nvidia-settings tool to generate a new Xorg.conf file (it was ALMOST pointy clicky from beginning to end, the only thing I had to do manually was copy the Xorg.conf file into place.

I’m already comfortably settled into the idea I’ve increased my desktop area by about 30 percent, but occasionally I find myself wondering at all this great real estate.

Can’t go flying? How about the next best thing.

I have a strong attraction to flight, in all it’s forms, but I feel the strongest attraction to things that are the closest to free flight… it’s one of the reasons I’m very interested in soaring – it’s as close as I can get without actually growing wings.
But, what if you can’t fly yourself… How about flying models? Okay, that’s fun, but you can’t actually get IN the plane and fly it around.
Or can you?
[youtube http://www.youtube.com/watch?v=K2ezJKQa2Us&rel=1]
This was linked from all over the place, but today’s reminder of it came from Hackaday.

Photo Managers – Digikam rocks

Today I am full of Mad Love for DigiKam, the photo manager distributed with KDE. I’ve been using it off and on for a few years, and for one reason or another, I would stray away and use manual file copies for a while.
As of about a year ago though, I’ve moved to using it full time for managing the (sometimes hundreds) of pictures I take in a given session. There’s a whole slew of wonderful functions in it, but the ones that made me finally stick with it can be summed up as follows:

  • Automatic directory creation and sorting when importing from the camera. Directories can be created according to the date the picture was taken (importing 250 pictures from my camera may make 4 directories, if I was shooting over several days)
  • Direct support for my Canon 400D. When I plug in the USB, KDE prompts me to start Digikam, and everything is imported.
  • Full support for Exif data, including image orientaton, etc. Exif data is never removed or ‘flushed’ from the images.
  • Excellent export functionality to either Flickr or to a series of HTML files and thumbnails.
  • Very good gallery organization, sorting, and previewing. I can work with thousands of images and sort them into appropriate directories.
  • Tagging allows sorting and categorizing of images without reordering the directories. Searching for tags, dates, or other data generates a new view based on the tag criteria.
  • Easy calling of external programs such as The Gimp for post-processing.

All of this, combined with, well, it LOOKS great, make Digikam one of my favorite KDE apps.

Deep Breath.

Aaaaand, we’re back.
What an insane couple of days. There’s a whole series of posts brewing in my head right now, but I’ll just touch on probably the one that’s most on my mind.
Last week, I was in mid-preparation for Ubercon, an awesome gaming convention I regularly work down in NJ. CONGO has been pretty idle for the last few months as the summer is not a big time for conventions. With a week to go until Ubercon started, it was time to pull out all the hardware and make sure everything was working.
Well, unsurprisingly, it wasn’t.
The first major issue was coming to the conclusion that endor, the venerable server of dozens of conventions, really wasn’t going to handle Yet Another Apt Upgrade. It was still running on a baseline Debian Sarge install that had been upgraded a dozen times over the years, and finally, after enough apt tweaking had gone on, a dependency just wouldn’t resolve, and the machine would not take new upgrades. It was time to nuke from orbit and reinstall the OS from an Ubuntu baseline.
No problem, sez I. I whip out my Gutsy Gibbon Ubuntu CD, do a quick database dump and backup, install Ubuntu, and restore my home directory and databases. Reinstalled CONGO, loaded the working databases and…
stopped.
See, CONGO was my first big Java application. And as such, it has some… intriguing ways of doing database work. And by ‘intriguing’ I mean butt-ass stupid. In particular, not using PreparedStatements for SQL commands, not checking for failed transactions, etc etc. While this was okay for a fairly static application, once you replace the entire OS underneath it, things start to get a little squirrely. And, well, we had squirrels aplenty.
So over the space of 3 days I basically had to rewrite every SQL interraction in CONGO, resulting in some fairly major code changes, and all of this 3 days before a con.
Add on top of this the fact that I’m also using a brand new printer from Evolis for the first time under Linux. There’s a whole nother post about this experience, but it did bring yet another variable into play. Oh, and did I mention that I rewrote the print routine in CONGO to generate PDFs on the fly and use them for badge rendering? Yep, also new.
Needless to say, things were a little panicy leading up to the event. Fortunately, by Wednesday afternoon, I had things fairly well stabilized, the code worked, endor was stable and functioning properly, and I could start packing for the event with a clear conscience.

The end result? It all worked. The convention went fine, the printer behaved wonderfully, running badges twice as fast as my old Fargo printers, and we had only minor glitches through the weekend. There’s still some work to do to get endor ready for larger events, but for a week that started out with totally broken software, an unuseable server, and an untested printing system, things went mighty well.
Onwards.

Mame Cabinet, continued.




IMG_1239.JPG

Originally uploaded by eidolon

Well last night I put in some time to assemble the frame for the pedestal. This is the bottom third of the cabinet, and will contain the PC and other hardware necessary.

It’s pretty solid (and heavy) at the moment. Once I fabricate the front and rear panels, it’ll be ready for hardware to be installed. I hope to do one of the panels tomorrow before I leave for Ubercon, so it’ll hold up for the event.

This whole project has been quite therapeutic for me. It’s getting me to get up from behind my desk and go down and work in the shop. My shop is cleaner and more organized than it’s ever been, and I feel like I’m accomplishing something. On the one hand I’m looking forward to showing off the end product, but on the other hand, the travelling the road has been rewarding in it’s own right.

Thank you Sun and Ubuntu!

… and the cast of thousands that made installing a Sun JDK onto Linux as simple as:

root@endor:~# apt-get install sun-java6-jdk
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
gcc-3.3-base java-common libstdc++5 odbcinst1debian1 sun-java6-bin sun-java6-jre unixodbc
Suggested packages:
equivs binfmt-support sun-java6-demo sun-java6-doc sun-java6-source sun-java6-plugin ia32-sun-java6-plugin sun-java6-fonts
ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming libmyodbc odbc-postgresql
libct1
Recommended packages:
libxp6 libnss-mdns gsfonts-x11
The following NEW packages will be installed:
gcc-3.3-base java-common libstdc++5 odbcinst1debian1 sun-java6-bin sun-java6-jdk sun-java6-jre unixodbc
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 42.3MB/43.1MB of archives.
After unpacking 128MB of additional disk space will be used.
Do you want to continue [Y/n]?

For those on the sidelines, Sun has not been particularly forthcoming regarding a licensing arrangement that makes the RMS-ites at least mildly comfortable with automating an installation. In point of fact, I believe Debian is still uncomfortable with the whole license arrangement, though they do have it in the non-free repository.
Up until recently, getting Java onto a Linux box was, well, not difficult, but certainly not trivial. I’m happy to say it’s gotten as easy as installing any other package, which, with current package managers, means it’s a breeze.
Yay progress.

Of Systems and Services, Mame and Madmen…

It’s been a challenging few days here at Chez Geek. In true journal fashion, here are the highlights, because I know my devoted readers are sitting on the edge of their seats, waiting for every geeky installment of my daily encounters with recalcitrant hardware, misconfigured servers, and twitchy environments.
Ahem.
Of Mame
Mame console underneathOn Friday night I finished wiring the console. I’m short a half dozen buttons, so some functionality is missing, but I really wanted coin drop buttons. I picked up a couple small single-throw pushbuttons I had lying around, and wired them in with duct tape, so now I can ‘drop coins’ to get credits just by pushing a button on the console. Looks like ass, but it does work. I’ve ordered the new buttons, and they’ll arrive in a couple days, and I wanted to play games NOW.
There’s a whole post about things I’m learning regarding building a Mame cabinet, but that can wait. For now, I’m using deathstar, my MythTV box, as my ‘mame front end’. MythGame is “okay” as far as interfaces. Mostly it’s “okay” because it’s actually working correctly, and works with the controller. I’m hoping to haul the entire setup to Ubercon this coming weekend, so minimizing fuss is a big win.
Of Stonekeep and Conventions
Next weekend I’ll be down at Ubercon in New Jersey. This of course means I need to get most of the CONGO system up and running to run badges. Unfortunately, endor is not behaving. After almost 4 years of constantly apt-getting and updating packages on it (Starting from a Debian ‘woody’ install), a series of packages failed miserably during an upgrade (I haven’t really worked on it in about a year), and has left it in an unuseable state. I’ve backed the data off it, and reloaded Ubuntu Feisty Fawn on it. There’s a bunch of configuration that still needs to be done, and that’s making me nervous so close to an event. At least the install seems to have completed cleanly.
Those are the two primary things on my mind these days. Oh, and in the background is ongoing Java work and the slow moving ahead of Mosaic Commons, but that’s sort of the ‘steady noise’ bits. I’m just covering the highlights right now.

Fall in Massachusetts




IMG_0898.JPG

Originally uploaded by eidolon

I do love the fall, particularly when it gets cool enough to really enjoy the outdoors. Hiking in the woods is one of the best ways I have of unwinding.

I took the new camera along and spent some time outside Callahan State Park, in Sudbury, and found the colors just fabulous. By this time of day, things had gotten overcast, but that certainly didn’t make it any less enjoyable.

Audacity Ate my Konqueror

I’ve been having a problem in KDE for the last 6 months or so (perhaps longer, I’m not sure). On the face of it, it seemed like a standard file association problem, but it was pervasive.
Recently I switched to using Konqueror as my primary web browser. With the advances in plugin support for things like Flash and Shockwave, the actual browser platform has become less important. Since I switched away from Firefox, I’ve been using Konqueror and, for the most part, things have been pretty good.
Except for one annoying bit.
Because I’m a developer, I have to, on occasion, do the ‘View Source’ thing from inside my browser to see how the HTML, CSS, and JavaScript in a page I’m working with is put together. For some bizarre reason, Konqueror had decided that when I selected View Source, it would try and open the source in… Audacity.
Now, I’m all for great programs like Audacity. It’s a fantastic multi-track audio editor. But in no way, shape, or form is it a source code viewer.
This afternoon I finally sat down to try and figure out what the heck was wrong. Konqueror has a great tool for associating various file types with helper applications (something old time users of Mozilla are very familiar with), but the sheer number of associations is staggering. And since I didn’t know what type was that was causing the external app to be launched, I didn’t know which one to look for.
I got my first clue when I noticed that Konqueror had associated .py (Python) files with Audacity. “Aha!” sez I, “That’s not right!” – I started to change the association, then went “Wait, I don’t want Audacity started ever. Just remove the helper.” Which confronted me with the dialog box stating that Audacity had been attached to text/plain and could not be removed.
Another clue! Navigated to text/plain, saw Audacity listed in the helpers, and promptly moved it down to the bottom of the list (Okay, maybe someday I’ll want to use Audacity. Allow me my foibles.) Clicking Apply and then trying a view source finally got me… the source!
Note that this entire problem was solved inside KDE without resorting to editing configuration files, typing cryptic commands, or knowing esoteric and mystical Linux incantations. It was a misconfigured browser, nothing more. In the good old days this would have required said gyrations to fix, but I’m constantly impressed at how far environments like KDE have come, making problem solving like this a lot more intuitive.