Multicast TV Using Raspberry Pi 3 & WinTV-HVR-955Q

DIY project to multicast OTA TV throughout a home. Multicast OTA TV should use a wired ethernet connection and not Wi-Fi. OTA means over-the-air or off-the-air and is the same as broadcast TV.

The goal of this project is to be one step in a larger Raspberry Pi media center.

A Raspberry Pi Media Center must meet the following requirements:

  • Stream my videos
  • Stream my music
  • Display my photos
  • Stream free internet channels
  • Stream OTA TV
  • Record and playback OTA TV (PVR or DVR functionality)
  • Stream protected channels (e.g., Hulu, Netflix, Amazon, etc)

By "stream", I mean it must go to every device connected to my home network, and to family's smartphones, tablets, and laptops.

As of 04JUN2017, the last requirement is not supported by any media center running on the Raspberry Pi. Instead of using open source media centers. I chose Roku to replace my set top box. However, Roku doesn't seem to support OTA TV with recording and playback.

OTA TV is required because it is okay to wait a day or two to watch a TV show, but it is not acceptable to wait a day or two to watch time sensitive content, like a basketball or football game.

Google (cwne88 and multicast) and you will meet my hero. He built an impressive OTA TV setup.

I need to build 6 Raspberry Pi-based TV Tuners to stream the major channels in my city. Also, I need multiple TV Tuners to allow recording or watching of up to six stations at once. I have lots of people in my house and have seven TVs.

However, this instructable is useful if you only want one OTA TV Tuner.

This is the second step in my OTA TV system.

Step 1: Gather Parts

Get parts and tools (prices in USD):

  • Raspberry Pi 3 Element14 $35
  • 5.2V 2.1A USB Power Adapter from Amazon $5.99
  • Micro USB to USB cable 3ft from Amazon $4.69
  • HDMI Cable 4ft from Amazon $5.99
  • Case from Amazon $6.99
  • Hauppauge WinTV-HVR-955Q from Amazon $72.99
  • 1byone Antenna from Amazon $29.99
  • SanDisk Ultra 16 GB microSDHC Class 10 with Adapter (SDSQUAN-016G-G4A) from Amazon $8.99

Parts lying around:

  • MacBook Pro (a PC could be used)
  • TV with HDMI port
  • USB keyboard, USB mouse

Notes:

  • Text enclosed in spades, such as, ♣replace-this♣, should be replaced with an actual value. Of course, remove the spades.

Step 2: Setup Raspberry Pi

Setup the Raspberry Pi and install raspbian following this instructable.

Run raspi-config and change the Raspberry Pi's hostname as appropriate. I am using: tvtuner-ABC, tvtuner-CBS, tvtuner-NBC and so on.

Attach the Antenna to the TV Tuner and insert the TV Tuner in a USB port on the Raspberry Pi. And restart:

After the Raspberry Pi is setup and running Raspbian, plug Hauppauge 1191 WinTV-HVR-955Q Tuner into Raspberry Pi. Run the command:

$ sudo reboot

Step 3: Check If WinTV-HVR-955Q TV Tuner Is Setup Correctly

Login to the Raspberry Pi and run the command to check if tuner is recognized:

$ dmesg | grep dvb
[    4.232615] cx231xx 1-1.5:1.1: Successfully loaded cx231xx-dvb
[    4.232639] cx231xx 1-1.5:1.1: Cx231xx dvb Extension initialized

If there are issues such as a missing driver, then you have the wrong TV Tuner or the wrong version of the kernel or Raspbian installed. With a different TV Tuner, I spent a lot of time trying to resolve these issues by downloading drivers and rebuilding the kernel. It really wasn't worth the time. I returned the tuner to Amazon and got the right one. So, much easier.

Another way to check if it is working is to run the command:

$ ls /dev/dvb
adapter0

If you don't see the above, then stop and start over. If starting over be sure to use the correct parts.

If you do see the above, then continue.

Step 4: Install TV Tuner Utilities

On the Raspberry Pi in a terminal window, install TV Tuner utilities:

$ sudo apt-get install dvb-apps dvblast w-scan -y

Step 5: Create ATSC and Channel Files for Your City

On the Raspberry Pi in a terminal window, run the command:

$ ls /usr/share/dvb/dvb-legacy/atsc

This section allowed me to understand how call signs, network names, digital channel and frequencies map to one another.

In a city's ATSC file, comments start with #.

I determined each channel frequency by using NoCable.org. Click on Change Address and go to your city. NoCable list the call sign (KTBC), network name (Fox), digital channel (7) and upper bound on the frequency band (180). See image.

I had to subtract 3 from each upper frequency to get the scan to work. So, 180 becomes 177. When I created the file below 177MHz had to be converted to Hz, 177000000.

8VSB is the modulation format.

$ sudo nano /usr/share/dvb/dvb-legacy/atsc/us-TX-Austin

and for Austin, add the following lines:

A 177000000 8VSB    # KTBC (Fox)
A 515000000 8VSB    # KXAN (NBC)
A 521000000 8VSB    # KLRU (PBS)
A 587000000 8VSB    # KVUE (ABC)
A 647000000 8VSB    # KEYE (CBS)
A 683000000 8VSB    # KNVA (CW)

CTRL-o, ENTER, CTRL-x to save and exit

Scan channels using the file above. This scan takes less than minute.

$ sudo scan /usr/share/dvb/dvb-legacy/atsc/us-TX-Austin > channels_scan.conf

KLRU is Austin's PBS channel, and the channels_scan.conf has four lines for KLRU:

KLRU-HDv:521000000:8VSB:49:52:3
KLRU-CRv:521000000:8VSB:65:68:4
KLRU-Q:521000000:8VSB:81:84:5
PBSKids:521000000:8VSB:97:100:6

In channels_scan.conf, the last digit on the line is the PID. So, PBSKids PID = 6

Each frequency must have its own .cfg file. Make a cfg file for each frequency that contains channels you want to watch. 521 has four channels, but my family only watches two.

$ sudo nano klru.cfg 

And add the lines:

# unique-multicast-ip:port always-on pid 
239.255.0.1:1234 1 3 
239.255.0.2:1234 1 6

CTRL-o, ENTER, CTRL-x to save and exit the file

Here are the rest of my files for Austin. There are more stations than this.

kvue.cfg

<p># unique-multicast-ip:port always-on pid<br># klru uses 1 2
239.255.0.3:1234 1 1</p>

ktbc.cfg

# unique-multicast-ip:port always-on pid<br># klru uses 1 2, kvue uses 3
239.255.0.4:1234 1 3

kxan.cfg

# unique-multicast-ip:port always-on pid<br># klru uses 1 2, kvue uses 3, ktbx uses 4
239.255.0.5:1234 1 3

keye.cfg

# unique-multicast-ip:port always-on pid<br># klru uses 1 2, kvue uses 3, ktbx uses 4, kxan uses 5
239.255.0.6:1234 1 1

cw.cfg

# unique-multicast-ip:port always-on pid<br># klru uses 1 2, kvue uses 3, ktbx uses 4, kxan uses 5, keye uses 6
239.255.0.7:1234 1 3

Step 6: Run Dvblast

I ran dvblast multiple times. At first, I was getting lots of warning messages. After getting a better digital antenna, these warning messages stopped.

Use CTRL-c to stop dvblast.

On the Raspberry Pi, in a terminal window run:

$ sudo dvblast -a 0 -f 521000000 -b 6 -c klru.cfg -m VSB_8 -e

where the options are:

-a 0 is the adapter number from the ls /dev/dvb command

-f 521000000 is the frequency of the station. For KLRU, the frequency is 521000000

-b 6 is the bandwidth of ATSC channels in the US

-c krlu.conf is the configuration file for KLRU's channels created in a previous step

-m VSB_8 is the modulation used (8VSB doesn't work)

-e enables the electronic pass through guide (EPG), which provides information about the shows

Step 7: VLC

VLC is a great utility and allows us to view multicast TV.

Download VLC for MacBook or install VLC on the Raspberry Pi using the command:

$ sudo apt-get install vlc

Note: VLC will not play OTA TV on Raspberry Pi if that Pi is the one streaming OTA TV.

On the MAC, Install VLC. Open downloads folder. Open the vlc dmg. Drag VLC to Applications folder.

Eject the vlc dmg, and move to trash. If vlc dmg cannot be erased, then right-click and select Delete Immediately.

Go to the Applications folder, and start VLC.

My Mac is set to not allow running apps downloaded from the internet. I have to enter my password and jump through a few hoops to allow VLC to run.

Once running, I pinned VLC to the Dock.

dvblast must be running on the Raspberry Pi for this to work.

Within VLC, click on File > Open Network

Enter

rtp://359.255.0.1:1234

When you press enter you should see multicast TV!

Step 8: Appendix: References

Step 9: Appendix: Updates

Step 10: Appendix: Troubleshooting

Share

    Recommendations

    • Remix Contest

      Remix Contest
    • Tape Contest

      Tape Contest
    • Weaving Challenge

      Weaving Challenge

    11 Discussions

    0
    None
    DavidR978

    2 months ago

    Great article. I am just starting to build my home network and I have a few questions.

    1. You mentioned you have 6 TVs in you home and there are 6 local TV stations. Do you need 1 raspberry pi for each TV or each station gets one pi?

    2. How does each TV control what station they are watching?

    3. How do you get a non-Smart HD TV to get into the network?

    4. How does the record and playback work for each TV?

    5. Does each raspberry pi tuner have its own separate external hard drive or can it go to a central NAS?

    4 replies
    0
    None
    jeff.cartwright.562DavidR978

    Reply 2 months ago

    1. In my setup, each TV has a raspberry pi running kodi on osmc

    I have a pc running tvheadend on Ubuntu with four USB TV tuners. So, at most four TVs can be tuned to four separate TV channels. Start with one and add more as required

    2. The raspberry pi via kodi connects to a tuner and tells it the channel to use. If another TV tries to connect and no tuner is available, then it will show an error message like tuner not available.

    3. Kodi is the smart portion. It shows video on TV through HDMI cable. But sod my TVs are smart and they connect either wirelessly or via Ethernet to my LAN. I don't use smart TV features often.

    4. Tvheadend is the dvr. You can set and play recordings through any kodi device.

    5. My tvheadend pc was a gaming machine that I bought for my son. It came with a terabyte drive. He didn't want it any more and I converted it from windows to ubuntu. So, the TV headed pc acts as the Nas for all rpis.

    I use a Logitech harmony remote o control all devices connected to the RPi: demon, Blu-ray, kodi and roku... And gaming gear

    0
    None
    DavidR978jeff.cartwright.562

    Reply 2 months ago

    Thanks for the reply. It helps.
    My problem is that I have 2 TV's (1 Smart and 1 Dumb) and I rent so I can not drill homes in he wall. The dumb TV can stream thru a Blu-Ray DVR. The antenna cable for the OTA antenna goes thru a window with a RG-59B/U (it came with the antenna and its thin enough not to be crushed when the window is close). I want to be able to watch OTA TV on both sets but there is a room between the 2 sets. My solution is to network them together.

    Once the Raspberry Pis are plugged into my network LAN How does each TV set know what Raspberry Pi receiver to use? And can I use existing remotes for controlling Kodi to change channels?

    For the PVR portion do I need a separate Raspberry Pi receiver to record?
    Does the PVR recorder need a separate external Hard Drive or can it be stored on a NAS?

    How do I link Netflix, Amazon Prime, Hulu, YouTube to Kodi? do I need a separate Raspberry Pi for that?

    I realize these are a lot of questions and I am knew to this technology. Store clerks are not that knowledgeable with DIY and open source set-ups and you have done it so have some expertise and experience with the subject.

    Thank you again for the help

    0
    None
    jeff.cartwright.562DavidR978

    Reply 2 months ago

    RPi 3 B+ has built in Wi-FI and should be able to play OTA TV in another room. Some of my TVs use Kodi and Wi-Fi.

    I run these on Roku: Netflix, Amazon Prime, Hulu, YouTube, ... I tried many tutorials and could never get these to run on Raspberry Pi without being choppy.

    Only OTA TV runs on Kodi

    The PVR needs to be another computer fast enough to keep up with the TV tuner. The TV tuner is connected to the antenna.

    I could get one end to work or the other, but I could never get 2 Raspberry Pis to capture AND play OTA TV. IMO, either the PVR or the Kodi machine has to be a PC class processor. Also, the PVR needs to have a large disk drive. You can use a USB drive on an RPi, but there is a limit of 400Mbps on the RPi bus (which includes ethernet, microsd card, USB, ...).

    The RPi plugs into one TV using an HDMI cable. The HDMI cable can only be plugged into one TV. So, one RPi and one Roku for each TV. The TVs should have two HDMI ports.

    I hope this helps.

    0
    None
    dylanlive

    7 months ago

    Great article, thanks for writing it!

    At the end, you mention to connect on another computer's VLC via: rtp://359.255.0.1:1234

    Can you explain where you got that IP Address from? It wasn't listed anywhere else in the article. Is this supposed to be the Pi's IP?

    2 replies
    0
    None
    jeff.cartwright.562dylanlive

    Reply 7 months ago

    Sorry, it looks like a typo. It should be: 239.255.0.1:1234, which should be channel 1. It should come from what you added when the command was run

    $ sudo nano klru.cfg

    and add
    # unique-multicast-ip:port always-on pid
    239.255.0.1:1234 1 3

    239.255.0.2:1234 1 6

    If 239 works, let me know and I will fix the typo.

    0
    None
    serverguy

    Question 11 months ago on Step 10

    I can usually figure out tech problems given enough time but I got 20 people coming next week and I'm a Raspberry Pi newbie. I know the Hauppauge 955Q works well as I can watch live TV on my Windows 10 system - WFTX is especially stable. Can you please point me in the right direction of using my Pi to stream live TV?

    system-info.jpgdvblast-problems.jpg
    1 answer
    0
    None
    jeff.cartwright.562serverguy

    Answer 11 months ago

    Sorry. I am not understanding the question. On which step did you get stuck or did things go wrong?

    0
    None
    tschmidt

    1 year ago

    I set this up today on Raspbian Stretch, and it works great! Thanks for the easy-to-follow 'ible :)