Thursday, November 22, 2007

Music Players and Game Consoles

Long ago, over a long period of time, I wore out my old MP3 player, a Cowon iAudio X5. First its battery life shortened dramatically. Then after severe mistreatment during a long flight, the headphone jack loosened and became very fussy. Only by pushing the plug in a certain way was I able to achieve stereo sound.

Its condition worsened over time, and the final nail in the coffin was hammered in when, in desperation, I opened it up hoping I could readjust the socket somehow. I wound up breaking a wire.

I could solder it back, but what's the use of bringing it back from the dead if it has a run-down battery and a messed-up audio jack? Besides, I now had a great excuse to shop.

I considered getting another product in the same family, such as the A2, but in the end I took a different direction. Two different directions in fact: I wound up buying two MP3 players to replace my old one.

First, some lessons learned:
  • I often just pushed play, and didn't bother fiddling around with the controls. Instead I'd cram it into my pocket, and perform other tasks.
  • The built-in battery was annoying, especially when traveling. I'd have to find adapters and/or transformers, or have a computer around. Not to mention carry a strange, easy-to-lose connector and a power cord.
  • Its utility greatly decreased with its battery life.
  • For some situations it was too big and unwieldy, while for others, such as when reading text files and playing movies, it was too small and unwieldy.
To address some of these concerns, I bought one of those small cheap MP3 player that is little more than a USB SD card reader. It's powered by a single AAA battery, and sports a tiny display and a few buttons. It's perfect for those times when I'm focused on something and want some background music. Instead of playlists, I treat SD cards like CDs, and swap in different cards when I want to change genres.

It's convenient to travel with, due to its low cost and small footprint. Furthermore, AAA batteries are readily available anywhere. As a bonus, it can function as a low-capacity USB thumb drive.

However, there are times when I want to read text files or watch movies on the go, and times when I absolutely must listen to that song right now. I also missed my iAudio's ability to play different music formats, and its ability to run the open source firmware Rockbox.

So on an impulse, I recently picked up a GP2X F-200. It does music and video of various formats, but what really piqued my interest was that it plays games and runs Linux. It has two 200MHZ ARM9 processors, which amuses me because only three desktops ago, my system was a Pentium 200. And in line with my new philosophy, it has an SD card slot and is runs on 2 AA batteries.

I still miss the 20 gigabyte hard drive, FM radio and recording capabilities of my X5, but the GP2X offers more possibilities.

Hello, GP2X F-200
Mainstream gamers no doubt prefer the well-known brands for a hand-held gaming platform, as they have a wide selection of new titles and probably have better build quality. But my priorities are different: I mostly wanted a replacement music and video player, and the GP2X appeals to me thanks to its geek cred.

There is a highly active GP2X development scene. It mostly revolves around simple homebrew games, ports of classics, and emulators, but there are a few commerical games, and some of the freeware offerings are amazingly good.

One such gem is Cave Story, which I found on the bundled CD. I'd never heard of this game before, though it's been available for other platforms for quite some time. As a programmer and amateur game developer, I'm green with envy that one person alone was able to create this marvel.

Soon after my unit arrived, I looked into how the development process works. I followed the Open2x installation instructions at the GP2X wiki (except I placed them in a different directory) but for touchscreen support, afterwards I installed the newest version of the SDL library found on Paeryn's page.

I then set about writing the obligatory "Hello World" program. It's not good enough to print to standard output, because nothing shows up. Instead, I wrote a full-blown SDL program that uses the SDL_ttf library to render a string. Additionally, I had to write a shell script to return to the main menu after the program exits (and also sync the SD card).
Next I augmented the code to experiment with the touch screen, and the result is a simple drawing program. I'm disheartened by many spurious events, though I have a few ideas on how to clean them up. This must be done if I'm to get the most out of this feature.
Green circles represent when the stylus was placed on the screen, and red circles represents when it was lifted, corresponding to SDL's MOUSEBUTTONDOWN and MOUSEBUTTONUP events. As can be seen, there are times when it thinks you've lifted the stylus when you haven't, and a fair amount of jitter, usually in the horizontal axis.

No comments: