Setup General

From MythTV Official Wiki
Jump to: navigation, search

Software-update-available.png This page is up-to-date as of MythTV version 0.27, the current release is 0.27.5

Introduction

This manual takes you through a detailed walk through into the various backend configuration options. Before doing this, a few ground concepts and terms should be explained so that the backend setup tasks sound logical to you:

With the backend of MythTV we mean the portion of the system that enables you to use capture devices as well as Scheduling Recordings on those cards, Commercial Detection, and transcoding. In short the backend process interacts with the Database and the hardware primarily.

The frontend and backend may be physically on the same hardware. This is the normal case with somebody starting out with a new system. In this case, backend and frontend setup are done on the same machine.

As with the Mythfrontend, there can be multiple backends. One backend computer is designated as the master backend. This is usually the first backend installed on a system. This backend is responsible for coordinating the activities of the other backends known as slaves. This is especially true for scheduling as the master backend will determine the best distribution of programs across all available tuners. Each backend can have any number of tuners. Commercial Detection can be distributed across different backends, thereby spreading the load of that process.

The backend setup program is run on each backend computer. It uses a user interface that is designed for a TV screen, like the frontend. If the backend does not have a physical display attached, the backend setup can still be run remotely from another computer, using ssh Forwarding.

If you installed MythTV from the MythBuntu or Ubuntu package the backend will run even if no setup has been done. If you compiled from source the backend will not run until you have setup at least one tuner.

Permissions

If you are using a device that has a Linux driver, such as a DVB, V4L, HD PVR, you will need to add your user to the video group, so that the backend setup can access the video device. The user that runs the backend also needs this, but if you installed from a package this would probably already have been done for the backend user.

sudo adduser userid video

Themes

The MythTV front end and the MythTV setup program support Themes which control the way the user interface is presented. You can download and select a theme in the frontend, and the theme will also be used for MythTV setup. The theme is stored in your home directory, so you need to use the same login user id for the frontend and for setup, if you want to use the theme for MythTV Setup.

To change the theme you will have to run the frontend. If your backend is not running the frontend will display a large error message. However you can ignore this error message and still proceed with changing the theme. The error message that the backend is not running will redisplay every few seconds, just ignore it and select your theme, then exit from the front end.

Running mythtv-setup

While running the backend setup, the backend must be shut down. Otherwise changing existing card inputs, deleting anything, or scanning for channels may not work. If you installed the Ubuntu or Mythbuntu package, a shell script will take care of that for you. If you built from source you should make sure to stop the backend before running setup.

Configure the Myth backend like so

/usr/bin/mythtv-setup

or select "MythTV Backend Setup" from the Display Manager menu.

The first time you run this on a new database, you will be prompted to select your Country and Language. If setup exits after this, run it again. You may be prompted to upgrade your database. Confirm the upgrade.

You will now see the GUI for MythTV to setup the backend server and in particular the channel tuning for our broadcast streams.

These screens are designed for use with a TV and keyboard. The mouse will not work consistently. With the keyboard use up and down arrow to move between fields. Use the left and right arrow to select options from a list.

These are the top level menu items available for configuration:

  1. General — General Backend settings
  2. Capture Cards — Add and configure your capture devices here
  3. Recording Profiles
  4. Video Sources — create guide data. This may require you to subscribe to an online service that provides programming information specific to your location and TV service.
  5. Input connections — tell your Capture Card(s) to which Video Source they should connect. (If you are setting up an IR blaster, you will need to add a script here that controls it.)
  6. Channel Editor — scan and configure your channels here
  7. Storage Directories — Configure which folders your recordings will be saved to.
  8. System Events

The General backend settings are described here. The rest of the settings are described in the next article.

General

The General settings is where you will set up the core settings of your backend. In case you are running a basic backend/frontend combined setup, you will most probably want to leave the default settings for most of this section, but in case your setup involves several separate backends and frontends, this is where you will determine the role of the backend you're currently configuring. There are two types of backends:

  • Master backend: you need at least one master backend on any MythTV setup
  • Slave backend: Any additional backends will be Slave backends.

Host Address Backend Setup

Setting Default Value Settings Page's Description Additional Comments
Local Backend (MachineName)
IPv4 address 127.0.0.1 Enter the IP address of this machine. Use an externally accessible address (ie, not 127.0.0.1) if you are going to be running a frontend on a different machine than this one. Note, in IPv6 setups, this is still required for certain extras such as UPnP. MythTV is made up of two major components, the Backend and the Frontend. If you run the Backend and Frontend on the same machine then you can leave the setting at its default value of 127.0.0.1. This is referred to as the local loopback address which is reserved for networking within a single machine. If you run multiple frontends, or run frontends over network connections on different machines, then you will need to set this to the backend machines' static IP address. This value will be determined by your TCP/IP Network addressing scheme.
IPv6 address  ::1 Enter the IPv6 address of this machine. Use an externally accessible address (ie, not ::1) if you are going to be running a frontend on a different machine than this one. Only change this if you plan to use IPv6. For more information on IPv6 see Enable IPv6.
Listen on Link-Local addresses Checked Enable servers on this machine to listen on link-local addresses. These are auto-configured addresses and not accessible outside the local network. This must be enabled for anything requiring Bonjour to work. You should normally leave this enabled.
Port the server runs on 6543 Unless you’ve got a good reason to, don’t change this. As noted here you don't need to change this.
Port the server shows status on 6544 Port which the server will listen to for HTTP requests. Currently, it shows a little status information. You can connect to your MythTV box via a web browser at the machine's IP and this port. It shows some information on the status of the box but you should configure MythWeb for more advanced purposes.
Security Pin (Required) blank PIN code required for a frontend to connect to the backend. Blank prevents all connections; 0000 allows any client to connect. When using a remote frontend MythTV will auto discover your backend. For security you must enter this PIN into the frontend to gain access. This feature removes the need for manually configuring the $HOME/.mythtv/config.xml. Use four zero's (0) to allow any client to connect and request database credentials. Leave the setting blank to forbid any client from receiving database credentials. If you set this other than 0000 you will have to setup config.xml on your remote frontend machines.
Master Backend
IP address 127.0.0.1 The IP address of the master backend server. All frontend and non-master backend machines will connect to this server. If you only have one backend, this should be the same IP address as above. YOu can use an IPv4 or an IPv6 address here. This must match the value of IPv4 or IPv6 address that was set on the backend configuration of the Master backend.
Port 6543 Unless you’ve got a good reason to, don’t change this. This must match the port the sserver runs on that was set on the backend configuration of the Master backend.

Locale Settings

Setting Default Value Settings Page's Description Additional Comments
TV format NTSC The standard to use for viewing TV. Other choices include: ATSC, PAL, SECAM, PAL-NC, PAL-M, PAL-N, NTSC-JP. Be sure to set to the proper format for your region.
VBI format NTSC Closed Caption VBI stands for vertical blanking interval, the time between tracing the last line on the display and returning to the first, when the CRT's electron beam is turned off (blanked). The VBI is used to carry Teletext and Closed Captioning data. In TV broadcasting not all of the available lines in each frame of the picture are used. For example in CCIR systems (PAL and SECAM)25 lines per field (50 per frame) are specified for other uses. The remaining lines can be used for data broadcasting, and are typically used for closed caption or teletext. You may sometimes notice a squiggly black and white line or cube right at the top of the screen in a transmission; this is data being transmitted. In some countries, specific data broadcasting companies have exclusive rights on the use of the VBI lines. Options are None, PAL Teletext, NTSC closed caption
Channel frequency table us-bcast Select the appropriate frequency table for your system. If you have an antenna, use a “-bcast” frequency. Other choices include: us-bcast, us-cable, us-cable-hrc, us-cable-irc, japan-bcast, japan-cable, europe-west, europe-east, italy, newzealand, australia, ireland, france, china-bcast, southafrica, argentina, australia-optus, singapore, malaysia, israel-hot-matav, try-all.

Miscellaneous Settings

Setting Default Value Settings Page's Description Additional Comments
File Management Settings
Master Backend Override Checked If enabled, the master backend will stream and delete files if it finds them in the video directory. Useful if you are using a central storage location, like a NFS share, and your slave backend isn’t running. For a single backend setup, leave this checked. This means that all files will stream from the master backend. It also means all files must be available on the master backend. If you have slave backends either uncheck this or if you check it make sure that all storage directories are mounted on the master backend.
Follow Symbolic links when deleting files Not Checked This will cause Myth to follow symlinks when recordings and related files are deleted, instead of deleting the symlink and leaving the actual file. In a normal recording setup mythtv does not use symbolic links so this will have no effect. Normally you should leave this unchecked unless you have your own file manipulation going on outside of MythTV.
Delete Files Slowly Not Checked Some filesystems use a lot of resource when deleting large recording files. This option makes Myth delete the file slowly on this backend to lessen the impact. Select this if using ext3 file system for recordings. It is not needed with ext4.
HD Ringerbuffer size (kb) 4700 The HD device ring buffer allows the backend to weather moments of stress. the larger the ring buffer, the longer the moments of stress can be. However, setting this too large can cause swapping, which is detrimental. The default setting should be used in normal conditions. Modern machines have gigabytes of memory so this can safely be increased if you are experiencing pauses during playback.
Storage Group disk scheduler Balanced free space This setting controls how the Storage Group scheduling code will balance new recordings across directories. 'Balanced Free Space' is the recommended method for most users. See Setup Storage Directories#Storage Group Disk Scheduler for full details.
UPnP Server Settings
Video Content to show a WMP Client Recordings Which tree to show a Windows Media Player client when it requests a list of videos. MythTV supports watching of recordings or Videos with Windows Media Player and other applications. This determines whether they can see recordings or Videos.
Other Settings
Miscellaneous Status Application blank External application or script that outputs extra information for inclusion in the backend status page. See http://www.mythtv.org/wiki/Miscellaneous_Status_Information See Miscellaneous Status Information
Disable Automatic Database Backup Not Checked If enabled, MythTV will not backup the database before upgrades. You should therefore have your own database backup strategy in place. It is recommended to leave this unchecked.
Disable Firewire Reset Not Checked By default MythTV will reset the firewire bus when a firewire recorder stops responding to commands. But if this causes problems you can disable this here for Linux firewire recorders. Unfortunately Firewire recording is somewhat unreliable, whether this option is selected or not.

EIT Scanner Options

Setting Default Value Settings Page's Description Additional Comments
EIT transport timeout (mins) 5 Maximum time to spend waiting (in minutes) for listings data on one digital TV channel before checking for new listings data on the next channel. For information on using EIT to obtain program listings see EIT.
Backend idle before EIT crawl (secs) 60 The minimum number of seconds after a recorder becomes idle to wait before MythTV begins collecting EIT listings data. For information on using EIT to obtain program listings see EIT.

Shutdown/Wakeup Options

Setting Default Value Settings Page's Description Additional Comments
Startup command blank This command is executed right after starting the backend. As a parameter '$status' is replaced by either 'auto' if the machine was started or 'user' if a user switched it on. You may want to have post-startup tasks execute autonomously once the backend server has fully initialized. Use this parameter to specify a script that will get executed along with the backed server startup routines.
Block shutdown before client connected Checked If set, the automatic shutdown routine will be disabled until a client connects. If you have shutdown wakeup enabled, the backend will normally check to see if its busy before it shuts down. Of course if you have just turned your machine on manually then you don't want it to shut down before you have had a chance to start the frontend. Once the frontend has been started then the shutdown command will take effect as soon as the frontend closes down. This means that you only need to exit the frontend and the machine will go down.
Idle timeout (secs) 0 The number of seconds the master backend idles before it shuts down all other backends. Set to 0 to disable automatic shutdown. If you want the backend to shut down when idle you must set this value as non zero.
Max. wait for recording (min) 15 The amount of time the master backend waits for a recording. If it's idle but a recording starts within this time period, the backends won't shut down. You don't want the machine to think its idle only to find that by the time it has shut down it has to start again to record the next schedule. This parameter tells the system to wait a period of time just in case a recording is due.
Startup before recording (secs) 120 The number of seconds the master backend will be woken up before a recording starts. this is the amount of time you are allowing for the backends to boot up and be ready for recording. 120 seconds is cutting it a bit fine. 300 secodns would eb a good choice, and maybe more if you have slave backends that also do recording.
Wakeup time format hh:mm yyyy-MM-dd The format of the time string passed to the 'Command to set wakeup time' as $time. See QT::QDateTime.toString() for details. Set to 'time_t' for seconds since epoch. Set this parameter to be the same as that expected by the Command to set Wakeup Time below.
Command to set Wakeup Time blank The command used to set the wakeup time (passed as $time) for the Master Backend If you have set an idle timeout, the backend will shut down. You must set up a script to set a wakeup time and give the script name here. See ACPI Wakeup for details on setting a wakeup command.
Server halt command sudo /sbin/halt -p The command used to halt the backends. This command needs to call an external script. If you are using sudo here you will need to set up permission for the backend to run the command without a password.
Pre Shutdown check-command Blank A command executed before the backends would shutdown. The return value determines if the backends can shutdown. 0 - yes, 1 - restart idling, 2 - reset the backends to wait for a frontend. Your machines may be doing other things such as Samba file sharing or streaming music that are not MythTV related. In this case you will want to have a script here that checks stuff before it shuts down. Also if you are logged into the machine doing some work you do not want it to shut down.

Backend Wakeup settings

Setting Default Value Settings Page's Description Additional Comments
Master Backend

These settings are only used when your database is running but your master backend is not. If the master backend and database automatically start with the backend machine, then configure the datbase wakeup in the frontend settings and leave this out. If the master database is on a separate server, configure the wakeup settings for the database in the frontend and configure the master backend wakeup settings here.

Delay between wake attempts (secs) 0 Length of time the frontend waits between tries to wake up the master backend. This should be the time your master backend needs to startup. Set to 0 to disable. Set a value to enable the wake up, and allow enough time for the backend to start.
Wake Attempts 5 Number of times the frontend will try to wake up the master backend. Normally only 1 attempt would be required. In case you happen to invoke a remote frontend while the backend is in the process of shutting down, it may not work and you may need more than 1 attempt.
Wake Command blank The command used to wake up your master backend server (e.g. sudo /etc/init.d/mythtv-backend restart). The example command may be misleading. This is a command that will be run on a frontend to wake a master backend. It should normally invoke a wake-on-lan command.
Slave Backends
Sleep Command blank The command used to put this slave to sleep. If set, the master backend will use this command to put this slave to sleep when it is not needed for recording. Set this while running setup on the slave backend machine.
Wake Command blank The command used to wake up this slave from sleep. This setting is not used on the master backend. Set this while running setup on the slave backend machine.

Backend Control

Setting Default Value Settings Page's Description Additional Comments
Backend Control

Settings here are run on each backend, master or slave.

Backend stop command killall mythbackend The command used to stop the backend when running on the master backend server (e.g. sudo /etc/init.d/mythtv-backend stop) This command is used to stop the backend when setup is run and you choose to close the backend. Note: when you use the Ubuntu or Mythbuntu package there is a script that invokes backend setup and it does not use this setting for stopping the backend.
Backend start command mythbackend The command used to start the backend when running on the master backend server (e.g. sudo /etc/init.d/mythtv-backend start). This command is used to restart the backend when setup is closed and you had selected for setup to close the backend. Note: Like the stop command above this is not used when you installed the Mythbuntu or Ubuntu package.

Job Queue (Backend-Specific)

Setting Default Value Settings Page's Description Additional Comments
Settings here are run on each backend, master or slave.
Maximum simultaneous jobs on this backend 1 The Job Queue will be limited to running this many simultaneous jobs on this backend. Adjust this according to the power of this backend machine.
Job Queue check frequency (secs) 60 When looking for new jobs to process, the Job Queue will wait this many seconds between checks. There is probably no reason to change this.
Job Queue start time 0:00 This setting controls the start of the Job Queue time window, which determines when new jobs will be started. You can limit the time periods when jobs will run.
CPU usage Low This setting controls approximately how much CPU jobs in the queue may consume. On 'High', all available CPU time may be used, which could cause problems on slower systems. You can limit the time periods when jobs will run.
Allow metadata lookup jobs Checked If enabled, allow jobs of this type to run on this backend.
Allow commercial-detection jobs Checked If enabled, allow jobs of this type to run on this backend.
Allow transcoding jobs Checked If enabled, allow jobs of this type to run on this backend.
Allow User Job #1 jobs Not Checked If enabled, allow jobs of this type to run on this backend. User jobs are configured on the next page. You can create up to 4 jobs to run any command you want upon completion of the system making a recording.
Allow User Job #2 jobs Not Checked If enabled, allow jobs of this type to run on this backend. User jobs are configured on the next page. You can create up to 4 jobs to run any command you want upon completion of the system making a recording.
Allow User Job #3 jobs Not Checked If enabled, allow jobs of this type to run on this backend. User jobs are configured on the next page. You can create up to 4 jobs to run any command you want upon completion of the system making a recording.
Allow User Job #4 jobs Not Checked If enabled, allow jobs of this type to run on this backend. User jobs are configured on the next page. You can create up to 4 jobs to run any command you want upon completion of the system making a recording.

Job Queue (Global)

Setting Default Value Settings Page's Description Additional Comments
Run Jobs only on original recording backend Not Checked If enabled, jobs in the queue will be required to run on the backend that made the original recording. If you leave this unchecked, you have to make sure that all recording directories are available on all backends, via NFS or another mechanism.
Start auto-commercial-detection jobs when the recording starts Not Checked If enabled, and Auto Commercial Detection is ON for a recording, the flagging job will be started as soon as the recording starts. NOT recommended on underpowered systems.
Commercial-detection command mythcommflag The program used to detect commercials in a recording. The default is 'mythcommflag' if this setting is empty. See User Jobs for arguments that can be used.

Equivalent default command: mythcommflag -j %JOBID% -V %VERBOSELEVEL%

Transcoder command mythtranscode The program used to transcode recordings. The Defaults is 'mythtranscode' if this setting is empty. See User Jobs for arguments that can be used.

Equivalent default command: mythtranscode -j %JOBID% -V %VERBOSELEVEL% -p %TRANSPROFILE% [-l]
('-l' is passed only if cutlists are to be used in transcoding)

RunRun transcode jobs before auto commercial detection Not Checked If enabled, and if both auto-transcode and commercial detection are turned ON for a recording, transcoding will run first; otherwise, commercial detection runs first.
Save original files after transcoding (globally) Not Checked If enabled and the transcoder is active, the original files will be renamed to .old once the transcoding is complete.

Job Queue (Job Commands)

Setting Default Value Settings Page's Description Additional Comments
User Job #1 description User Job #1 The description for this User Job. If you create a user job, change this to a name for the user job. This name is shown in the frontend and other places when referring to the job.
User Job #1 command blank The command to run whenever this User Job number is scheduled. This is typically a script you have created to do some task after a recording is complete.
User Job #n description User Job #n The description for this User Job. There are prompts for 4 user jobs, 1 - 4.
User Job #n command blank The command to run whenever this User Job number is scheduled. There are prompts for 4 user jobs, 1 - 4.

Program Schedule Downloading Options

Setting Default Value Settings Page's Description Additional Comments
Automatically update program listings Checked If enabled, the guide data program will be run automatically. If you want the backend to invoke the guide data program once a day, enable this. Many people use a cron script or other method of running it, in which case this should be unchecked.
Guide data program mythfilldatabase Use 'mythfilldatabase' or the name of a custom script that will populate the program guide info for all your video sources. This program will run under the same user id as the backend. If you are using xmltv for your guide data you will have to make sure that the data in the home directory that set up xmltv is available to mythfilldatabase.
Guide data arguments blank Any arguments you want passed to the guide data program. See mythfilldatabase or run "mythfilldatabase -h" for details of valid arguments for mythfilldatabase. When using schedules direct, we recommend using the --dd-grab-all argument.
Guide data program execution start 0 This setting and the following one define a time period when the guide data program is allowed to run. For example, setting start to 11 and end to 13 would mean that the program would only run between 11:00 AM and 1:59 PM.
Guide data program execution end 23 This setting and the preceding one define a time period when the guide data program is allowed to run. For example, setting start to 11 and end to 13 would mean that the program would only run between 11:00 AM and 1:59 PM.
Run guide data program at time suggested by the grabber. Checked If enabled, allow a DataDirect guide data provider to specify the next download time in order to distribute load on their servers. Guide data program execution start/end times are also ignored. Currently Schedules Direct always suggests the next time as 24 hours later, so this is not very useful.

Other Setup Pages

The rest of the setup pages are described in the next chapter, User Manual:MythTV structure.