HDHR Prime, MacBookPro, VLC and me

[ Networking ] [ HDHR Prime ]

My primary means of serving TV to my MacBookPro is via MythTV, which has served me well for the past 5 or 6 years. I recently acquired an HDHR Prime into which a CableCard can be plugged. This eliminates the need for a settop box, and the rather bizarre Linux Remote Control (LIRC) hoops one must dance through to "blast" infrared channel changing signals from a Linux box to a cable box. The HDHR Prime plus CableCard setup also upgraded my signal quality considerably.

There are times, however, when MythTV is a bit bulky for my TV viewing needs (live events come to mind- Saturday morning British Premier League soccer in this house). Enter VLC.

There are two ways to connect VLC to your Prime's stream: HTTP or UDP. I have had more stability with UDP, but I haven't played too much with the HTTP stream. To connect your Mac to your Prime via http is pretty simple. The stream URL looks like this:

http://<prime ip>:5004/<tuner>/v<channel>?duration=<seconds>

Drop this into the Network URL on VLC (File, Open Network):

Similarly, to connect via UDP, drop


into the Network URL box on VLC. This will tell VLC to look for an incoming UDP signal. We will send the signal to it using the hdhomerun_config command line tool. That will look like this:

hdhomerun_config 111111A8 set /tuner0/target;
hdhomerun_config 111111A8 set /tuner0/vchannel 67;

The first line tells the Prime (the one with the unique ID 111111A8) to send it's signal to my IP address at port 1234 and the second line tells the Prime to tune to channel 67, which happens to be Comedy Central in my area. To make this slightly easier, I really geeked out and made a simple bash function to do all of this. As a hack, I made an .m3u playlist which connects to the UDP stream that I put in my Documents folder. I couldn't find a way to connect directly to the stream from the command line.

tv() { 

if [ ! "$(pgrep "VLC")" ]
	echo "Opening VLC...";
	open /Applications/VLC.app/ ~/Documents/hdhr.m3u 
	sleep 3;


hdhomerun_config 131765A8 set /tuner0/target;
hdhomerun_config 131765A8 set /tuner0/vchannel $@;

I stuck this script in my ~/.bash_profile. Reload your profile to use it with the source command on the command line:

source ~/.bash_profile

To call up Comedy Central, I just need to enter

tv 67

On the command line.

This space intentionally left blank