MythTV Backend Setup

I've read many posts on various ways to setup a MythTV backend, and I'd like to thank the authors by telling you how I set mine up. Also, this will be my own HOWTO, just in case my server packs in!

My Hardware

As you've no doubt already seen, my server has a couple of DVB tuner cards:

FreeView TV Tuners: Hauppauge WinTV-NOVA-TD-500
Hauppauge WinTV-NOVA-T Stick (spare - not normally connected)
FreeSat HD TV Tuner: TeVii S660

Problems Encountered

I'll tell you about these first of all, so that you can make sense of my magical sequence of events to get up and running.

  • Every so often (mainly after power-cuts as different things switch back on at different times), the tuner cards were being read in a different order, so I ended up with a custom set of udev rules to specifically name the cards.
  • At one time I was getting zero byte recordings and as described in the forum post the problem may have been due to downloading the electronic programme guide (EPG) over the air. So, I've switched to XMLTV for EPG data and so far all is good, although there isn't EPG data for all available channels (yet?).
  • Occasionally I have to restart the backend as all tuners are used, but nothing is being recorded. I've not bottomed that one out yet, but as soon as I do, I'll update this.
  • When I was on any channel and wanted to switch to a channel that was on another tuner (going from FreeView to FreeSat for example) it quite often failed to change and sometimes needed a backend restart. I think this was due to identical channel names on different tuners being used.
  • I could run "mythfilldatabase" as my own user, but the mythtv user couldn't - this turned out to be a permissions problem and is dealt with at the end of the sequence of events.

My Current Solution

I decided (after trying several methods) to tune and name the FreeView and FreeSat channels into their normal locations and give them unique names. For example, all FreeView channels have a T- prefix (as in DVB-T) and similarly the FreeSat has the prefix S- (as in DVB-S or DVB-S2).

That way, there is no uncertainty and T-Channel4 lives at channel number 4 and is for FreeView, whereas S-Channel4 lives at channel number 104 and is for FreeSat.

Files List

/etc/udev/rules.d/10-dvb.rules
This file creates custom named DVB devices to stop the "adapter" numbers changing for a specific tuner card, i.e. no longer need to point to /dev/dvb/adapter0/frontend0
This is number 1 in the sequence of events.
~/mythtv-rename-freeview.sql
This file renames all of the FreeView channels (note STV region - yours will quite possibly be different!) such that they all have the prefix T-
This is number 10.v in the sequence of events.
~/mythtv-rename-freesat.sql
This file renames all of the FreeSat channels such that they all have the prefix S-
This is number 10.xiv in the sequence of events.
~/mythtv-retune-all.sql
This file moves all channels up the channel numbering space by 100000, makes them invisible and then moves all of the FreeView and FreeSat channels that are required into their correct channel position.
This is number 10.xv in the sequence of events.

Sequence of Events

  1. Implement udev rules as / if required (if you have multiple cards)
  2. Connect the cards and fire up the server
  3. Launch MythTV Backend
  4. Define all of the attached capture cards making sure to pick the custom device names and not adapter0 etc.
    1. First DVB-T (Hauppauge Nova-TD, tuner 0)
      Capture Card Freeview 0
    2. Set the recorder options as required (as mentioned previously, the EPG will not be downloaded over-the-air)
      Capture Card Options
    3. Second DVB-T (Hauppauge Nova-TD, tuner 1)
      Capture Card Freeview 1
    4. Same recorder options for this
    5. First (and only) DVB-S2 (TeVii S660)
      Capture Card Freesat 0
    6. Same recorder options for this
    7. Capture card list should look similar to this:
      Capture Card List
  5. Define a video source for both FreeView and FreeSat, but do not let MythTV populate the files. See the next step for that! Just remember the exact names of the video source that you set up, in this case "XMLTV FreeView" and "XMLTV FreeSat"
    1. XMLTV for FreeView from Radio Times UK
      Video Source Freeview
    2. Remember... do not hit that "configure" button!
    3. XMLTV for FreeSat from Radio Times UK
      Video Source Freesat
    4. Remember... do not hit that "configure" button!
    5. Video source list should look similar to this:
      Video Source List
  6. Quit out of MythTV Backend
  7. Run these detailed instructions to get the XMLTV listings for both FreeView and FreeSat. If you're using the same names as me, then you will end up with two files called "XMLTV FreeView.xmltv" and "XMLTV FreeSat.xmltv" in your ~/.mythtv directory.
  8. I'd advise editing these files to strip out the channels that you don't want as it will use up bandwidth and processing time, not to mention showing up in channel listings.
  9. Re-launch the MythTV Backend
  10. Define the Input Connections and tune in some channels
    1. The Input Connection list should look similar to this:
      Input Connection List
    2. Configure "FreeView A" by connecting the first FreeView tuner to the FreeView video source (or channel list)
      Connection Freeview A
    3. Scan for channels on the FreeView (DVB-T) tuner
      Tuning DVB-T
    4. Store all of the DVB-T channels that it finds
    5. Run the script "mythtv-rename-freeview.sql" (instructions at the top of the file) to add the T- prefix to all FreeView channels. Note that you may need to modify the file depending on your broadcast region.
    6. Configure "FreeView B" by connecting the second FreeView tuner to the FreeView video source (or channel list)
      Connection Freeview B
    7. No need to tune in the channels again, as the video source "XMLTV FreeView" holds the list for all FreeView tuner cards.
    8. Configure "FreeSat A" by connecting the first FreeSat tuner to the FreeSat video source (or channel list)
      Connection Freesat A
    9. Scan for channels on the FreeView (DVB-S) tuner
      Tuning DVB-S
    10. Store all of the DVB-S channels that it finds
    11. If your FreeSat card is HD, then scan for channels on the FreeView (DVB-S2) tuner
      Tuning DVB-S2
    12. Store all of the DVB-S2 channels (and any others) that it finds
    13. You may want to repeat the Freesat tuning as I found that not all channels are picked up on the first attempt.
    14. Run the script "mythtv-rename-freesat.sql" (instructions at the top of the file) to add the S- prefix to all FreeSat channels. Note that you may need to modify the file depending on what channels your tuner picks up.
    15. Run the script "mythtv-retune-all.sql" (instructions at the top of the file) to renumber all of the defined channels. Note that you may want to modify this file depending on what channels you actually want visible.
  11. Select the Channel Editor and download icons for all of the channels. If all goes to plan, then you should have something similar to this:
    Channel List Freeview Channel List Freesat
    Note that is is quite possible to end up with several definitions for some channels - they may be on multiple transponders.
  12. Quit out of MythTV Backend, but do not run mythfilldatabase... we're not done yet!
  13. In your ~/.xmltv directory, recursively set the group ID to "mythtv" and give group write permissions. This is because the "mythtv" user needs to write the EPG data here.
  14. Run mythfilldatabase manually, or let the system do it itself. Note however that it takes ages to download and parse all of the data!
  15. Sit back, fire up a MythTV Frontend somewhere, point to your Backend and start watching / recording TV!

Original Sources of Information

In no particular order (apart from alphabetical):




Del.ico.us Digg Facebook Google LinkedIn LiveJournal NewsVine reddit StumbleUpon Twitter
Valid XHTML 1.0 Transitional Valid CSS! [Valid Atom 1.0] [Valid RSS 2.0]
[ Page last updated Sun 14th Jan 2018 | viewed 998 times ]