Roku Soundbridge

I don’t necessarily need another music payer, but I might still patch a
long S/PDIF coax to the amplifier on the other side of the room later on.
It seems to work pretty well as a music player, indeed.

I was mainly interested in using the VFD to display things like the weather
forecasts, syslog warnings, etc.

The great thing about the Soundbridge is that the people that designed it
have spent quite some time implementing a nice command set to draw on the
display.
There are commands for drawing points, rectangles, text in various
fonts, etc. Actually everything that you need to use the Roku as a universal
display for just about any kind of information that you can think of.

Even though it is not finished yet, as you can see from the image, the
Roku already found a prominent place on the wall in my living room.

A bit of pencil and paper design, ugly text files and abuse of netcat later and I
ended up with this:

The resulting coordinates I then converted to a file with hardcoded drawing
commands like so:

1234567

point 1 7
point 1 8
point 2 7
point 2 8
point 3 3
point 3 4
and so on...

Some Bash to parse ascii-art icons and dynamically create drawing commands
from that was quickly written. I soon realized that that did not scale, though.
It also meant that I had to create each and every icon by hand, while lazy people
like me rather steal some cute icons from the web: icons designed by people that
are more skilled in graphics than me.

I remembered that the PBM image format has an ascii version that is really
easy to parse (or generate) and it meant that I could just take any graphics,
manipulate it with either Imagemagick or the GIMP, depending how much editing it
needs to use it for display on the Roku.

The P1 header tells that this image is 1-bit monochrome, ascii formatted.
Then follows a comment on the second line.
On the third line it gives the image width and height, so 16x16 pixels in
this case.
After the coordinates all pixels follow on multiple lines. As far as I know
the linebreaks can be made on arbitrarily chosen positions. (At least my PBM
handling scripts do not care, they just realign the pixels based on the image
width.)

A bit of Bash now parses these files and spits out the equivalent Roku drawing
commands, with an optional offset added to them to be able to position icons
anywhere on the Roku’s display.

Another neat feature of the Roku is that it also has a blit command with
the following syntax:

blit x1 y1 x y w h - blits from (x,y,w,h) to (x1,y1)

Of course I had to use this command, so I rewrote my icon drawing script to
scroll large PBM files vertically over the narrow display of the Roku.
This script should give enough info to do similar things with PBM files and
Soundbridges:

The script is meant to be used as a component in a framework using multiple
plugins to display various kinds of information on the Roku.
To use it by itself, one can just pipe the output to netcat like so: