Taxes, painting and stuff

It’s been a while since I wrote anything here, mainly because I have been swamped at work, getting ready for a presentation next week at Educause, my first foray into public speaking since, oh, 1995 or so. That was back in the days of transparencies, so it’s been a while. And I do have to say, there are much better tools around for preparing slides nowadays. But anyhow, it’s been pretty all-consuming writing up this presentation, and by the time I get home I haven’t been much in the mood to write anything else.

Interesting tax-related development here in the People’s Republic of Maryland. It seems that the legislature has raised the personal exemption amount for 2008 a whopping 33%, from $2400 to $3200. This is the first time Maryland’s personal exemption amount has changed since 2002, when it rose from $2100 to $2400. Apparently this is the legislature’s way of providing relief to the “working families” they are always harping about. This is in contrast to the governor’s original plan that would have widened the lower-income tax brackets, and being a flat tax advocate, I think it’s a better idea, although it benefits fewer people. For a typical family of four (like us.. imagine that) this results in $3200 less taxable income in 2008 than in 2007. Maryland has also completely overhauled how they figure payroll withholding. For me, that resulted in about $27 less state tax being withheld from my paycheck. This seems like a lot. According to my handy spreadsheet, an exemption amount of $3200 would have resulted in $254 less in taxes owed in 2007. Extrapolating the $27 withholding difference out to 26 paychecks results in $702 less tax withheld in 2008, leaving me $448 in the hole. There must be something I’m missing here, or I’m going to have to tweak my withholding exemptions again.

In other, less exciting news, we are finally getting ready to paint the master bedroom, several years after buying the paint. In preparation, I’m putting in a new phone jack. The original jack was one of those “woodwork warts” that was surface-mounted to the trim. I hate these, so I’m getting rid of them as we paint the rooms, in favor of flush-mounted wall jacks. This will be the first phone jack I’ve rewired, so I’m going to do it right and use twisted-pair cable with a Leviton “QuickPort” punch-down type jack. In the basement, I’ll install either a patch panel or a 66-type punch-down block (haven’t decided which yet) and splice it into the old quad-conductor cable that makes up the rest of the house’s phone wiring. Then as I replace jacks down the road, I’ll replace the quad with Cat-5. Doing this might improve our DSL speeds, too.

Card Reader

So, for the past year or so I’ve been using my Palm Tungsten E2, with 1-gig SD card and headphones, as a portable mp3 player, because it’s there, and it works. It’s actually kind of cool — I can play games, read e-books, etc. on the Palm while listening to music. It’s quite the thing if you want to completely tune out everything around you. Yeah, the Palm-as-mp3-player thing leaves a bit to be desired — the bundled player software (RealPlayer) sucks, and there’s a constant background hiss reminiscent of my old 1980s Sony cassette walkman. Quite nostalgic, but this is 2007 — but like I said, it works.

Up till recently I used a software package called Softick Card Export II to copy music to the SD card on the Palm. It’s a nifty package that makes the Palm emulate a USB mass storage device (one wonders why the Palm doesn’t do this out of the box, but I digress). And it works, but it’s e-x-c-r-u-c-i-a-t-i-n-g-l-y slow. It takes, like, 20 minutes to copy a couple of CDs worth of 192kbps mp3s to the card. You have to wait forever for the initial copy to happen, then wait forever again for the data to “sync” to the card, so you can remove it safely. I grudgingly dealt with this for a year or so, because I figured that’s just how it was with these things. Then this past Christmas, the wife got a dedicated flash-based mp3 player. And while playing around with it, I couldn’t help but notice that file transfers to it were light-years faster than transfers to my Palm through Card Export. And I began to think, well, maybe it’s the Palm and the software-based USB storage emulation slowing things down for me. So, I went to Best Buy and paid $15 (a buck less than what I paid for Card Export, BTW) for a USB SD card reader/writer. And indeed, it’s absolutely light-years faster than Card Export.

When I initially bought Card Export, I figured a card reader might be a little faster, but I had no idea it would be this many orders of magnitude faster. Live and learn I guess. I’m not knocking Card Export here, as it definitely has its niche, but it looks like the card reader is the way to go for larger transfers.

mp3act hacking

9 months or so ago, I installed mp3act, a PHP-based online MP3 streaming server. I’ve found that I really like it, but like everything else, it would be oh-so-much cooler with a few little tweaks. Development on it seems to have stagnated (no releases since mid 2005), so I’ve decided to hack on it a bit to make it do my bidding. So far, I’m really happy with the results.

Here are some of the issues I’m trying to address:

  • mp3act doesn’t deal well with albums containing multiple artists. It breaks each unique artist out into its own separate album. So for example, if you have an album called ‘great songs’ containing songs from artist a, artist b, and artist c, mp3act will create 3 albums called ‘great songs’, each containing songs from one of the three distinct artists. This is not what I want.
  • mp3act doesn’t handle artist sorting very well. If you have an album by Tom Petty and the Heartbreakers, mp3act displays it under ‘T’. If you want it correctly filed under ‘P’, the mp3 would need to be tagged ‘Petty, Tom and the Heartbreakers’, which again, is not what I want.
  • mp3act’s search and download features are a little lacking. The search results page allows you to play and/or add songs to playlists one by one, but there’s no ‘play all’ or ‘add all to playlist’ feature. And, it only allows downloads of albums. A ‘download playlist’ feature would be really useful.
  • With multiple-CD sets, if the songs on multiple discs are grouped under the same album name, mp3act will interleave the tracks together (disc 1 track 1, disc 2 track 1, disc 1 track 2, disc 2 track 2, …).

There are a few other little things, but those are the biggies. I’m taking a two-fold approach to dealing with these: tweaking the mp3act database tables for some, and tweaking the mp3act PHP code for others.

mp3act’s database schema is simple and easy to understand. It has a few quirks (biggest quirk: the year field is associated with albums, when in fact, it should be associated with songs), but I’ve found that I can get a lot done just by importing music into the database, and then going through manually and tidying things up. Specifically, I’ve corrected the multi-artist album problem and the multi-disc track interleaving problem this way.

To reconstruct a multi-artist album, first find all of its parts:

select * from mp3act_albums where album_name like '%name here%'

Note album IDs, which are typically consecutive. Then create a new artist, if necessary, for the album:

insert into mp3act_artists values(null, 'Various Artists', '')

Now create a new album:

insert into mp3act_albums values(null, 'name here', last_insert_id(), 'genre here', year, '')

Then, using the album IDs from the first query, re-associate songs with the new album:

update mp3act_songs set album_id = last_insert_id() where album_id between low id and high id

And finally, delete the old, no-longer-used albums.

delete from mp3act_albums where album_id between low id and high id

That’s it. Now, this works great, but it does introduce a couple of problems. First off, when you browse to one of these albums, it doesn’t show the artist name in the track listing. And secondly, there’s now no way to browse to the individual artists that make up the album (unless you have other albums by those artists). The first issue is a quick, easy fix to the PHP code. The second is more complicated. For this one, I added a separate ‘browse’ option that browses songs by artists, instead of albums. It was a bit of work, but not too bad.

And so it goes. Here’s a summary of all the changes I’ve made so far.

  • Fix database to deal better with multi-artist albums
  • Fix database to deal better with multi-cd track ordering
  • Show artist name in track listing for album/song browse
  • Add ‘browse for songs by artist’ feature
  • Create custom genres for some albums. This is easy to do and you are not limited to valid ID3 genres, which is nice, because they suck.
  • Modify ‘browse for albums by artist’ to not show artists with no corresponding albums
  • Fix artist sorting issue by adding ‘sort key’ field to albums table, and modifying artist entries where the sort key is different from the artist name

mp3act works very well for me with these changes, and the framework has the potential to do a lot more. Over time I’ll keep hacking on it to add features and improve its operation.

Followup… My next big “to do” is to make the album downloads more flexible. mp3act handles downloads by building a zip file on the fly, then sending this to the browser as an attachment. But the zipfile library it uses (which is included with the app) is kind of bare-bones, and it requires the mp3 library to have a certain directory structure. Looking at this library, it’s easy to see why downloads are not as flexible as I would like. Fortunately, PHP 5.2 now includes a much nicer built-in zipfile library, so the first step is to modify mp3act to use this. At that point, I should be able to greatly improve the download functionality.


Totally OT… I got my Maryland state tax refund today — 48 hours after I filed with iFile. Can’t beat that turnaround time.

And, I’ve found a promising app for cataloguing and streaming my MP3 collection: mp3act. It’s a web based app that uses PHP, MySQL and Ajax. Setup was pretty straightforward. When I started out I had Apache, mod_php and MySQL already installed and running. It went kinda like this:

  • Download mp3act and untar under my Apache document tree
  • Create mp3act MySQL database:

    mysql> create database mp3act

  • Create mp3act MySQL user by adding appropriate entry to “users” table
  • Edit mp3act config file to tell it how to connect to the new database.
  • Point browser to mp3act config URL
  • Wonder why it doesn’t work. Scratch head.
  • Install PHP4 MySQL module (debian package php4-mysql). Works now.
  • Configure app and import my music library.

Initial impressions: Seems nice, Ajax interface is quite slick. It has a few quirks; for example, if an album has multiple artists (for example, a tribute album), mp3act doesn’t display it as a single album. It breaks everything out separately by artist and album, so if the album has 10 different artists, mp3act displays it as 10 albums with 1 track each. I wonder if there’s a workaround for this; will have to investigate. Also, it won’t import a file without an album tag. This causes some problems with singles, which don’t necessarily have albums associated with them.

Quirks aside, this looks like a great tool and I’m going to continue to play around with it. Supposedly it can use the web services API to download album art too. I’ve signed up for an web services ID so I can try that out. Stay tuned (pun intended)..

Followup: Still playing around with this. It definitely works better when all of the MP3s are tagged properly and consistently, so I’ve been slowly working through the collection doing this. It has another quirk which affects multi-CD sets; if you rip each CD into its own directory, say “Beatles White Album/disc1” and “Beatles White Album/disc2”, and number the tracks separately for each disc, mp3act intermingles the tracks when it displays the album. So, you see disc 1 track 1 first, followed by disc 2 track 1, then disc 1 track 2, disc 2 track 2, etc. One way to fix this would be to just eliminate the separate directories for each disc, comingle all of the tracks, and number them all sequentially. However, I’m wondering how hard it would be to hack the mp3act code to improve its handling of these kinds of albums as well as albums with varying artists. I may take a peek at the code to see how much trouble it would be.

Digitizing our music library

Over the past year or so I’ve been slowly converting all of our CDs to MP3 format and putting them on the computer. Various things are motivating this project:

  • Convenient access to music at work, where I listen to the most music, and on my Palm, which I take to the gym and use as a poor man’s iPod.
  • Organizing our music collection and freeing up space. Our CDs are currently strewn all over the house, some of them sorted in racks, some of them unsorted in racks, others just lying around loose, etc. With the music all on the computer, the CDs could be boxed up and put away, where they’d take up less room and wouldn’t get lost.
  • Giving new life to our old shelf stereo system, where the 5-disc CD changer is slowly dying. It has an aux input where we could plug in a digital music source.

There are a few challenges with setting up a digital music library. The first is disk space. I’ll be addressing that by buying a 250 or 300 gig hard drive, which should easily hold everything. Then the digital music must be organized, made available, and distributed to the various places where we will listen to it. Currently, I organize my MP3s loosely by category (classical, pop/rock/jazz, childrens, soundtracks, etc) and then alphabetically by album or song title within those categories. Distributing the music is the biggest challenge. With the music on a Linux server, there are a lot of ways I can make it available: SMB, NFS, HTTP, you name it. Apparently I can even set up an iTunes compatible server, which could be very useful. Of course, the music can also be played directly through the computer’s sound card, or burned onto ISO9660 CDROMs. But the real question is, how do we get this music from the server, to the living room stereo, the kids’ rooms, the kitchen, etc., in a way that is user-friendly and doesn’t cost megabucks? That is a great question, one that I’ve been pondering off-and-on, and is sure to be the subject of a future entry..