Saturday, December 15, 2012

What it does, and how to make it do it

Rev C (see Notes)


The HDHomeRun is a digital TV tuner designed to be connected to ethernet ports. It produces amazing picture and sound quality even with weak signals, as is typical of the silicon tuner ICs it uses. Of course, if the signals are barely detectable in your area (see TVfool), you'll need an antenna placed where it can make the most of what's available (see HDTV Primer), and with enough gain to boost the signals to a level suitable for an antenna preamp. Once that's done, you should have no problems getting amazing video and audio.

You'd think that SiliconDust would spend some of their obscene profits on documentation for Linux. Windows installation is automatic, so no Windows documentation is required.

After flailing about for a couple of days thanks to the lack of decent documentation, I discovered that the necessary software (hdhomerun-config and hdhomerun-config_gui) can be installed automatically on a computer running Ubuntu, via the Ubuntu Software Center. Or you could get a degree in programming, and do it manually.

Then, by entering some simple commands (outlined below) into command-lines in terminal windows, you can save the HDHomeRun's output directly to your hard drive with no conversion to another format, so the recordings are also amazing, but they consume a lot of disk space. (By the way, the xfs format is the most efficient for recording and deleting those potentially vast ts files, so you might want to create a partition for the directories where recordings might be saved and give it the xfs format.)

The HDHomeRun can be connected directly to PC's, and this paragraph describes how this is done with a computer running Ubuntu 12.04. (Connecting the HDHR to a router would be simpler, if you had a router.) In Windows, this setup is totally automatic, but in Ubuntu, it's only partly automatic. In Ubuntu (as with Windows), you have to first connect the signal and power to the HDHomerun, and connect it to your PC. Then you open the System Settings ("gear" icon on left of screen) and select Network, select Wired, and then set the on/off button to On. Then, you click on Options, then IPv4 Settings. Then, in the Method box, select Link-Local Only, and Ubuntu will automatically establish a connection to the HDHomeRun. The exact procedure will vary between some versions of Ubuntu, but I assume there will be some resemblance. If the HDHR and your computer ever have difficulty establishing a connection, after having established connections previously, go into System Settings/Network/Wired and verify that the port is turned on. Sometime clicking on Rescan in the HDHR control panel helps.

At this point, you should be able to fire up the HDHomeRun GUI by clicking on its icon on the left side of the screen (assuming you let the Ubuntu Software Center install the HDHomeRun software, as described above). You should also be able to find channels and view them via the VLC player. (If scenes with motion appear "smeared," this could be due to the VLC player's difficulty with de-compressing the amount of compression used by that station. One fix is to record it and convert it to another format before viewing.) YOU CAN ALSO SAVE THE PROGRAM YOU'RE WATCHING to Downloads by clicking on the Record button, which can be made to appear by clicking on View in the main menu, and selecting Advanced Controls.

The VLC player produces smeared/pixelated video when playing some programs on some  systems, because some high-definition programs require a lot of processing to decode "on the fly" due to the amount of compression used in encoding them. This is a complex issue that's beyond the scope of this entry, so I won't mention all of the things I considered in the course of finding a solution that works for me, which is to save the program to disk, and convert it to a format which is easier to play. A "transcoder" program called Handbrake performs such conversions very simply, and with satisfactory results. You just need enough space on your drive for the source file and the output file.

As far as I know, VLC doesn't facilitate recording both tuners' outputs simultaneously. Its documentation doesn't say anything about recording, and there's nothing about recording with VLC on the internet either (or at least there wasn't until this was published), other than a passing remark about the hidden Record button.

However, there is a way to record the outputs of both tuners simultaneously without installing any more software. It requires typing (or copying/pasting) text into the Linux command-line, which is accessed by pressing Ctrl-Alt-t. Pasting into the command line in done with Ctrl-Shift-v.

First, set each tuner to the desired channel, and note that each tuner has the same ID#, followed by -0 or -1 (displayed in the GUI). Then open two terminal-windows, because once you start a recording process in one window, you won't be able to enter any more commands into it.

Then decide where you want to put the recordings (.ts files) and change the directory (folder) to that directory by typing cd Downloads or cd Videos (or whatever folder you want to use) into the command line, and pressing Enter. (Note: the cd command is case-sensitive, so that "videos" is not the same directory as "Videos.") Then decide what you want to name the files. In the first, terminal, enter the following command:

hdhomerun_confg ID# save /tunerN filename.ts,

where ID# is the tuner's ID#, N is 0 or 1, and filename is the file where you want to save that tuner's output. (These commands can be found in the HDHomeRun Development Guide, which can be found by Googling the title.)

That should start the recording process for that tuner, and the terminal-window will start filling up with dots to indicate recording in progress.

To record the other tuner's output, do the same thing in another terminal-window.

To stop EACH recording, click on the ID# of the associated tuner in the GUI "control panel," click on Stop, and then close the associated terminal-window.

Once you're done recording, you can close the terminal windows, open the VLC player, and open the recording you want to watch.

Those who want to automate recording to a degree similar to that of programming a VCR should consider HDHomeRun Recorder. The official page can be found by Googling "hdhomerun_recorder" (with the quotation marks and the underscore). As of this writing (12/12), the best set of instructions I've seen on installing and using it (besides mine) is contained in the Michigan Telephone blog, evidently written by a programmer.

Notes
Rev C: In section on setting up partition with XFS format, suggested using the partition for all directories where videos might be saved, instead of just the Videos directory. Experience has shown me that they the VLC player puts them in the Downloads directory, and that other methods of saving the files put them in other directories. 
Rev B: Revised paragraph about video smearing/tearing when being played by the VLC Player.  The previous revision seemed to put the blame on the VLC Player itself, when it's actually due to the demands which it puts on the system in some cases. There are entire forums dedicated to this issue, so I can't cover all the bases here.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.