The trials and tribulations of finding a Linux media player

I’ve been using Linux as my primary desktop OS for roughly five years now and things have come a long way since my first experiences with Fedora 10 to my current Kubuntu 13.04 setup. One of the long term things about Linux that bugged me was the lack of a decent music player. Everything I used was either half-baked and full of bugs, had a confusing interface (I’m looking at you Amarok), or lacked the functionality any media player should have.

  • 2008: iTunes running via Wine (lasted about a week)
  • 2008: Songbird (until support for Linux was dropped)
  • 2009-2010: Switching between Banshee and Rhythmbox when I got tired of dealing with the other’s little quirks
  • 2011-2012: Clementine
  • 2013: MPD with Cantata as the primary front-end

When I first switched from the Windows world, I tried to keep using iTunes with Wine since it was convenient to sync my then iPod video with, but most importantly because only iTunes could play the encrypted, DRM-protected music I had bought from the iTunes store. Thankfully the dark days of encrypted music are gone, but that was after I took on the task of stripping the DRM from all my music so I could use it with a native Linux client.

At the time, the closest software to iTunes for Linux was the Songbird project. Songbird had a very similar UI and had support for addons which made it, in my opinion, better than iTunes. However, this was around the time that the Songbird people decided to drop support for Linux in order to focus on Windows and OS X. Time for me to find a new music player.

For two years I switched back and forth between Banshee and Rhytmbox every few months or so hoping that one would have dramatically improved in that time so I could finally settle on a music player. This never happened. Rather, in 2011, I found Clementine, a fork of Amarok, but with a UI that made sense! Clementine had a few things that didn’t make sense to me, like having to explicitly save a playlist after adding a song to it (it can’t at least have the option to autosave?), but I did like the developer’s sense of humor by adding a Nyan cat music visualizer and a hypnotoad sound.

Asimov: Building an interactive robot with an iRobot Create and a Kinect

The CS program at my university requires all students to complete a group project of their choosing during the required software engineering course known as the senior design project to the wider college of engineering. My group consisted of 5 people with the goal of using an iRobot Create (like a Roomba, but without the vacuum) and a Microsoft Kinect to create a robot that would take gesture and voice commands and follow or avoid a person. The finished product looked as such:

From a hardware point of view, the robot consisted of three major components. On the bottom is the iRobot Create and sitting on top of it was a Windows 8 tablet used and a Kinect. The Kinect talked to the tablet which ran our software to interpret the data from the Kinect and then send the appropriate commands to the Create. Therefore, the resulting software stack was as follows:

Encrypted chat with Python, M2Crypto, and NCurses

A couple of weeks ago I realized that there isn’t a simple way to communicate with someone over a strongly encrypted channel without going through an intermediary server when at least one of the parties is not a very technically minded person (there probably is such a such a thing, but I don’t know of it). I wanted to be able to perform basic chat with someone that doesn’t know anything about cryptography and do it without having both people connect to a server. Rather, I wanted a simple server that I ran and sent a friend a simple binary that would ask the hostname of my server and we could chat securely.

Enter my new project, Cryptully. It’s a simple Python application that allows for AES encrypted chat for people that don’t know anything about crypto. As of the time of this writing, the project is at its first milestone. That is, it has a basic Curses UI with asynchronous chat and, of course, everything is encrypted.

The project is pretty straightforward right now, but let’s look at the a few components. First, the crypto functions that encrypt and decrypt data between the server and client with AES.

def generateKeys(self, bits=2048):
    # Generate the keypair (65537 as the public exponent)
    self.localKeypair = M2Crypto.RSA.gen_key(bits, 65537, self.__callback)

    # Generate the AES key and IV
    self.aesKey  = M2Crypto.Rand.rand_bytes(32)
    self.aesIv   = M2Crypto.Rand.rand_bytes(32)
    self.aesSalt = M2Crypto.Rand.rand_bytes(8)

The generate keys function is generates an RSA keypair using the M2Crypto RSA key generation function. Then, it generates a 256bit AES key by pulling 32 bytes from the kernel’s urandom source. The same process is done for the IV and salt (except the salt is only 8 bytes).

libBiscuit: A simple iRobot Create C API

For my senior design project at my university, my group and I decided to attempt to make a robot out of an iRobot Create, Windows tablet, and Kinect that would find a person and follow him or her around a room and allow the person to control the Create with gestures and speech recognition. We called all this Project Asimov, and at the time of this writing, it’s still under development. However, one of the first pieces of code that needed written was an API to more easily interface with the Create. Thus, after some experimentation and a thorough reading of the Create Open Interface, I had a working API written in C called libBiscuit. Why? Because the Create sort of looks like a biscuit and I like biscuits.

Anyway, first up, all the code is open source and on GitHub under the LGPL. Moreover, a quick overview of the functions, compiling instructions, and basic usage are in the README in the GitHub repo so I won’t repeat all that here.  However, here’s a short example program that uses libbiscuit to control the Create.

StairLights: An Arduino-based LED stair lighting project

I’m a big fan of LED lighting; especially interactive LED lighting so over the past two or so months I was working on a little side project that uses an Arduino Uno to read two IR receivers for beam breaks at the top and bottom of my stairs and shows an LED pattern while the person is walking up or down the stairs. All the code is open source on GitHub under the LGPL.

First, here’s the finished product in action: