Tag Archive: computers


or, Convincing Oneself is the Next Step Toward Insanity.

I’m not a programmer, dammit. I keep telling this to people who ask, and I keep telling this to myself. Yet, here I am, admittedly flailing about more like a yard-guard scr1pt-k1dd!3 than doing Significant Things, but I’ve written another package for your amusement.

This one also starts with technical difficulties in operating the Top Secret Radio Network. When I built the TSRN website, we were broadcasting over a ShoutCast server hosted at tess.fast-serv.com, and things were very simple. Things remained simple when I spun up a ShoutCast server at rbx.topsecretradio.net to replace tess. Things got even simpler when I moved the website to its new home on rbx as well. Then things sat stagnant for a while.

You may recall my post from last month wherein I described a plugin I’d developed for Exaile to support updating title information on a ShoutCast an Icecast server. I realized at some point last night that while I’d switched the server from ShoutCast to Icecast, I hadn’t updated the website to reflect this change.

The website sports a ticker on the right-hand panel that displays current server information, including the stream title, current track, and listener numbers. The ticker is derived (read: ripped wholesale) in large part from the MusicTicker XML package that I located while trying to find something to handle this function. This package hasn’t been updated in years, but it did what I needed it to do, with a minimum of fussing around with it. The problem: it only deals with ShoutCast XML; if you feed it Icecast XML for an active stream, it gags and dies. I wanted to fix this. It shouldn’t be that difficult, right?

Well, it wasn’t that difficult a fix, really; it only involved me staying up until 0500 beating my head on PHP’s supposedly ‘SimpleXML’ parser (which is, I guess, if you’re a stronger programmer than I am). The end result is the beginnings of a replacement, which vaguely resembles MusicTicker.  It’s not quite where I want it yet, and it only really supports monitoring one mountpoint at a time, but it seems to be doing the trick for the moment. I have some plans to work on this some more in the next few days to handle everything I want it to handle, but it’s in a sufficiently advanced state that I felt okay sharing it with everyone. You can get it here:

git clone http://www.dragonsroost.org/src/iceticker.git

Normally, I would release it under the revised BSD license, but because it’s derived from a GPLv2-licensed work, I’ve released it under the terms of the GPLv3. As usual, there is neither warranty nor active support, but I’ll probably answer short questions about it.

or, Learning to Hate Python One Commit at a Time

Most of the time, I’m content to remain Not A Programmer. After all, I’m not. I studied it for a while, and I know most of the basics, but advanced programming and algorithm studies and things like that just don’t interest me. I like doing things with computers, not trying to make them do things. Unfortunately, I found myself in a bit of a bind.

In my Copious Spare Time, I do an Internet radio broadcast for my amusement and the amusement of my friends. It’s fun, silly, and (now that I’m not trying to do it from 0200-0500 Eastern) relaxing. The problem, of course, is that I don’t operate anything remotely resembling a standard amateur rig for doing this. Part of any broadcast rig is music playback software, part of the rig is the streaming software, and part of the rig is a little widget that updates the metadata on the server with the song title information. A lot of software packages exist that tie all three of these components together in one application, but I don’t like any of the options available to GNU/Linux users.

To compensate for not having a handy-dandy all-in-one package that I liked, I found three separate components that I liked and tied them together with some spaghetti. To handle the streaming, I use a package called Darkice. It’s pretty flexible, and it’s super-easy to use. For music playback, I used to use XMMS, but it was deprecated even then and the development team was busily working on XMMS2, which doesn’t work the same. The last part was the trickiest. Neither Darkice nor XMMS will update the stream’s metadata with the current song title, since it’s not a job either of them is designed to do. So, I ended up digging up a little script called ‘shoutcast-titles.sh’ (available here) that would use a command-line HTTP client to update the metadata. XMMS had a plugin that let you run a command on certain events, and I configured everything accordingly.

Time passed.

I no longer use XMMS for my music; it doesn’t do the job I wanted it to do. I started using Amarok 1.4, and was seriously impressed with its functionality. It was well organized, easy to use, and even extensible with a plugin interface. The problem, of course, is that the plugin available for Amarok to update metadata was for Icecast servers only, and I was broadcasting over ShoutCast. I eventually buckled down and started hacking together a plugin for Amarok that would do the job I wanted it to do, but I never actually completed it.

More time passed.

Amarok got ‘updated’ to the new 2.x branch, and I stopped using Amarok. The new interface is ugly, clumsy, and painfully frustrating to use. I lost all interest in developing plugins for Amarok when I stopped using it as my primary source of aural entertainment. Eventually, though, after much trial and error, I stumbled across a project by people with similar enough tastes in music players to me: Exaile. Exile has most of the features of Amarok 1.4 that I really liked, and though it still has a few bugs, it works pretty well. Too, it’s written with a GTK+ interface, where my primary complaint about Amarok was its reliance on KDE (a desktop environment I would rather pass hedgehogs than use). Exaile also supports a plugin infrastructure, which allows for easy extension of functionality through the use of Python scripts. I hoped dearly someone had written a plugin to handle ShoutCast, or even Icecast, updates, but no dice.

I finally had enough. Last week, I broke down and started hacking together a plugin for Exaile to do what I wanted it to do. It took me a while to get caught up on Python; even simple stuff for most programmers takes me hours to puzzle out and implement, because my head’s just not wired the same way. Also, most of the formal study I put into programming was done with Java, which doesn’t look or feel anything like Python to me. The end result, though, is something I’m actually kinda proud of. I actually successfully produced a working plugin, that does everything I want it to, and even includes a configuration dialog to allow for users to set their own servers. Along the way, I stopped using ShoutCast, and went solely with an Icecast approach, so I dropped the idea of supporting ShoutCast with this plugin, but it works quickly and easily with Icecast, and I’m happy with it.

More to the point, I posted it here on this website where you can download it and use it for yourself. I may be updating it with a README file later, or perhaps even packaging it up, but for now, you can get it here:

git clone http://www.dragonsroost.org/src/updatetitles.git

Just put it in your Exaile plugins directory and away you go.

It’s released under the terms of the Revised BSD license, so don’t expect extensive support, but I’ll answer short questions about it if anyone’s curious.