profile for Perette at Stack Overflow, Q&A for professional and enthusiast programmers

Devious Fish
pianod History

Pianod History

pianod started in 2012 as a Pandora music client for home automation and multi-listener environments. With a line-oriented socket interface, the player could be controlled via TCP/IP sockets; telnet, nc, and a shell script were common ways to control playback. The software used an open-source library, libpiano, to interface with Pandora; pianod’s language, C, was chosen based on this library.

When WebSockets RFC 6455 were standardized, a web-based client was added. Initially this required an external program, but to simplify things WebSocket support was integrated into pianod’s communication layer (named “Football”), along with a rudimentary HTTP server.

Growing complexity and a list of new features in early 2014 suggested a redesign. In October, a new architecture was planned and coding commenced, switching from C to C++. A C++ wrapper was added around the communication layer, but over time the rest of the code has been updated or refactored to better reflect C++ and the STL. Snippets of the original C code remain, especially within the Pandora source. Architecturally pianod2 changed to support new features: multiple music sources (such as a local collection and Pandora), multiple outputs (“rooms”), and integration with the open-source projects ffmpeg or libav to provide playback. libav was later dropped as its evolution introduced problems, so support for it was dropped in favor of gstreamer.

pianod2’s filesystem source takes ideas from mserv (mserv.org), and reuses an enhanced filter algorithm provided as a patch for that project. The filter turned out to be incredibly useful when performing cross-source actions, such as adding a seed to Pandora from a song playing off a local filesystem. Fulfilling requirements such as these, along with enhancements to the filter, created edit fatigue in the filter which eventually lead to refactoring it to C++, which helped clean up the code and ensure its reliability.

pianod2 was gradually fleshed out to the feature set of the original, then expanded with new features such as crossfading.

Orchid, an OS X pre-packaged application, was created using the pianod2 engine with a Mac user interface and preferences pane. Although it looked promising, the decline of OS X and Apple’s hardware lead to Orchid’s death when I migrated back to Linux in early 2018. For pianod2, That transition lead to stagnation for about 2 years, while I adapted and refamiliarized myself with Linux and a new set of tools, and experimented with new career options.

In spring 2020, finally acclimating to the split-shift schedule of school bus driving, returned to pianod2 by developing a new JSON parser (Parsnip) and replaced pianod2’s XML storage. Soon freed of work obligations by COVID shutdowns, I went on to modernize the Pandora source, scrub a few warts, and split off and complete a half-written Proximity detection system.

After a summer lull, cold weather brought a new command-line parser in Parsnip, replacing the original Football parser and providing a more modern, clean interface. It also paved the way for a JSON client protocol, added over the winter.