Tuesday, February 24, 2009

Project Deanvo

Introduction

Several years ago I decided to discard my Tivo, and replace it with a Linux-based digital video recorder (DVR) built from off-the-shelf computer parts. My friends at work dubbed this Project Deanvo.

Digital Video Recorder Overview

A Digital Video Recorder (DVR) is a computer with the ability to record, and play video. Typically these devices have a controlling piece of software which schedules recordings, and automatically changes the channel on your cable TV box, or satellite dish.

Other than the basics, many DVRs have the ability to play DVDs, create DVDs, capture streaming Internet radio, download podcasts, listen to MP3s, view photos, and just about anything else possible on a general purpose computer.

Why Build a DVR?

The short answer is no sane person would build their own DVR. It's expensive, requires significant time and effort, and the most commonly used software (MythTV) is far from perfect.

But Tivo has begun to engage in some questionable business practices:
  • Tivo monitors the programs you watch. Of course, they claim this information is not used for nefarious purposes.

  • Tivo automatically downloads advertisements. This is particularly galling since you're paying for it. The whole point of a Tivo is to avoid ads.

  • Tivo makes it difficult to cancel your subscription. You can sign up online, but canceling requires a lengthly phone call. They put you on hold forever, and then you have to listen to their retention sales pitch.
A Tivo also require an expensive monthly service ($13/month). And Tivo controls your recordings; there's no easy way to extract them. In short, a homemade DVR allows you to regain control of your TV.

Quiet and Green Components

The hardware requirements of a DVR are slightly different from a general purpose computer. DVRs are usually never turned off, so a green (low power) machine is desirable. Also, a quiet DVR is essential, as any noise might disturb playback. But the machine must have enough processing power to play high bit rate video. And a powerful CPU typically requires a noisy fan. Fortunately there are a number of green, and quiet options available. Here's the part I used:
Antec NSK2400 Case


The NSK2400 is specifically designed to be a media center PC. It has two 120mm fans which provides good ventilation with minimal noise.


AMD64 3800+ CPU


The AMD64 3800+ draws only 45W, and can programmatically have its clock rate lowered to save even more power. Still, it has enough processing power to easily play DVD quality video.


Rosewill RCX-Z2-EX Heatsink


The XP-90 has four heatpipes bonded to aluminum fins. It is designed to dissipate 125W of heat -- about 3 times what the AMD64 3800 generates. This allows CPU to run with the fan off most of the time.


Corsair VX450W Power Supply


The VX450 is very quiet, and its efficiency rating is 80 Plus.


Western Digital WD10EACS 1TB Hard Drive


The WD10EACS is a high capacity (1TB), low noise, energy efficient hard drive. Perfect for a DVR.


Hauppauge PVR-250 Video Capture Card


The PVR-250 is a common component for a home made PVR. It has a hardware MPEG2 encoding engine which produces DVD quality video.

LCD Display

Some DVRs have a front panel display. While not absolutely necessary, it adds a nice finishing touch. I bought an LCD display from All Electronics, and built some control circuitry, and a carrier:

LCD Carrier

LCD Circuit Board

Cover


Here's what it looks like assembled:

LCD Display Assembled

LCD Display Installed

Satellite Dish Control

A DVR must be able to change channels on a cable, or satellite dish box. This is accomplish this by mimicking the infrared codes sent by the remote control. Commercial infrared transmitters typically do not support Linux.

After some research I decided to built my own. The circuit is remarkably simple:

Infrared Transmitter

Circuit Diagram


The Max232 provides a serial connection to the computer. The PIC microcontroller is a one-chip computer. It is loaded with the following microcode:
ir.asm

Software (MythTV)

The de facto standard for a Linux-based DVR is MythTV. It is far from perfect, but it does have many attractive features:
  • Commercial flagging. Tivo lets you fast forward past advertisements, but MythTV allows you to skip the entire commercial break with the press of one button.

  • Distributed playback. MythTV is divided into a recording module (backend), and playback module (frontend). This provides an built-in Slingbox-like feature enabling playback on any Internet-connected computer (PC, Mac, Linux). And since MythTV supports Universal Plug and Play (UPnP), it also plays back on Sony's Playstation 3 and the Samsung 8-series LCD TVs.

  • Inexpensive monthly service. MythTV needs a database of TV listings. While it is possible to extract (scrap) this information from web sites like TVGuide.com, almost all MythTV users buy a subscription from schedulesdirect.org. It's cheap ($20.00/year), and very reliable.

  • Open source development. The main advantages are that it's free, new feature are added rapidly, and bugs get fixed quickly.

  • Numerous Plug-in Features. MythTV is designed to be extended by a third party. For example, MythVideo can import, transcode, and play DVDs. MythWeb provides a web interface, which allows you to schedule a recording from any computer with a web browser.

Here's a few screen shots:

MythTV Main Screen

MythTV Recorded Programs



MythTV Program Guide

MythTV Program Playback

NPR Recorder

I listen to a lot of National Public Radio (NPR). It's the PBS of radio. Since most NPR stations have streaming MP3 broadcasts, it's pretty easy to automatically capture recordings. I cobbled together some perl scripts which are activated by a cron task, and voilà: NPR Tivo. Here's the relevant files:

npr_tivo.tar.Z

Conclusion

It was a lot of work, but I love my MythTV box. Of course, a year after I got everything working, I bought an HD TV. My MythTV box only supports 480i (DVD resolution),while the TV supports 1080p (full HD resolution). I suppose it's time to upgrade. That's the problem with computer technology: if it's working, it's out of date :)

Monday, February 23, 2009

Oscar Bingo

Fun Watching the Oscar

I went to an Academy Awards party, and everyone had a great time playing Oscar Bingo. Each card has 25 squares containing an Oscar category, and one of the two top nominees. The first to get five in a row wins.

This web page generates a random Oscar Bingo card:
Oscar Bingo Page

Each card has about 30% chance of a bingo, and we wanted a winner so the three of us each played two cards.

Results

Below are my two bingo cards. I got knocked out early.
Dean #1

Dean #2

Midway through the cerimonies Dave got four in a row, needing only Best Picture / Slumdog Millionare for bingo. Nate Silver estimated Sumdog's odds at a whopping 99% -- a virtual lock! But Best Picture is announced last, so if somebody else could beat him to the punch ...
Dave #1

Dave #2

Late in the ceremonies, Rich needed Best Actor/Sean Penn, or Best Actress/Meryl Streep -- both considered long shots. But Penn pulled off the upset sending Rich to victory.
Rich #1
Rich #2

Unbingo

The best part of the game is speculating about possible paths to victory, trash talking, and whinning about our bad luck. We soon realized that five loosing squares in a row (unbingo) was almost as difficult. So next year the first to unbingo will get a VHS tape of Plan 9 From Outerspace.

Sunday, February 1, 2009

Dog of a Thousand Faces

FOPAL

I recently started volunteering at the Friends of Palo Alto Libraries (FOPAL). This nonprofit organization receives donations of books, and sells them, with the proceeds going to the local libraries.

One of the stranger traditions at FOPAL is the dressing up the stuffed animal mascot named Le Woofer. FOPAL sells books once a month, and Woofie, and his wicker bird companion are dressed to match a major holiday in the month. e.g. For December Woofie was Santa Claus. It started when somebody donated Woofie to FOPAL, and since he was clearly not a book nobody knew what to do with him. The volunteers started propping him up in the "Earth and Animals" section, or hunched over a keyboard. And then it got out of hand. None of this makes any sense, but traditions rarely do.

Woofie the Clown

In October Woofie is dressed as a clown for Halloween. The base outfit is a children's costume. The nose is a Christmas ornament. The hair is polyester fiberfill, and some fluorescent paint.

Woofie Claus

In December Woofie is Santa Claus, and the bird a reindeer (note the blinking LED nose). The chimney is a couple of moving boxes glued together and painted red.

Woofie the Drunk

In January, it appeared Woofie has had a bit too much to drink at a New Years Eve party. The foam coming out of the bottle is a product called Great Stuff; it's spray insulation in a can. Inside Woofie's hat is an mp3 player which added a snoring sound effect.

Woofie in Love

February is Valentine's Day, and it looks like Woofie has a case of puppy love. The heart has 16 LEDs controlled by a programmable chip called a PIC. Sound effects are supplied by a small digital voice recorder. The big red button activates the everything.



Here's a short video of Woofie in action:

woofie_puppy_love.avi (15MB)

Sunday, October 28, 2007

Trebuchet

What is a Trebuchet?

A trebuchet is a medieval siege weapon. Here are a few examples:


Château des Baux

Runneburg

Warwick Castle

Château de Castelnaud


Its primary use was to hurl rocks at castle walls. Think of it as a catapult on steroids. The major difference is a trebuchet uses a rotating arm, a large weight, and whip-like action to throw the projectile. Here's a YouTube video of a trebuchet in action:


Trebuchet Video


Why Build a Trebuchet?

Many say it's an interesting demonstration of applied physic. Some like the connection to ancient technology, and weaponry. But let's face it, there are very few castle walls to knock down anymore. Any reason other than "it's cool" is a rationalization.

Model Design

I choose to build a 1/6th scale model based on Dan Becker's design . I enhanced it by adding an adjustable release hook, and trigger.

Construction

The main frame is built out of four strips of pine, each 12" long. Two pieces are mortised together, forming a right angle.

Mortise Cut

Frame pieces


Cross beams are added, and secured in place with wood screws:


Frame With Cross Beams

Secured Cross Beams


Finally, the two frame halves are connected with four three-inch beams.


Frame With Connecting Beams


The throwing arm is built from a 19" piece of hard wood that is tapered at one end with a router:


Tapering Arm


Knotches are cut on each end of the throwing arm. One to hold the counter weight, and one to hold the throwing hook:


Arm (Counter Weight End)

Arm (Hook End)


Trebuchets thow in a similar manor to a hand-held sling. The projectile is held in a pouch (sling) attached by two lines. During the throw, one line remains attached; the other releases. The timing of the release is controlled by a hook at the end of the throwing arm. When the sling whips around, the line slips off of the hook and releases the projectile. The release point can be changed by altering the angle of the hook.


Hook

Hook and Throwing Arm

Hook and Sling


The counter balance weight is a 2.5lb fishing weight tied to a eye screw:


Counter Balance Weight


The sled is used to guide the projectile in the early part of its flight:


Sled


The trigger is used to hold the arm in place until the trebuchet is ready to fire. It's constructed from half a key ring with two loops soldered in stratigic locations:


Trigger

Trigger (Attached)

Trigger (Ready to Fire)


Finished Trebuchet

After some stain, varnish, and paint, here's the finished trebuchet:


Conclusions

The trebuchet doesn't throw as far as I'd hoped, but it's a toy not a weapon. And it was fun to build.

Here's a quick video of a second version of the trebuchet in action:


Trebuchet Video
(280K)