Editing freedb/cddb entries

The new album New Album from the folk band Boris

When ripping large quantities of CDs, you really have to have an efficient way to query and edit CDDB entries.  So here’s an Emacs library for doing that. It includes a bunch of convenience functions for fixing up other people’s bad entries, and you also have all the standard Emacs editing commands at your, er, command, so it’s rather nice.

I also download the entire database from freedb now and then.  It’s useful mainly when sampling (old) vinyl.  By using an approximate match for the albums, I can usually find the album in question, which means less typing for me.

However, the DISCID collisions these days are just ridiculous.  I’ve written about this before, but the situation is as ridiculous today as ever.  I mean, even more so.  It’s now impossible to submit any new album on the “rock” category, so everything I submit now is apparently “folk” or “data”.

As demonstrated.

Musical Beats & Pieces

The music player

The last hoard of Emacs-related code I’ve written over the years is part of my Emacs-based music player.  It started off (in 1997) as a way to rip my CDs and play mp3s (as well as swap out the mp3s to CD since I didn’t have enough disc space to store all the mp3s).

It’s grown over the years and changed focus somewhat.

Most of the stuff has been written pretty monolithically, with all the code stashed in jukebox.el.  So I’ll be attempting to disentangle parts that could have some reuse value over the next weeks, as time permits.

last.fm web interface

But if you want a system that you can use yourself, the EMMS system is probably a better bet.

The first result from the disentanglement process is scrobble.el. It’s a library for interfacing with the last.fm web site.  I like last.fm.  It’s the only “social networking” site I use — I find it genuinely useful for finding concerts and stuff.

Following will be a cddb library, a DAE (i.e. cd-ripping interface), a sampling-and-splitting interface, and probably other bits and bobs.  As well as the jukebox itself.

Emacs Movie Browser

See Emacs. See Emacs play movie

In the continuing story of Emacs@Home (don’t worry, I think there’s only one part left now), we’ve now come to the part where I watch TV.  I know, it’s something most people manage quite perfectly without resorting to Emacs, but why would you?

Well, actually, I think that the interfaces I’ve seen have been somewhat lacking.  Mostly mouse-based and not very practical.  I just want to sort by name or by recording date, and I don’t want to use an HTPC pointer device.  So:

User story: Keyboard-based and snappy.

Emacs is ready for its close up

Solution: Emacs.

I think this Emacs movie browsing interface demonstrates how little code you need to get a satisfactory result.  Emacs does all the difficult stuff for you, and presto! You have the interface as shown at the top there, displayed in blurrovision.  I just couldn’t get my camera to focus.  What if I take a the picture closer?  Yeah, that’s a bit better.

Anyway, I’ve got a little wireless keyboard next to me, and viewing a program just requires paging up and down a bit and hitting RET, which suits me fine.

Oh, and it just forks mplayer to actually play the movie.  Sorry, I didn’t implement H.234 decoding in Emacs Lisp.

Olde Stylee

So, not much code this time…  but it’s a bit interesting how writing about stuff like this changes the stuff itself.  Before starting to write this, the interface was even more minimal.  It didn’t have thumbnails and wasn’t in Futura.

The last picture there is how it used to look.  Just as functional (if you squint), but I thought “hang on, an Emacs interface without any pictures would be just to stereotypical”, so I added the thumbnails.

When writing software that I’m just going to use myself, it gets a lot more basic.  I get to embarrassed about the code quality, and I start cleaning it up, and before you know it, it has all these…  frills.  I’m not actually sure it’s a positive effect.  It might be.  Hm.


Alarm Clock

The alarm clock before I started writing this article

Most alarm clocks have somewhat awkward interfaces, which may be why so many people have switched to using their mobile phones instead.  Most mophos have alarm clocks that are easy to use — just open the clock app, choose a menu item and type in the time.  Especially for people like me, who doesn’t get up at the same time each day, using a traditional alarm clock is annoying beyond endurance.  It’s an outrage!  I’ll write my congresscritter!

Anyway, where was I?  Yes.  An alarm clock needs a numeric input pad. But, of course, I find using a mopho to be annoying, too, since I wake up all the time and need to be able to see what time it is before continuing to sleep.

I’m easily annoyed and sleep unsoundly.  There’s probably no connection between the two things.

Alarm clock control device

Anyway, I wrote an Emacs-based alarm clock, which, as a bonus, shows just how cold it is outside, too.  If it’s too cold, I just ignore the alarm and keep on sleeping. And it displays the time using the Futura type face.  How could you use an alarm clock with an inferior font?

To control the thing, I thought it’d be perfect to use a wireless keypad.  It allows me to set the alarm very easily (just type 8 RET of 730 RET). However, finding a keypad that had the required range turned out to be pretty difficult.  I went through five different ones before I ended up with this one, a Logitech N305.  All the other ones either only had a two meter range, tops, or were totally unreliable.  The N305 only has a single unusable key, the “Excel” key, so I use the rest of the keys to control the volume of the music and the lights in the bedroom.

MiniGoose temperature sensor
The new alarm clock. See? Much nicer. And warmer

Writing this it occurred to me that I had a spare tiny FitPC2 computer, and a 10″ USB-powered DisplayLink monitor that I had never used.  Instead of using the (really too big) eMachines all-in-one (seen at the top there) as the alarm clock, I could perhaps use the FitPC2 instead?

And I could!

DisplayLink technology is pretty new, and there are some quirks, so in case you have a similar setup and is Googling for how to get it to work under Linux (Debian Squeeze, Linux kernel 2.6.38), the rest of this blog entry is for you.

# lsusb -v
Bus 001 Device 005: ID 17e9:0288 Newnham Research

  idVendor           0x17e9 Newnham Research
  idProduct          0x0288
  bcdDevice           f0.02
  iManufacturer           1 DisplayLink
  iProduct                2 Monztor S10
  iSerial                 3 10270020

The iMo 10″ screen comes up as a cdrom device:

[    3.408147] sr0: scsi3-mmc drive: 8x/40x writer xa/form2 cdda tray
[    3.408372] cdrom: Uniform CD-ROM driver Revision: 3.20
[    3.409760] sr 2:0:0:0: Attached scsi CD-ROM sr0

So you have to use usb_modeswitch to switch it to DisplayLink mode:

usb_modeswitch -v 0x17e9 -p 0x0288 -u 1

After doing that, the screen should go green, but X won’t work on it.  Say the following:

rmmod udlfb
modprobe udlfb fb_defio=1

and you should now be able to start Xorg on the device.

Section “Device”                                                 
   Identifier  “MimoDevice”
   Driver      “fbdev”               
   Option      “fbdev” “/dev/fb0”

Section “Screen”                                                 
   Identifier  “MimoScreen”              
   Device      “MimoDisplay”   
   Monitor     “MimoMonitor”   
   SubSection “Display”                         
     Depth       16                      
     Modes       “1024×600”

See?  It couldn’t be simpler.

The Mimo USB monitor is quite nice, by the way.  It’s also a touch screen and a USB hub, but it’s not a floor wax.   However, the contrast leaves something to be desired, and the viewing angle isn’t very good. But it’s good enough to use as an alarm clock.

An Emacs-based PVR

In the continuing story of me trying to push a few of the odds and ends of the code I’ve written for my own use, we’ve now come to the Emacs-based PVR. As usual, it may not actually be very useful code for, like, normal human beans, but why not push it out there?  Perhaps somebody will be inspired to do…  something.

So the story behind this piece of code is that I’ve never really been very fond of watching TV live.  I know, these days nobody does that any more, and everybody uses their cable company supplied (and crappy) PVRs, but back at the start of the millennium, it was a not un-novel idea.

USB TV card

And my implementation of it, based on Emacs, is probably noveller (that should be a word) than most.

So the idea is basically that we pull down the TV programme (thoughtfully provided by the XMLTV project), see what programs we want to record, and then record them.  It’s simple.  Since it’s Emacs-based, I can just ssh in to my machine from anywhere and add new programs to the list of stuff to be recorded from anywhere.  Take that, User Experience people.

The computer is hooked up to an external USB tv card that provides an MPEG stream.  So the actual recording is just “cat /dev/video0 > /tv/file”.

The nice little box running Linux

The cable company calls me sometimes and asks me if I kindly could consider switching over to digital cable, but then my PVR thingie would stop working, so that’s out of the question.  If analogue cable goes, I stop watching TV.

The only problem (for some values of “problem”) with this setup is that I can’t watch TV live easily even if I wanted to.  But I’ve been running stuff this way for a decade, and that hasn’t really tempted me more than a couple of times, so, eh, whatev.

Tellstick Redux

I was whinging a lot about the terrible Tellstick range in my last post on the issue.  Deservedly so.  It’s terrible!  However, the Telldus people have released a new version of the device:

The revolutionary new invention is the antenna!  Who would ever have thought that an antenna would give greater range?  Kids these days.

Anyway, it really does work.  I had four separate antenna-less Tellsticks that gave me 90% coverage of my apartment earlier.  With the new Tellstick, a single one gives me 100% coverage.

That’s progress.

Assange Past Revealed!

I was looking through my ~/lisp directory just now, and I found this file, saved in 1998.  I can’t recall ever using it or where I got it from, and it’s probably written by a different Julian Assange, but anyway…

Here are solid connections between Wikileaks and the sordid Emacs development environment!  I think the justice deparment should start looking into this!