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
(SQL files have a .txt extension to allow access via web server - rename them without the .txt)
/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/frontend0This 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
- Implement udev rules as / if required (if you have multiple cards)
- Connect the cards and fire up the server
- Launch MythTV Backend
- Define all of the attached capture cards making sure to pick the custom
device names and not adapter0 etc.
-
First DVB-T (Hauppauge Nova-TD, tuner 0)
-
Set the recorder options as required (as mentioned previously, the
EPG will not be downloaded over-the-air)
-
Second DVB-T (Hauppauge Nova-TD, tuner 1)
- Same recorder options for this
-
First (and only) DVB-S2 (TeVii S660)
- Same recorder options for this
- Capture card list should look similar to this:
-
First DVB-T (Hauppauge Nova-TD, tuner 0)
- 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"
- Quit out of MythTV Backend
- 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.
- 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.
- Re-launch the MythTV Backend
-
Define the Input Connections and tune in some channels
-
The Input Connection list should look similar to this:
-
Configure "FreeView A" by connecting the first FreeView tuner to the
FreeView video source (or channel list)
-
Scan for channels on the FreeView (DVB-T) tuner
- Store all of the DVB-T channels that it finds
- 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.
-
Configure "FreeView B" by connecting the second FreeView tuner to the
FreeView video source (or channel list)
- No need to tune in the channels again, as the video source "XMLTV FreeView" holds the list for all FreeView tuner cards.
-
Configure "FreeSat A" by connecting the first FreeSat tuner to the
FreeSat video source (or channel list)
-
Scan for channels on the FreeView (DVB-S) tuner
- Store all of the DVB-S channels that it finds
-
If your FreeSat card is HD, then scan for channels on the FreeView
(DVB-S2) tuner
- Store all of the DVB-S2 channels (and any others) that it finds
- You may want to repeat the Freesat tuning as I found that not all channels are picked up on the first attempt.
- 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.
- 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.
-
The Input Connection list should look similar to this:
-
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:
Note that is is quite possible to end up with several definitions for some channels - they may be on multiple transponders. - Quit out of MythTV Backend, but do not run mythfilldatabase... we're not done yet!
- 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.
- Run mythfilldatabase manually, or let the system do it itself. Note however that it takes ages to download and parse all of the data!
- 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):
- Device Filenames and udev from MythTV Official Wiki
- Freesat HD MythTV 0.22 Linux PVR with Ubuntu Howto from InterWeb Task Force website
- Hauppauge WinTV-NOVA-T-500 page from the LinuxTV Wiki
- Mythfilldatabase page from the MythTV Official Wiki
- MythTV Ubuntu Freesat HD Installation Guide from Garry Parker's website
- Tevii S660 DVB-S2 USB thread on Ubuntu Forums
- UK Channel Assignments from MythTV Official Wiki
- UK XMLTV page from the MythTV Official Wiki
Computing Power
- Acer Aspire R3700
- Acknowledgements
- BOINC
- Desktop PC
- Eee PC 4G (701)
- Eee PC 901
- Gigabit Network
- Inspiron 14 5485 Laptop
- Kids PC 1
- Kids PC 2
- Media PC
- Mini-ITX PC
- My Useful Scripts
- Nano ITX PC
- Nook Simple Touch
- Processing Power
- Raspberry Pi
- Sharp Zaurus SL-C3200
- Storage Capacity
- The Server
- What Is Firmware