Hacking

Adding Live TV to XBMC

It started simply enough. “I would like to watch the olympics on our main television.” After about an hour of cursing at the tv we gave up and contented ourselves to watch the olympics in the kitchen.

We get our TV signal over cable. Although we don’t have a cable TV subscription the broadcast channels are sent unencrypted over the cable line. This works great on our newer Sony TV. It turns out it doesn’t work at all on our older Pioneer TV. After much research I discovered that the Pioneer has an NTSC and ATSC tuner (analog and digital over the air), but not a QAM tuner (cable without a cable box).

The simple solution would be to plug a set of rabbit ears into the Pioneer and call it a day. We probably even have some in the basement. Those of you who know me know that the simple solution is never, ever, the one I go for.

Enter the Hauppauge 2250. Oh yes, we’re adding live tv to our media PC.

DVR / Live TV functionality is experimental in XBMC. It was originally planned for Eden (version 11), but got pushed back to Frodo (verson 12). It’s under active development, and arguably useable, so I decided to go for it.  After 3 days and a ton of reading, I have it more or less working. If that’s not a ringing endorsement, what is?

The latest PVR builds of XBMC are meant to work as front ends to one of a handful of backend “TV servers,” software which will handle the nitty gritty of managing the TV tuner card. This can be either in the same machine as XBMC or on a separate one. For now I’m working locally. I chose MediaPortal as the backend because it runs on Windows and has a reasonably active community.

Step 1 was to install the card and see if I could get it to even come up in Windows Media Center. And it did! The setup wizard found 10 channels on the QAM tuner. A number of channels, including NBC and CBS, were missing. After about an hour of poking at it I decided to move on to my ultimate target, MediaPortal.

MediaPortal has two main parts: the TV Server and the client frontend. The client frontend is another media center program, which I ignored. The TV server runs as a service under windows, and is more or less invisible once you’ve got it running. It’s managed with its own configuration tool separate from the MediaPortal frontend.

With the TV server installed and running, step 2 was to scan for channels. This took about half an hour, and found hundreds of channels – many of which were encrypted. I deleted all the encrypted channels (marked with a red T). This left me with about 100 channels. Many of these were data channels (which gave an error when I tried to preview them) or otherwise uninteresting, so I deleted those as well. The remaining 40ish channels included broadcast and cable public access stations.

Step 3 was to identify each station and get scheduling data. The broadcast stations self-identified, but the call signs they used were sometimes opaque. WHYYDT is pretty obviously the local PBS affiliate, but it took me a fair amount of googling to figure out that RT is the station formerly known as RussiaToday, and is offered by local independent station WYBE.

Step 4! Armed with a list of call signs for each station, I started creating a grabber file for MediaPortal’s WebEPG plugin. In theory, listing data is sent along with the signal and can be picked up by the tuner, but I didn’t have any luck with that. WebEPG lets you get listing data via the internet. I copied the IMDB grabber included with the plugin and added a listing for each station in the following format:

<Channel id=”RT” siteId=”WYBEDT2″ />

The Site ID is generally the station’s call sign, with DT added to the HD digital feeds. Subchannels (e.g. 10.2) usually have a trailing number. So our local NBC affiliate, WCAU, can be found at WCAUDT and its substation NBC Nonstop can be found at WCAUDT2. You can double-check to make sure you’ve got the right ID by going to http://www.imdb.com/tvgrid/2012-08-01/WCAUDT/, replacing WCAUDT with the call sign of your choice. You should see the schedule for that station.

Lastly, I needed to install a plugin for MediaPortal that will allow XBMC to communicate with it called TVServerXBMC.

Whew! That concludes the MediaPortal set up, now on to XBMC!

In order to play with the PVR stuff you need to install one of the experimental PVR builds. I went with Margro’s build which includes the MediaPortal add-on. Setup in XBMC is fairly straightforward: enable the add on and a new option for Live TV shows up in XBMC. Assuming everything’s been set up correctly in MediaPortal your TV stations and listing data will be populated and there you have it: Live TV in XBMC.

There are a few bugs in my set up, which I assume are a combination of errors in my confguration, bugs in the still-under-development software, and features which have yet to be implemented. These include:

  • Deinterlacing problems on some (but not all) HD channels. This is most visible at the edges of moving objects on screen.
  • XBMC/MediaPortal only using one of the two available tuners (meaning I can’t watch one thing while recording another)
  • Visual glitches in XBMC, like text overlapping itself
  • Occasional trouble tuning stations, which is resolved by trying another station and then coming back
  • Occasional video stutter
  • Live TV can be paused/resumed, but not rewound / fast-forwarded

It’s still a work in progress, but it’s getting there! In theory one TV backend can serve all the XBMC frontend clients on the network, so getting that up in running is one of my next steps along with ironing out some of the configuration problems.

 

New Construction Townhome

Wiring the House for Ethernet

The biggest part of setting up our home network was wiring the house for ethernet. There were two basic phases: running the wire through the walls, and then terminating/testing each wire to make sure it was set up correctly. We hired a family friend who is an electrician to run the wires, and then terminated/tested them ourselves. We installed a total of 34 lines across 4 different floors, all coming into the closet under the staircase.

Cat6 Basement

Running the wires proved to be a bigger challenge than expected due to the fact that all of our walls were filled with insulation. A number of access holes had to be cut in the drywall in order to access everything. Four separate boxes of Cat 6 ethernet cable were used, so that multiple lines could be run to the same location at once. The free end from each spool was taped into a small bundle and a long metal wire with a hook was run from the target location (say, the bedroom), through the walls, and into the basement where it was attached to the end of the cat 6 bundle. Then the wire was pulled back up through the walls, bringing the cat 6 cable along with it.

Cat6 wall
Wires coming into our home office. The orange ring gives the faceplate something to screw into.

Each location in our house got either 2 or 4 wires, depending on how many devices we planned to put in that area. For every location in the house we needed either two or four RJ45 keystone jacks (one for each wire) and a faceplate with an appropriate number of holes. Keystone jacks are available in two basic formats: the standard kind which require a punch-down tool to terminate the wires and a “tool free” type which includes little caps which punch the wires down automatically. I personally prefer the standard jacks.

Cat6 Keystone
The near side of this jack (white) has been punched down, the far side is still waiting to be done. Each strand of the blue cat 6 cable goes into its own slot on the jack. Color codes on the side tell you where to put each wire. Monoprice included a handy little holder (black) to place the jack in while punching it down.
The two keystone jacks have been pushed into the faceplate, which is waiting to be screwed into the wall.

The opposite ends of the cables, which are bundled in the basement closet, get a slightly different treatment. Instead of going into individual jacks, they’re terminated in a patch panel. We used two 24 port patch panels, placing 16 connections on one and 18 on the other. We’ll be mounting these in our server rack, but if you’re going for a minimalist build there are inexpensive wall-mount brackets.

Cat6 PanelEmpty
Two patch panels, one face up and one face down. The black thing on the right is a rack-mount power strip.

Each wire was marked with a small letter or number at both ends. To keep everything in order and save my sanity, I used masking tape to temporarily keep the wires in alphabetical/numerical order.

Cat6 Sorted

Cat6 PanelBeck
18 cables have been punched down into the back of the patch panel.

Each jack in the patch panel is then patched into one of our network switches (which are each in turn plugged into the router) with a 6″ cable. Why not just go directly from the wall to the network switch? The patch panel gives you flexibility to change the network around later by moving the 6″ patch cables rather than tangling up the spaghetti coming out of the walls. Additionally, punching the wires down into the back of the patch panel is considerably faster than crimping a male RJ-45 connector onto the end of each drop.

Patch Cables

I briefly considered crimping my own patch cables from the leftover cat 6 cable, but then I remembered that crimping cable ends sucks and a 6″ patch cable costs all of $0.55. The photo above shows half our network cables, the other half are mounted on the back of the rack. I still need to install stress relief for the blue the cables and mount the router + modem nicely somewhere.

The server and switches are all connected to the LAN ports on the router. Our cable modem connection goes into the WAN port. Now the server and anything else on the LAN can see the outside world.

Overall it was a pretty massive project: it took three people a week to get all the wires in place and then another day and a half for my dad and I to button it all up. The next step is to configure the router for the advanced management options we want, as well as configure the wireless access points to provide “seamless” coverage throughout the house. The media server also needs considerable set up, right now it’s just a fresh Linux box with a giant hard drive. I’ll cover the software side of things in part 3 of Our Over-engineered Home Network.

This is part 2 of 3 posts about our home network.
Part 1: Our Overkill Home Network
Part 3: Coming soon