tomclegg.net


Diary
Examples
Hire Tom
Mostly Mozart
    70watts
    alphabet
    batteries
    binary
    bluesky
    conservation
    darwin
    decibel
    doppler
    e
    educatiolution
    entropy
    eureka
    fallout
    hanoi
    infinitesimal
    iq
  >kcrtech<
    lightyearsahead
    littlec
    logic1
    logic2
    lpcd
    mass
    normal
    npcomplete
    optics
    periodictable
    pope
    psa
    reaction
    refrigerators
    resistance
    revealedreligion
    scientificsurvey
    senses
    spacetime
    spam
    specialrelativity
    stars
    statistics1
    string
    uncertainty
    unlikely
    warning
    water
    waves
Patches
School
Scrapbook
Software
Telephones




colocation
comments
davidireland
edsgranola
faq
funsites
goodlooking
goodmovies
google-earth-saucy-amd64
houserules
liberating
resume
resume2
scratch
shopping
snacks
todo
university
warisbogus

KCR Tech
Posted July 8, 2001

Dr. Kevin MacKenzie... Chiropractor... on Baker Street... called me a couple of weeks ago and asked if I had anything to say about the probability of survival of a white robin he sighted. Then Geoff asked a good question about how lightning works. And Catherine hasn't reminded me to talk about string theory for a few weeks. So I thought I would talk about angular momentum today. Since I mentioned it in my promo, and I think about it a lot, I thought it would be just perfect.

But I was wrong. I'm not going to talk about angular momentum today, however much I may be thinking about frisbees and bicycle wheels. No, I'm going to talk about some of the computer technology that we use here at the radio station.

You have probably heard DJs here refer to the computer in the studio that plays all the prerecorded commercial spots. They usually don't mention that it's called Paddy, or that it plays MP3s, or that it also makes those MP3s for us, or that it plays the test tone loop all night when the other computer called Vernon that normally plays the test tone loop isn't available because the patch cords have fallen behind a stack of equipment. I, on the other hand, will be mentioning those things and a lot more later on.

First, as is the custom on shows with names like Mostly Mozart, we'll listen to some music.

--- 8 --- 3:20 (fade)

That was a Flanders and Swann song called "Misalliance", which I played to remind you to see Shakespeare Shorts in the park tonight at 7:00. Assuming you're listening to my live show on Sunday, that is. Thursday would be too late.

We're about to hear a couple more by Flanders and Swann, but these ones will have something to do with the topic of today's show. The topic of today's show, in case you've already forgotten, is KCR technology. The first track I'm about to play has obvious relevance, but the second one might be a little more obscure for those of you who don't use UNIX.

Not knowing what's going on, and what's going to happen next, is an important part of listening to co-op radio. For that matter, around here, not knowing what's going to happen next is an important part of doing a radio show.

Did you know that commercial radio stations record everything ahead of time, go home at 10:00, and let the computer handle everything for the rest of the day, except the weather and traffic reports? I didn't used to know that. But we're not like that here at KCR.

Well, we are a little bit like that. But I'm getting ahead of myself. This is Michael Flanders and Donald Swann, in glorious monaural sound.

--- 3 -- 2:30 (fade)
--- 4 -- 2:40 (fade)

This is Kootenay Co-op Radio, CJLY 93.5fm Nelson. Comfort and Joy is happy to sponsor Mostly Mozart. My name is Tom, and I'm here to tell you about some of the fancy electronic devices down here at the radio station. And we might even have time to listen to some Mozart too.

If you're listening on Sunday, this is a live show. If you're listening on Thursday, it's a repeat of Sunday's show. Mostly Mozart has always been live at least once a week, but some other KCR shows are less live. For example, when KCR programmers go on vacation, they sometimes remember to prerecord a show before they go. Then we can play it during their regular slot instead of having a protracted uncomfortable silence.

The recording session usually happens in a place that I call Studio B -- even though everyone else calls it the production studio -- and the recording device is a computer. A computer called Doug, to be exact. If you record an hour-long show on Doug, it takes up 300 megabytes, which is about half the capacity of a CD. It would take up the full capacity of a CD, if we recorded in stereo. But since our transmitter only has one channel, we only have to record half as much stuff.

After we take out all the "um" and "ah" and miscellaneous coughing and swallowing noises, the first priority is to reduce that 300 megabyte file to something manageable. We tend to have a lot of one-hour shows on file, and 300 megabyte files become inconvenient.

Fortunately, someone invented a lossy audio compression scheme called MP3, or more properly, MPEG layer 3. (I think MPEG stands for Motion Pictures Enthusiasts Group.) In the space of about 10 minutes, an MP3 encoder can squish a 300-megabyte file into a 30-megabyte file; sometime later, an MP3 decoder can unsquish the resulting 30 megabytes back into a 300-megabyte file. The 300 megabyte output of this process is not the same as the 300 megabyte input; but if you put it on a CD, it sounds extremely similar. The MP3 encoding algorithm is specifically designed to achieve maximum squishage by throwing away the parts of the sound that people don't hear very well. It turns out that you can throw away 90% of a digital audio signal, and assuming you're careful about which 90% you throw away, it's hard to tell the difference between the reconstructed signal and the original signal.

Doug doesn't have any software that's capable of encoding MP3 files. But that doesn't bother us, because Paddy does. Paddy is the computer in the studio that plays all the prerecorded commercials. Paddy and Doug, and all the rest of the computers, are connected to each other by ethernet, also known as "all those blue wires." So we send our 300 megabyte sound file from Doug to Paddy; 10 minutes later, Paddy sends back a 30 megabyte MP3 file.

We keep a whole bunch of these hour-long MP3 files on Paddy, along with MP3s of all those 30 second commercials. We give each file a different number; for example, on July 8 at 1:00 when it's time to put on Third Planet, someone just has to go into the studio and type 2207. Paddy's screen will say "track 2207, 58 minutes and 43 seconds, Third Planet for July 8;" someone will press Play; and Paul's show will play.

But what if there's nobody in the studio? Ah... wouldn't be be nice if Paddy knew when to play Third Planet all by itself? Well, this morning (or last Sunday morning, if you're listening on Thursday) Paddy knew to play Awakenings at 10:00, followed by Sinixt Radio at noon, a promo for the KCR monitoring committee, and at 1:00, Third Planet.

Of course, it would have been even better if the person in the station at five minutes to ten, had known that Paddy was about to play Awakenings by itself. But he didn't, so he started phoning around looking for Dennis, or someone who knew who was supposed to show up instead of Dennis.

But that's not part of the technology here at KCR. I am running out of time, and I haven't even told you about Brother yet, let alone Vernon. Victoria and Mark aren't very interesting, so I probably won't say much about them. But Brother... and Vernon... those two are simply fascinating.

Lest you become unconscious due to heightened fascination compounded by heat and sun, I think I'll take a little break and tell you something about this show. It's called Mostly Mozart. It's sponsored by Comfort and Joy, a unique children's store. It's on CJLY Nelson 93.5fm. And I usually forget to listen to it on Thursday afternoons. But I do remember to make a new one every Sunday.

Oh -- one more thing. Yes, you can expect to hear some Mozart today. Later. Just hold on for a few more minutes.

I told you how we record shows off-air on Doug and air them by playing them on Paddy. All without burning any CDs. Without burning anything, in fact.

Two questions remain.

No, three. Three questions remain.

First: what about the shows that are live the first time, and not live the second time? Surely we don't do anything silly like broadcast them from Studio B as we record them onto Doug. No, we don't do anything silly at all here at KCR. All the silly stuff is the fault of the ceramic rooster. (ahem)

It so happens that we record every minute of everything that we broadcast, and keep it on hand for a month. We have to do that in order to keep our FM broadcast license. What does a modern radio station like KCR do when asked to record and store a whole month of audio? Buy a 45 gigabyte hard disk, of course. We bought one of those last October for about $400, and for the sake of tradition, we also got a computer to put it in. Ever since then, it's been recording everything we broadcast and keeping it for a month and a half. That's right, we meet or exceed CRTC logging standards. All thanks to that computer, whose name is Brother. Not Big Brother... just Brother.

A lot of community radio stations use VCRs to take care of their logging requirements. Aside from being physically smaller than a stack of 100 video tapes, our computer also makes it a lot easier for us to make copies of recently aired shows. We never have to sort through a pile of tapes, or buy fresh tapes, or clean the heads, or deal with a tape that's wound itself around the VCR the wrong way and won't come out. And most refreshingly, we don't have to remember to change the tapes. Although we might end up buying a new hard drive every few years. And unlike VHS tapes, hard drives have dropped to 1/2 the price since last October. Yes, I like Brother. Brother is Better.

Remember that "300 megabytes per hour" figure? I said we record 24 hours a day and keep it all for a month and a half. That's a little over 1000 hours, so we should need a 300 gigabyte hard disk. Then how do we fit it on a 45 gigabyte hard disk?

Obviously, we're recording a month and a half of MP3s, not raw CD audio tracks. Brother is just a puny little Celeron 633 with 64 meg of RAM, but it can encode and save MP3s in real time and still be 90% idle. It's been doing this for just a little over 8 months. For most of that time, it's also been encoding other MP3s on demand, faster than real time, just like I described earlier when I was talking about Paddy. In 8 months, we've had one outage of 9 minutes while I replaced its crappy D-Link network card with a nice reliable 3com vortex. We've also had a couple of power outages that outlasted the battery backup unit. Other than that, Brother has been very consistent.

Of course, you can't expect to run a computer 24 hours a day for 8 months unless you run some kind of UNIX. And that is what we do. Brother runs Linux. Vernon also runs Linux. Paddy used to run Linux, but we had problems with aliens, so we switched to another kind of UNIX called FreeBSD. No more aliens. You can expect Brother to be running FreeBSD too, when we come back on the air in September after our summer break. You heard it here first. FreeBSD is it. Although I've heard that chicks dig OpenBSD. Either way, BSD wins. BSD stands for Berkeley Systems Design. Portions are copyright 1980 to 1994, Regents of the University of California. But Linux, FreeBSD, and OpenBSD are all available for free. Just the right price for KCR.

I have more to say about free software, but first I should tell you about Vernon. Until now, I haven't mentioned the world's most popular computer term. And I will try not to mention it now, except to say that Vernon connects to it, and lets the rest of the computers use it. Vernon also plays that test tone loop all night long. And it has a database of all the CDs and records and tapes in our music library.

The second question: (by the way, I might have to skip the third question because I can't remember what it was...)

The second question is: where did all the software come from? Some of it is Linux or FreeBSD, which are free operating systems. An operating system, roughly speaking, is something like Windows 98 or Windows 2000, except that it's well designed, and it works consistently. Linux and FreeBSD both rely on a bunch of free programs collectively called...

Just a minute. Remember how I was going to relate that Flanders and Swann song to something?

Linux and FreeBSD are made useful by the fact that they can run a bunch of free programs collectively called... GNU.

GNU stands for Gnu's Not UNIX. There's a famous document called the GNU public license, and it's a stark contrast to the license agreements you're accustomed to if you use commercial software. The GNU public license, or GPL, is designed to protect your rights as well as the rights of the copyright holder. If I release software under the GPL, then anyone who pays for the program must have access to the source code for free. They can change it, add features, fix my mistakes, and so on; and if they release their modified version, then they must give me credit for my contribution; and they must release the modified version under the GPL and give away the source code.

The philosophy behind the GPL, as I interpret it, is that software with secret source code is a dead end. The blueprints and materials, as it were, must be available to whoever is the best person to improve on them. If the design is held as a corporate secret, then someone else will eventually have to reinvent the whole thing in order to improve it. If you want to minimize your chances of being stuck with crappy software just because Megasloth Ltd isn't fixing it, then all you have to do is use software whose source code available to all the people who can fix it.

But the GNU project hasn't extended to specialized software for running community radio stations, so I had to write some of this stuff myself. For example, someone called Michael Hipp wrote a program that decodes MP3 files. I just had to write something that lets you type in which tracks you want to play, show you how much time is left before the end of the set, and most recently, wake up at the appropriate time to play shows in the morning as instructed beforehand.

Mike Cheng wrote the MP3 encoder, although it's now maintained by Mark Taylor. I wrote the parts that keep all those MP3 files organized, ask you which ones you want to download, split them up and glue them together for you, and, every day at 4 am, delete 45 day old files to make room for new ones.

If you'd like to know more about our computers, I'm afraid you'll have to wait. I've had enough of this, and I'm going to get a drink of water now.

Comfort and Joy is happy to sponsor Mostly Mozart. Thanks for sponsoring the show, or thanks for listening, whichever applies to you. See you next week.

Wait, I'm not done yet. We have a second logger now, called Sveta.

Oh, never mind. I'll tell you some other time.