Sunday, June 24, 2012

CableCards and Tuning Adapters

I've been using my Ceton turner card for a while now and its been pretty nice.  Being able to DVR multiple shows and once is very nice.  The only problem I've had so far, is that some channels will not tune some times.

tl;dr - Tuning adapters case 99% of the problems

I wake up in the morning with a notice that it wasn't able to record my sons cartoon because the channel couldn't be found.  To Cetons credit it is NOT their fault.  Its actually Time Warner's fault.  They use SDV (switch digital video) on a lot of their channels.  To receive SDV channels Time Warner gives you a "tuning adapter".  Its a small box that plugs into your computer through USB and your cable line.  The computer queries the tuner adapter for the frequency of a given channel and the tuning adapter does it magic and tells the computer where it can find the channel.  The problem is these adapters seem to have MANY, MANY problems.  Some times they don'y sync up to the cable company and suddenly you can not use half of your channels.


Raspberry Pi

After many months I got my Raspberry Pi in the mail.  Even though I've seen many pictures of it, it still looks much smaller than I thought.  If you don't know what a Raspberry Pi is, its a tiny computer about the size of a deck of cards.   Its just the board through, no fancy case.  It also has a bunch of extra pins on it so you can do some I/O, like reading switches and setting LEDs.  You also need to supply your own power supply and memory card.

I used my USB phone charger cable to power it.  I've read some phone cables don't work, but this one seems to work, so far.  I copied the Debian image from the Raspberry Pi website on to the memory card and booted up with no problem.  Next I looked for something interesting to try out.  I found this post about streaming Pandora music.  I followed it and was able to connect to Pandora, but the music would stop after a second or two.  Turns out there was a bug in the ALSA (sound) drivers.   If you background the task (Ctrl-Z) and then foreground it again (fg), it would play for a few more seconds.  I next tried the beta Debian image on the Raspberry Pi website, since it was newer.  It still had the problem.  After a a little google search I found this.  Apparently they just fixed the driver a few days ago.  To update the firmware I used Hexxah's raspi-update tool.  Just had to run it and reboot when it finishes.  I tried pianobar and it work that time.

Next was the GPIO pins.  They are perfectly spaced out for an old ribbon cable.  I first tried and IDE cable but realized it was one of the UMA 66 with extra conductors in it.  Rather than chance anything funny with that cable I found an old floppy drive cable.  It fits over the pins with the last 4 rows sticking out.  I then wired an old bread board I had to an LED and switch using this diagram.  I next used the RPi.GPIO library and wrote a script to toggle the LED on the switch.  The LED was a little dim the for the first test, so I swapped the resistor for a smaller one and its much brighter now.

Something of note, I had used the wrong pin diagram incorrectly wired the wrong GPIO to the switch, and the Pi instantly turned off.  Thought I had blown something, but after only minute of being off it came back up fine.  Another thing to know is the GPIO to turn a LED on is TRUE and FALSE to turn it off, while reading a switch is TRUE when its open and FALSE when its closed.

If any cares I can post pictures.