Wednesday, August 31, 2011

Dynamic subversion repositories with WebSVN

I am a careful man. For every development project, I have a corresponding Subversion repository that stores all assets relating to the project. For browsing (and blaming diffs), I use WebSVN to provide a friendly interface. I currently use DreamHost to host my repositories.

However, I got tired of updating the WebSVN configuration every time I added a repository. Therefore, I developed a short, dynamic method of just listing them all without need for reconfiguration. Add the following snippet to your config.php:

$repository_root = '/CHANGE/TO/YOUR/PATH/svn/';

foreach(glob($repository_root . '*', GLOB_ONLYDIR) as $repository_dir) {
  $repository = basename($repository_dir);
  $config->addRepository($repository, 'file://' . $repository_root . $repository);
  $config->useAuthenticationFile($repository_root . $repository . '.access', $repository, $repository);

Friday, July 8, 2011

Google Music - first impressions of the cloud-based music streaming service

I enjoy listening to music, and keeping my collection synchronized across computers and devices can be arduous. I am fastidious about tagging, using tools like TagScanner to author and normalize the tags, file names and folders. My playback and library needs are minimal; foobar2000 has served my needs nicely for close to a decade.

I wasn't impressed by Amazon Cloud Drive and Cloud Player; their overtly commercial approach (understandable in context), the clunky interface, and limitations of the service turned me off. Amazon has since offered unlimited storage for music if you subscribe at the $20/year level or higher.

Recently, I was invited to try the Google Music Beta, their new streaming music service. Given my previous experience, I was hesitant, but willing to give a competitor a try.


The desktop client download and installation was fairly smooth, except you needed an application specific password. The client linked to the help page that contained in the middle of the content a link to generate that password, which was obtuse. Once I was beyond that, I used the wizard to select a folder to sync, and walked away for the night. The next morning, about 2/3 of the ~5GB folder I had selected had been uploaded.

The next step was to try the android app, which I downloaded from the Android Market. Overall, the interface is nicer than the stock app. I have not tried Bluetooth playback yet.

Android App

Music that had been uploaded was available to be streamed; I picked the first track of an album, and hit play. It churned for somewhere between five and ten seconds, then started playing. Sounded fine. Once you start playing a track, the player will download sequential tracks in the background to avoid this delay. Playback sounded fine.

I tagged and transferred music manually to my android device for a long time before I started using Google Music. When I installed Google Music on my desktop, it uploaded my collection. I installed the app on my device, which correctly listed all the local music along with all the music available to stream.

However, music that was already physically on my device was also listed as available to stream, resulting in two entries for every album and track. This is undesirable, and I shared my feedback with the Music Beta Team.

What happens to your music?

As an experiment, I removed one of the local albums, then downloaded it ("make it available offline") using the app. I used the Wi-Fi connection, and a ~75 MB album only took a couple minutes to transfer.

The music transferred to Android\data\\cache\music with a numeric file name (ex: 534.mp3), a rewritten track number, and missing the embedded artwork, Album Artist, Total Tracks, Disc Number, Total Discs, and Publisher. The tag type was rewritten from id3v2.3|id3v1 to id3v1. The content looks untouched; same number of samples, bitrate, and so on, The artwork is stored separately, in cache\artwork. The file size was nearly identical, in proportion to the missing artwork and tags.

Both the cache and artwork folder have a .nomedia file (tells default apps like Gallery and Music to not index it).

I understand why they are normalizing tag data (save space - especially with album art, and excludes non-standard or unsupported fields), but it's irritating to have two different file versions.

It's not impossible to copy out the music from your android device once it's in there (if you want to copy an album from your device to another computer, for example). You cannot download the music from their web interface. They want you to use their application to listen to it, and they're avoiding the slippery slope of making it easy to duplicate your collection.

I have a guess about why they chose 20,000 songs as the limit; FAT32 directories can contain up to 65,536 entries, and each file/directory uses between 1 and 13 entries (depending on the length of the name), so that arbitrary song limit is well within the technical specification.

Overall impression

Google Music is a strong, interesting contender in the streaming music market; while it's certainly not the most open approach, I am liking Google Music more than the other music streaming alternatives that I'm aware of and it's quite mature and usable. That'll do, Pig. That'll do.