Monday, April 02, 2007

HDHomerun





http://www.silicondust.com/wiki/products/hdhomerun
http://www.silicondust.com/forum/

- Think of it as NAS but for hdtv OTA and qam.
- about the size of a VHS tape.
- Just drop this device anywhere on your wired network, split your cable signal or hook up two hdtv antennas (or mix and match). Now stream that mpeg2 TS over udp to any pc on your network. Watch it in VLC or save it.
- Very convenient to setup. NO pc to open up, no free PCI slot needed. No messy or difficult drivers to install. You have the flexibility to access the tuners over any PC on the network. Very expandable. If you need more tuners just drop in another HDHR (or 2 or 3). With one hdhr, impact on a 100mbps network is pretty minimum even with both tuners streaming at the same time (only about 30mbps used out of the 70mbps real world throughput you usually get out of a 100mbps network). You could always upgrade to a 1000mbps network backbone if you need additional bandwidth.
- Supports most of the popular pvr software out there.
- There are beta drivers in their forums for mapping qam to ota in MCE. Pretty cool trick since mce only supports ota hdtv.
- Overall, NOT for the tivo user. But if you are a pvr homebrew kind of user this thing is amazing.
- They even include full source code.
- Price isn't bad either. At $170 it's only a little more than a fusion 5 gold ($150) and you get two tuners!
- After a week of recording the thing has been rock solid and much more reliable than the fusion 5 gold.
- I've only tested hdhr with my own homebrew pvr software that I wrote. I have NOT tested this with MCE.
- TS recordings stream just fine from MCE to xbox 360 by mapping a network share and going to the videos menu item.
- Software included is a bit low level and requires a more technically savvy user. A pretty basic gui app is included to let you tune into stations, launch vlc to watch it, and check signal strength. There is also a CLI app which is very flexible.

hdhomerun_config
Usage:
hdhomerun_config discover
hdhomerun_config <id> get help
hdhomerun_config <id> get <item>
hdhomerun_config <id> set <item> <value>

hdhomerun_config <id> scan <tuner> [<filename>]
hdhomerun_config <id> save <tuner> <filename>

hdhomerun_config <id> upgrade <filename>

Supported configuration options:
/tuner<n>/channel <modulation>:<freq|ch> Get/set modulation and frequency
/tuner<n>/channelmap <channel map> Get/set channel to frequency map
/tuner<n>/filter 0x<nnnn>-0x<nnnn> [...] Get/set PID filter
/tuner<n>/program <program number> Get/set MPEG program filter
/tuner<n>/target <ip>:<port> Get/set target IP for tuner
/tuner<n>/status Display status of tuner
/tuner<n>/streaminfo Display stream info
/tuner<n>/debug Display debug info for tuner
/ir/target <ip>:<port> Get/set target IP for IR
/lineup/location <countrycode>:<postcode> Get/Set location for lineup
/lineup/location disabled Disable lineup server connection
/sys/version Display firmware version
/sys/copyright Display firmware copyright
/sys/debug Display debug info
Supported modulation types: 8vsb qam qam64 qam256
Supported channel maps: default us-bcast us-cable us-irc us-hrc

- here is a great post to help you understand the CLI app a bit better.http://forums.snapstream.com/vb/showthread.php?t=34073&page=2 (start at post #28)
- To stop a particular tuner from broadcasting you need to issue a /target none
- http://www.coolstf.com/tsreader/ comes in really handy in analyzing TS streams.

Some general HDTV Playback Tips
- Splitters to playback high def mpeg2 TS files. You need this to be able to playback TS under the DX engine. This isn’t required for the VLC engine. Advantages of using the DX engine for playback are 1) I think powerdvd decoders look better. 2) DX takes advantage of DXVA acceleration provided you have a compliant DX9 video card and can greatly reduce cpu utilization. See http://aroganworld.blogspot.com/2006/04/hdtv-playback-and-general-directshow.html for lots more info.
- Basically there are 3 different ones you can use: nero splitter that comes with nero vision, cyberlink splitter that comes with powerdvd 7 (I don’t think 6 has it), and hdtvpump: http://www.dvbportal.de/projects/hdtvpump/ . So far I’ve only tested the cyberlink one and the nero one. The cyberlink seems to have a bug and reports the wrong duration on the file so I recommend the nero one. You only need 1 nero file(nesplitter.ax) and regsvr32 it. Then up the filter merit and reboot to make sure it’s the splitter being used.
- I ran into a weird de-interlacing issue while trying to playback an HD TS file using the DX engine through svideo (I know svideo is only SD but hey it still looks better). To fix it I installed powerdvd7, latest ati drivers, reinstalled pvr 250 drivers (because they somehow got hosed in the process). In the ati control panel set to clone. In home theater under video set to clone overlay only in hometheater full screen mode. Set deinterlace to auto detect. After that the video looked really good.
- ac3: install ac3filter: http://ac3filter.net/ , run config, check use spdif, apply. turn off dolby digital live in your mixer if you use a nf2 mb. That's it! true ac3 spdif 5.1 pass thru. You might also want to go to the system tab and uncheck mpeg audio.
- ProjectX: Handy utility to repair or convert ts streams to mpg, etc. Useful if you record using filter instead of program number and you need to repair the PAT/PMT in the TS. Just run projectx -tots myfile.ts.

other resources:
http://www.avsforum.com/avs-vb/showthread.php?t=731457
http://www.missingremote.com/index.php?option=com_content&task=view&id=633&Itemid=152

rcHDHR
rcHDHR.zip (1.08 - 8/13/08)
Complete source is included. I wrote this little application to make recording a bit easier and to simplify integration with other applications.

Command Line utility that wraps calls to hdhomerun_config so you can record with a single command line call.

Installation:
Requires Microsoft .NET Framework Version 2.0.
Unzip to a directory of your choice. Open rcHDHR.exe.config in notepad.
hdhrconfig: make sure this points to where hdhomerun_config.exe is installed
pausems: number of milliseconds to pause between each call to hdhomerun.config
chmap: issue a channelmap command (default us-bcast us-cable us-irc us-hrc) or leave blank to skip
stopapp: this sends the ctrl c to hdomerun_config so it stop recording and closes nicely.
filterattempts: how many times to issue the filter command if one was passed in. 1 is usually fine.

Usage:
rcHDHR deviceid tuner chtype channel program dursec port filename [filter]
rcHDHR kill (close all instances of hdhomerun_config by sending ctrl c)

deviceid: use FFFFFFFF if you only have one hdhomerun on the network otherwise use the unique device id (hdhomerun_config discover will display this)
tuner: either 0 or 1 to determine which tuner to use
chtype: modulation type for tuner (8vsb qam qam64 qam256)
channel: Channel number to tune in
program: program number to tune in
dursec: duration for the recording in seconds
port: unique port you want to receive the udp stream. Make sure these are different for each tuner. I use 5002 and 5004 for tuner 0 and 1.
filename: pass this in quotes if you have spaces
filter: optional. Tune using filter instead of program number. Make sure you also enclose this in quotes.

kill: if you issue the kill command (no other parameters are needed) it will loop through all running instances of hdhomerun_config and send a ctrl-c to stop that instance.

UPDATE: 1.01 (4/2/07)
- changed default pause to 3000ms
- When you pass a filter I now set the program first and then the filter.
- A log is always created in the same directory as rcCtrlC with the name rcHDHR.log. The log self trims so don't worry. It won't grow forever.

UPDATE: 1.02 (4/5/07)
- added much more detailed logging. Every set is followed by a get
- added the ability to set any channelmap (optional)
- added the ability to try the set filter command multiple times if you want to.

UPDATE: 1.03 (4/16/07)
- fixed a serious bug where you couldn't record beyond about an hour and 10 min.
- date/time is written to the console.

UPDATE: 1.04(2/28/08)
- in rcHDHR.exe.config I changed chtype to chtype0 and chtype1. This way you can specify qam for one tuner and 8vsb (atsc) for the other if you wish. Make sure you update your config if you are upgrading from an earlier verison.

UPDATE: 1.06 (3/26/08)
- skipped 1.05 (internal release only)
- chtype0 and chtype1 have been removed from the .config file. You now need to pass it as a command line argument. This makes a lot more sense if you have more than one HDHR.
- rebuilt using visual studio 2008 but still targeting the .net 2.0 framework.
- fixed a vista issue where it wasn't getting the proper ip address for setting target.

UPDATE: 11/3/09
- So I've now had 3 power supplies die on me over the past few years across two different HDHR's. Here are the signs to look for:
- The lights always look fine on the actual box so that is NOT an indicator.
- You get 0 byte recordings.
- Your symbol jumps from 0 to 100 back and forth constantly.
- Radio shack replacement power supplies are quite expensive. It's about $20-$30 once you get the proper size tip. You need 2.1A (rs one was 2.0A), 5v, tip positive.
- Open a support ticket with silicon dust and they are usually very good about shipping out a replacement.
- It's gotten so bad I suggest having a spare power supply on you at all times so you have less down time. I just now expect to replace the power supply once every year minimum. Silicondust really needs to find a new Chinese supplier for these things.

UPDATE: 1.08 (9/11/2011)
- added vchannel support for hdhomerun prime.
rcHDHR deviceid tuner vchannel dursec port filename
- there are 2 new app settings which are pretty obsolete. It was a work around for an earlier buggy version of the hdhr prime firmware. It's since been fixed. Just make sure they are in your rcHDHR.exe.config file (primegoodch, primetuneattempts)

20 comments:

Anonymous said...

Why do you have a delay between calls to the config utility?

ARogan said...

Well since I'm sequentially sending commands to the cli config utility I need to give it time to accept the command and process it before I go to the next one. You can play with the delay but having the delay between calls ensures reliability.

Anonymous said...

I am having problems with dropped packets with my configuration. Can you add a "debug" option to your program so I can see what is happening?

Thanks,
Joe

Anonymous said...

This utility is awesome. I got my HDHR last week, and I've spent damn near 14 hours a day trying almost a dozen different programs just to record streams. This is the first one that works like I want it to, and I will gladly trade off user friendliness for stabilty. I'm also using rcTVCap for the HDPVR I also got last week, and that also works awesomely.

So, thanks a bunch.

Just curious -- is there a way to put a date varible in the file name? I tried using %date% in the file name string, and it causes the program to finish immediately and doesn't record anything.

ARogan said...

hanson, glad you found these little apps useful. I don't think %date% produces all legal filename characters. Maybe try some substring manipulation: %date:~0,2%%date:~3,2%%date:~6,4%
That should get you the date without the slashes.

Anonymous said...

Thanks, you are correct, the slashes returned in the %date% command were making the file name invalid. I have that all fixed now.

One little thing -- the resulting file can be played by MPC, but it it won't extend the end time as it's recording -- eg, if I start the file 5 mintues into recording, the end time is reported as 5:00 and even though it's still recording, it stops at that point. VLC will keep playing as the file is recording.

Is there any way to get the dump file to allow MPC to extend the end time while its still recording? I know MPC has this capability, as I use grafcorder to record off of my STB via firewire, and by using the Cyberlink dump filter, I was able to get the file to play in MPC in this manner.

Also, am I to assume if I want to run two instances of rcHDHR, I would need a second directory and a rename rcHDHR.exe to rcHDHR2.exe and change all the references in the command line or is this simply not possible? Or is there a better way to have two instances recording from each tuner?

ARogan said...

Not sure about MPC since I'm more of a zoomplayer user. As far as using more than one instance of rcHDHR I do it all the time (I have two hdhr's so 4 tuners). No need to make multiple copies. Just change your command line. The first parameter is the deviceid. Every hdhr on the network has a unique ID (which you can see if you click on the HD tray icon). Pass that unique ID instead of FFFFFFFF. The next parameter is tuner so just pass 0 or 1.

Anonymous said...

Sorry, ignore my comment about the simultaneous recording. I had made a mistake with the scheduler that made it look like the first one stopped prematurely.

Anonymous said...

I'll have to check out ZP. The PQ with MPC is good but not great -- the ts files look nicer through MyHD, but ever since I went to dual core, a ton of features broke and they've stopped MyHD dev.

Thanks again!

Anonymous said...

About a month ago, Comcast remapped ABC and NBC, and HDHR would no longer scan these channels. It turns out that Comcast remapped the channels, but since they used mixed HRC/Cable frequencies, HDHR could no longer find them.

I just updated with a new software version today, and this problem was resolved. However, rcHDHR cannot record the new channels, 32-1 and 32-3. Is there anything I can add to the command line that will enable me to ignore the HRC/Cable frequency issue?

ARogan said...

rcHDHR is just a wrapper to hdhomerun_config. So see if you can get it to record with hdhomerun_config first. You might want to look at rcHDHR.exe.config:
add key="chmap" value=""
valid values are: us-bcast us-cable us-irc us-hrc

Anonymous said...

Totally worked! Thanks for everything. Just to note: I did create an rcHDHR2.exe and rcHDHR2.exe.config so that I could record from both the cable and hrc channels.

Anonymous said...

FYI -- I had to edit the rcHDHR chmap value to us-cable. I assume the us-hrc recording defaulted the freq to HRC, so you need to change it back to cable.

Anonymous said...

How do I get the date in the file name? I tried all kinds of things can't get it to work. What should the command line look like? Thanks!

Hanson said...

It has been a few months, so perhaps you already found a solution, but here is my belated method:

I start the batch file to parse the time and date. This is because the time and date contains slashes, and they mess up the file name. So this litle routine takes out the slashes. Then I can enter the time and date in the file name. This is the entire content of my batch file:

Set MyTime=%Time%
Set MyTime=%Mytime:~0,5%
Set MyTime=%MyTime::=-%
Set MyDate=%Date%
Set MyDate=%MyDate:/=-%

rchdhr2 ffffffff 1 qam 32 1 7400 5004 "e:\abc-%mydate%-%mytime%.ts"

Anonymous said...

At the end of January, I finally submitted a trouble ticket on a whining power adapter. It was the replacement for the original that I got free. Not this time: $15. After hunting, I found the Linksys PA100-NA Power Adapter for $9.99 at Amazon. It *should* be much more reliable because it's really a Cisco part that they include with their VoIP phones... This is the one you want.

--Frank

Joe Donth said...

I am moving my recorder from XP to Win7 and the rcHDHR program does not work any longer. The IP routine is broken. The version I have been using for years produces this result:

11/10/2012 11:14:19 AM [1011EB32-0] rcHDHR v1.03 (4/16/07)
11/10/2012 11:14:19 AM [1011EB32-0] hdhr = rcControl.exe
11/10/2012 11:14:19 AM [1011EB32-0] IP Address = fe80::7110:f992:e53:5571%12
11/10/2012 11:14:19 AM [1011EB32-0] pauseMS = 1000
11/10/2012 11:14:19 AM [1011EB32-0] chMap = us-bcast
11/10/2012 11:14:19 AM [1011EB32-0] stopTime = 11/10/2012 11:16:19 AM
11/10/2012 11:14:19 AM [1011EB32-0] stopApp = rcCtrlC.exe
11/10/2012 11:14:19 AM [1011EB32-0]
11/10/2012 11:14:19 AM [1011EB32-0] hdhrconfig = rcControl.exe
11/10/2012 11:14:19 AM [1011EB32-0] deviceid = 1011EB32
11/10/2012 11:14:19 AM [1011EB32-0] tuner = 0
11/10/2012 11:14:19 AM [1011EB32-0] channel = 50
11/10/2012 11:14:20 AM [1011EB32-0] program = 3
11/10/2012 11:14:20 AM [1011EB32-0] dursec = 120
11/10/2012 11:14:20 AM [1011EB32-0] port = 5000
11/10/2012 11:14:20 AM [1011EB32-0] filename = "Z:\Busytown Mysteries=2012-11-10@1100=Busytown Lake Monster Mystery; Bad Driver Mystery"
11/10/2012 11:14:20 AM [1011EB32-0] filter =
11/10/2012 11:14:20 AM [1011EB32-0] filterAttempts = 1



The "latest" version produces this:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'rcCommon, Version=1.0.4271.22414, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

File name: 'rcCommon, Version=1.0.4271.22414, Culture=neutral, PublicKeyToken=null'

at rcHDHR.clsHDHR.doMain(String[] args)

at rcHDHR.Program.Main(String[] args)



WRN: Assembly binding logging is turned OFF.

To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.

To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Any fixes for this program or any recommendations for an alternative?

Thanks!
Joe

Hanson said...

I just got the HDHR Prime and while the rcHDHR command still works for clear QAM, I am not sure how to record the decrypted channels (which I can watch through the HDHR setup program).

The current rcHDHR command looks for the program number after the channel number, but none of the cablecard channels list a program number.

I think I either need the default program number for cablecard channels or it's an issue with the chmap value in the config file or change the antenna from qam to qam256 or something else.

Any suggestions?

Hanson said...

I've tried various combinations thereof, but rcHDHR quits. The error in the log is "channel not found".

Hanson said...

After carefully rereading the part about vchannel support, I was able to get rcHDHR to work with the cablecard channels. Thanks for all of your work!