Monday, May 17, 2010

HTPC Build Part 2 – Testing a PC TV Tuner and Windows Media Center

This is the second in a series of posts I’m writing about an HTPC (Home Theatre PC) build that I recently completed.  To see a list of all posts in this series, click here.

Having gotten free HDTV via my DIY antenna working nicely, I decided to purchase a TV tuner and try it out with my existing PC running Windows 7 (and therefore also Windows Media Center), before making the full investment in a complete set of parts for a new HTPC.

I found a a pretty good overview video from Microsoft describing what it takes to hook a TV tuner card up to a PC.  Doing this on a PC running Windows 7 enables the ability to be able to watch live broadcast TV on the PC monitor.  It also enables Windows to record broadcast TV like a TiVo or similar DVR device – with no monthly fee!  (There are some free software packages for Linux that have similar functionality, but Windows is my preferred OS, so I decided to go with Microsoft’s software solution.)

HVR-850 After doing some research, I decided to purchase an HVR-850 USB-connection PC TV tuner by Hauppauge.  This tuner is compatible with over-the-air HDTV (ATSC) signals, and is certified to work with Windows 7.  I paid about US $55 for mine (and as of the time of this writing, it’s going for $55 shipped on Amazon).  (Note: This model isn’t compatible with some other types of TV signals such as “Clear QAM” from a set-top cable box; for that, you’d need a higher-end tuner part like the HVR-950.)

Unfortunately, the HVR-850 unit that I received was DOA. I plugged it in to my PC, and Windows 7 recognized the device right away, no driver install needed.  However, upon connecting the HVR-850 via the standard coax cable connection to my antenna and then scanning for over-the-air channels in Windows Media Center, the device wouldn’t find any channels.  I fiddled with the HVR-850 for quite a while, but just couldn’t get it to work.  Finally I had the idea to hook my old NES up to the HVR-850.  The output from the NES was just barely visible on the computer screen through heavy static/snow, and the music from the game was also just barely audible through heavy static/snow as well.  Therefore I concluded that the HVR-850 was “working” in that it was in fact sending some TV signal to the PC; it was just working very poorly!  Apparently I just had gotten a bad HVR-850 unit.

I contacted Hauppauge tech support, and they agreed based on my reported observed behavior that my HVR-850 was probably bad, and to RMA the unit under the warranty.  I got my replacement HVR-850 several days later, and this time, it worked like a charm!  Windows 7 once again recognized the part right away, and I was able to successfully watch live TV on my PC of the same TV channels that I could get on my regular TV.

I tested the DVR functionality of Windows Media Center (WMC) for a couple of weeks, and that worked great as well.  As with the TiVo I’d used previously, it was easy to select a set of shows to record, and have them record automatically.

A cool feature of Windows Media Center is that while watching a program, you can easily drag the current time index of the show back and forth using the mouse, and while doing so, WMC gives you a picture-in-picture indication of what is at the target location.  This makes it really easy to jump to a particular point of a show, and to quickly skip commercials.  It’s nice that Windows Media Center supports control of the software via either a mouse, or via a TV remote control.

At this point, I had effectively turned my primary PC into a fully-functional DVR, for just the $55 incremental purchase of the PC TV tuner above and beyond the cost of the PC hardware and software that I already owned.  Not bad!  However, while watching TV sitting in my office chair at my desk is okay, watching TV on my actual television while sitting on my couch in my living room would be much better!  So, having proven that the Windows 7 DVR software in Windows Media Center and the HVR-850 TV Tuner worked well, I decided to proceed with the next step of going ahead and actually assembling an HTPC for my living room.

Part 3 in this series will cover my attempt to save some money on parts by trying to turn my old 2004 desktop PC into an HTPC.

Sunday, May 16, 2010

HTPC Build Part 1 – Constructing and Installing a DIY Antenna

This is the first in a series of posts I’m writing about an HTPC (Home Theatre PC) build that I recently completed.  To see all posts in the series, click here.

As I’ve mentioned in a previous post on inexpensive home services, I’ve been getting High Definition (HD) TV at home for free via an over-the-air antenna for several months now.  (In most markets in the U.S., since the 2009 digital transition, the major network channels, and often several others, are available 100% legally for free, in HD, via over-the-air broadcast.)  This has been worked great for me, particularly for the price tag ($0/month!), but not perfectly: With my cheap $20 small store-bought antenna positioned next to my TV on the lower level of my home, I could not get the local PBS station, and I had to position the antenna just right to get several other stations (and reposition it whenever anything bumped the antenna).

I set for myself a goal of getting high-quality (strong signal / reliable), hi-def TV into my home, and recording that TV via a DVR (digital video recorder) of some kind, while still maintaining a monthly TV/DVR payment $0.  (If this turned out to be unachievable, I set a fallback plan of getting TV service through one of the satellite TV companies; but even a “cheap” price tag of $25/month ($300/year) was somewhat unpalatable to me compared to a potential payment of $0/year!)

My first step towards this goal was to fix the situation with the reception.  According to the Digital TV reception map at ftc.gov, I should be able to get a strong PBS signal at my location.  My wife and I were very interested in getting PBS due to the good amount of high-quality kids’ programming on that station.

I got several quotes from area companies to install a roof-mounted or in-attic antenna.  All of the quotes came back for north of $500, which was more than I was willing to pay, so I started looking into other antenna solutions.

Poking around online, I came across some interesting plans for a Do-It-Yourself (DIY) antenna on makezine.com.  The plans involved basically assembling a small vertical frame out of wood and a metal pipe, then using pieces from some old wire hangers that are already around the house to form the actual antenna.  When it comes to things other than computers, I’m not exactly a big do-it-yourself guy.  However, these plans seemed simple to do and inexpensive in terms of parts, and there were quite a few very positive comments/reviews on the makezine.com article on the design, so I decided to give it a shot.

Including a trip to the hardware store, the DIY antenna took about $30 in parts and about 4-5 hours of my time to construct.  (I suspect someone used to building this type of thing could have completed the project a lot faster.)  I set the antenna next to my TV and hooked it up, and it worked very nicely!  All of the stations that I already got (including HD signals from the major networks ABC, NBC, CBS, and FOX, as well as many other high-def and standard-def channels) came in better than before. 

However, at this point, I didn’t get PBS.  The next step was to try hooking the antenna up on the second floor of my two-story house, since antennas are supposed to work better when they are positioned higher up relative to ground level. 

Most of the rooms in my house are wired for cable; however, all of the cables in the basement were unlabeled.  Going around my house to one cable jack at a time, I used a little ball of aluminum foil to “short out” the end of a short piece of coax cable connected to the jack, and then I was able to use an ohmmeter to identify the corresponding end of the same cable in the basement utility room. 

Having identified and labeled all of the cables in the basement, I used a connector to directly connect my TV-room cable to my master bedroom cable down in the utility room in the basement.  Then I carried the DIY antenna up to the master bedroom, and tried the TV channels again.  Success – I was now able to get PBS, in great-looking HD!

The final step for the antenna was to install it up in the attic.  I extended the coax cable from my master bedroom (since I intentionally do not, and will not, have a TV in there) up into the attic.  Then I carried the antenna up into the attic, and hooked it up.  I positioned the antenna in the attic by having my wife watch TV and report on how the signal was doing, while I talked to her via our home wireless phones, and made adjustments according to her feedback.  Having found a position where all stations came in great, I left the antenna up in the attic, and closed the attic up again. 

End result: Great-looking and reliable high-definition TV, with my TV simply connected to the wall cable jack.  If you’re looking for a fun DIY project with the end result of getting free, totally legal HD network TV plus more stations, I can recommend giving the makezine.com DIY antenna plans a shot!

The next post in this series will cover my purchase of a PC TV tuner, and trying it out with the DVR software included out-of-the-box with Windows 7, called Windows Media Center.

Tuesday, April 13, 2010

Use your mp3 player to listen to podcasts instead of talk radio on your commute

I have a 15-minute commute by car to work – so that’s about 2.5 hours I spend in the car going to and from work on a typical week.  Occasionally I listen to music in the car, but most often I prefer listening to talk.  Historically, I would typically listen to AM radio on the commute: sports, news, or just whatever was on any station I could find that wasn’t on commercial.

For the past couple of years, though, I’ve listened to podcasts on the commute instead.  For anyone unfamiliar with the term, a typical podcast is essentially a talk radio show that you can download online for free, and listen to on an mp3 player.

Listening to podcasts have several significant advantages over AM radio:

  • Choice of Topic.  At any given time, there are only a few topics available to listen to on talk radio shows.  By contrast, there are a podcasts on a multitude of topics available for free download online.  I’ve replaced listening to general news and sports talk on my commute with topics that are specifically of interest to me, like software engineering, Christian apologetics, and video games. 
  • On-Demand / Pauseable.  With a podcast, the show starts exactly when I sit down in my car in the morning.  And when there’s something interesting being discussed as I arrive at work, instead of missing the end of the discussion, I can just pause my mp3 player, and pick up the show right where I left off when I begin my commute home in the afternoon.
  • Limited or No Commercials.  Whereas a typical radio station plays commercials as much as 15% of the time or more, many podcasts are produced on a volunteer basis and are totally commercial-free.  In my experience, in those podcasts that do run ads, the ads are fairly limited.  And as a last resort, you can always skip past any particularly intrusive commercials that do happen to be present using the fast-forward function on your mp3 player!

My current mp3 player is an Apple iPod, so I use Apple’s iTunes software to subscribe to podcasts, and have the latest episodes automatically download to my PC.  Then, when I sync my iPod with my PC (which I typically do once a week or so), I get several new episodes of my favorite podcasts to listen to on my commute over the next several days.  Easy!  (If you don’t have an iPod, there are several free RSS software packages out there that support audio files that you can use to subscribe to podcasts, and have the .mp3 files automatically download for you.)

The only remaining challenge, then, is how to get the mp3 player output to play through the car speakers (since it’s for obvious reasons dangerous, and apparently in many places illegal, to drive while wearing headphones).  With an older car, you can get an inexpensive device that converts an audio cassette player into a line-in jack for an mp3 player.  Many newer cars these days come with a line-in jack built directly into the stereo system.

However, I drive a model year 2005 car that has neither a line-in jack nor a cassette player.  The solution I landed on for listening to my iPod in my car was a Griffin iTrip FM Transmitter / Charger.  The device is essentially a short-range FM transmitter does a a short-range FM radio broadcast of whatever is playing on your iPod, using an FM frequency that is unused in your area (a frequency that you specify).  Then, you just tune your car radio to that same FM frequency, and you can hear your iPod podcast (or music) over your car’s stereo system! 

I’ve actually bought two copies of the iTrip device – one back in late 2007 for myself, and a second one a year ago for my wife.  Both devices are still in great working condition.  Although the iTrip has an MSRP of US $70, it’s currently going for about $34 shipped on Amazon.com as I write this.  Highly recommended, particularly at that reasonable price.

Finally, a brief plug for a specific podcast: If you’re into video games, check out the Gamers With Jobs podcast.  It’s a group of a few adult gamers that talk weekly about current games (across all of the major console platforms and the PC), and interesting gaming-related topics.  The group has great chemistry and the show is often pretty funny.  And it’s commercial-free!  It’s my favorite podcast.

So – try making your daily commute time more interesting and/or productive by listening to a podcast on a topic of interest to you while you’re driving back and forth to work, instead of just defaulting to whatever happens to be on the radio!

Thursday, March 11, 2010

Issue: Non-ASCII characters change to inverted question mark (“¿”) after save

I was recently entering some content into a Confluence wiki page that included some non-ASCII characters, such as “→” (U+2192, "RIGHTWARDS ARROW") and “←” (U+2190, LEFTWARDS ARROW).  (I can easily type those characters using Alt+Numpad 26 and Alt+Numpad 27 respectively, since my Windows XP machine is set to Code page 437.) However, after saving the document and coming back and looking at it later, all such characters had been changed to inverted (upside down) question mark characters, “¿”.

Investigation revealed that the problem was that the underlying Oracle database to which the content was being saved was set to use the Western European character set ISO-8859-1, as opposed to a more comprehensive character encoding such as UTF-8.  Since ISO-8859-1 doesn’t include the “leftwards arrow” or “rightwards arrow” characters, Oracle converted those characters to the inverted question mark instead.

I wanted to share this here since this information might be helpful to anyone encountering a similar issue in a variety of different possible applications, not necessarily just Confluence.

Wednesday, March 03, 2010

Fix: Error starting JBoss: “Please check that you are in the bin directory when running this script.”

I’m currently attending a developer training class on a Java application that runs on the JBoss application server.  When running a .bat script provided by the trainer on my Windows XP machine that is supposed to start JBoss (among other things), I and several others in the class were having the script fail with this error:

Could not locate C:\path\bin\run.jar. Please check that you are in the bin directory when running this script.

The path from the error message was not the correct JBoss directory containing run.jar, jboss-4.2.0.GA\bin, but a different directory. Searching through the files on my local machine revealed that this error message was coming out of the run.bat file in that same jboss-4.2.0.GA\bin folder.

Looking at the source of run.bat, the script attempts to create and set a Windows environment variable named JBOSS_HOME. I noticed two lines in particular near the beginning of the file:

if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
...
if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%

From other parts of run.bat, I suspected that the root cause of the problem was that DIRNAME was not being set correctly.

From a command prompt, I ran "echo %OS%" (no quotes) -- this returned a value of WINNT -- not a value of Windows_NT as expected by the script.

Oddly enough, in the Environment Variables dialog in the Control Panel, the OS variable is set to Windows_NT -- the value is apparently being overridden by something else running on my machine. From talking to others in the training class, who had the script work from home but not while at the office, the override is apparently being done by one of the login scripts that automatically runs at when we log in to the corporate network.

In any event, the solution/workaround that we came up with was simply to edit run.bat and remove the OS check in the two above-mentioned lines, resulting in the following:

set DIRNAME=%~dp0%
...
set PROGNAME=%~nx0%

This got JBoss up and running successfully, despite the "incorrect" OS environment variable value on our Windows workstations.