Difference between revisions of "Mythbackend"

From MythTV Official Wiki
Jump to: navigation, search
(Troubleshooting: add -v help list with extra options)
(Command Line Options: Add extra command line options)
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
The backend process (mythbackend) is the portion of the system that handles the [[Video capture card]]s as well as [[Scheduling Recordings]] on those cards, [[Commercial Flagging]], and [[transcoding]].  The backend process interacts with the [[Database]] primarily.   
+
The backend process (mythbackend) is the portion of the system that handles the [[Video capture card]]s as well as [[Scheduling Recordings]] on those cards, [[Commercial Detection]], and [[transcoding]].  The backend process interacts with the [[Database]] primarily.   
  
As with the [[MythFrontend]], there can be multiple backends.  One backend process 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, including zeroAs of 0.16, [[Commercial Flagging]] can be distributed across different backends, thereby spreading the load of that process.   
+
As with the [[mythfrontend]], there can be multiple backends.  One backend process 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.  A machine that does not have any tuners attached can store and serve content by running [[mythmediaserver]] instead of mythbackend. [[Commercial Detection]] can be distributed across multiple backends, and other machines running [[mythjobqueue]], thereby spreading the load of that process.   
  
 
There is no requirement for direct user interaction with the backend.  The backend can use local [[HardWare]]/[[File Storage]] or have it mounted from another system.  If remotely mounted, network performance should be considered as there will be considerable traffic on the network as recordings are stored and retreived by the backend process.
 
There is no requirement for direct user interaction with the backend.  The backend can use local [[HardWare]]/[[File Storage]] or have it mounted from another system.  If remotely mounted, network performance should be considered as there will be considerable traffic on the network as recordings are stored and retreived by the backend process.
  
 
== Command Line Options ==
 
== Command Line Options ==
Valid options are:
+
Valid options are summarised below:
 
<pre>
 
<pre>
-h or --help                   List valid command line parameters
+
-h or --help or --usage        Display this help printout, or give detailed information of selected option.
-l or --logfile filename      Writes STDERR and STDOUT messages to filename
+
-p or --pidfile               Write PID of mythbackend to filename
-p or --pidfile filename      Write PID of mythbackend to filename
+
 
-d or --daemon                Runs mythbackend as a daemon
 
-d or --daemon                Runs mythbackend as a daemon
-v or --verbose debug-level    Use '-v help' for level info
+
--user                        Drop permissions to username after starting
 +
--noupnp                      Disable use of UPnP
 
--printexpire                  List of auto-expire programs
 
--printexpire                  List of auto-expire programs
 
--printsched                  Upcoming scheduled programs
 
--printsched                  Upcoming scheduled programs
 
--testsched                    Test run scheduler (ignore existing schedule)
 
--testsched                    Test run scheduler (ignore existing schedule)
--resched                      Force the scheduler to update
+
 
--nosched                      Do not perform any scheduling
+
Logging Options:
--noupnp                      Do not enable the UPNP server
+
--enable-dblog                Enable logging to database.
--nojobqueue                  Do not start the JobQueue
+
--loglevel                    Set the logging level.
--nohousekeeper                Do not start the Housekeeper
+
--logpath                      Writes logging messages to a file in the directory logpath.
--noautoexpire                Do not start the AutoExpire thread
+
--nologserver                  Disable all logging but console.
--version                      Version information
+
-q OR --quiet                  Don't log to the console (-q).  Don't log anywhere (-q -q)
 +
--syslog                      Set the syslog logging facility.  Set to "none" to disable, defaults to none.
 +
-v OR --verbose                Specify log filtering. Use '-v help' for level info.
 
</pre>
 
</pre>
  
 
== Communications Protocol ==
 
== Communications Protocol ==
  
The backend and frontend communicate using their own [[Myth Protocol]].  The developer of [http://winmyth.sourceforge.net/ [[Win Myth]]], a windows frontend to MythTV for playing recordings on Windows, has documented his workings on the procotol [http://winmyth.sourceforge.net/mythprotocol.html here]. Work on defining the [[Myth Protocol]] is also be performed on this Wiki.
+
The [[mythbackend]] and [[mythfrontend]] communicate using their own [[:Category:Myth Protocol|Myth Protocol]]. Work on defining the [[:Category:Myth Protocol|Myth Protocol]] is being performed on this Wiki.
  
 
== Troubleshooting ==
 
== Troubleshooting ==
To control what debug information is logged to the log file the following switches may be used. These can be viewed by entering 'mythbackend -v help'
+
Mythbackend uses the [[Logging|logging routines]] shared by the rest of MythTV, and the command line options defined there can be used to control where and what debugging information is logged.
  
Verbose debug levels.
+
''Need to add backend-specific troubleshooting help here, or at least link to [[Troubleshooting]]''
Accepts any combination (separated by comma) of:
+
  
  all          - ALL available debug output
+
== Interpreting --printsched Output ==
  most          - Most debug (nodatabase,notimestamp)
+
The --printsched command line option prints out upcoming scheduled recordings. 
  important    - Errors or other very important messages
+
  general      - General info
+
  record        - Recording related messages
+
  playback      - Playback related messages
+
  channel      - Channel related messages
+
  osd          - On-Screen Display related messages
+
  file          - File and AutoExpire related messages
+
  schedule      - Scheduling related messages
+
  network      - Network protocol related messages
+
  commflag      - Commercial Flagging related messages
+
  audio        - Audio related messages
+
  libav        - Enables libav debugging
+
  jobqueue      - JobQueue related messages
+
  siparser      - Siparser related messages
+
  eit          - EIT related messages
+
  vbi          - VBI related messages
+
  database      - Display all SQL commands executed
+
  dsmcc        - DSMCC carousel related messages
+
  mheg          - MHEG debugging messages
+
  upnp          - upnp debugging messages
+
  socket        - socket debugging messages
+
  xmltv        - xmltv output and related messages
+
  dvbcam        - DVB CAM debugging messages
+
  media        - Media Manager debugging messages
+
  idle          - System idle messages
+
  timestamp    - Conditional data driven messages
+
  none          - NO debug output
+
  
The default for this program appears to be: '-v important,general'
+
This format is also used in mythbackend logs of scheduling activity (with <tt>-v schedule</tt>), and is particularly useful when obtaining schedule data with <tt>--testsched</tt>.
  
Most options are additive except for none, all, and important.
+
For example:
These three are semi-explicit and take precedence over any
+
<pre>
prior options given. You can however use something like
+
Title - Subtitle                    Ch Station Day Start  End  S C I  T N Pri
'-v none,jobqueue' to get only JobQueue related messages
+
Ask This Old House - "Installi    21_2 WLIWDT2 13 16:30-17:00 1 1 1  A 1 0
and override the default verbosity level.
+
The Simpsons - "Treehouse of Horro  11 WPIX    13 19:00-19:30  1 0 0  A R 0
 +
</pre>
  
The additive options may also be subtracted from 'all' by
+
Title, subtitle, channel (number), station (callsign), day, start (time) and end (time) are rather straight forward.  The meanings of the other columns are:
prefixing them with 'no', so you may use '-v all,nodatabase'
+
* S - Source ID
to view all but database debug messages.
+
* C - Card ID
 +
* I - Input ID
 +
* T - Recording Type Character
 +
* N - Recording Status Character
 +
* Pri - Priority
  
Some debug levels may not apply to this program.
+
The meanings of the Recording Type Character (T) are:
 +
* S - Single record
 +
* T - Timeslot
 +
* W - Weekslot
 +
* C - Channel
 +
* A - All
 +
* F - Find one
 +
* d - Find one daily
 +
* w - Find weekly
 +
* O - Override or Don't record
  
''Need to add backend-specific troubleshooting help here, or at least link to [[Troubleshooting]]''
+
The meanings of the Recording Status Character (N) are:
 +
* A - Aborted
 +
* R - Recorded / Current recording
 +
* X - Don't record
 +
* P - Previous recording
 +
* E - Earlier showing
 +
* T - Too many recordings
 +
* c - Cancelled
 +
* M - Missed
 +
* C - Conflict
 +
* L - Later showing
 +
* r - Repeat
 +
* x - Inactive
 +
* K - Low disk space
 +
* B - Tuner busy
 +
* f - Failed
 +
* N - Not listed
 +
* V - Never record
 +
* F - Offline
 +
* O - Other showing
 +
* (a number) - the card ID on which the show is currently recording
  
[[Category:Software]]
+
[[Category:MythTV_Software]]
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Latest revision as of 11:10, 28 September 2013

The backend process (mythbackend) is the portion of the system that handles the Video capture cards as well as Scheduling Recordings on those cards, Commercial Detection, and transcoding. The backend process interacts with the Database primarily.

As with the mythfrontend, there can be multiple backends. One backend process 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. A machine that does not have any tuners attached can store and serve content by running mythmediaserver instead of mythbackend. Commercial Detection can be distributed across multiple backends, and other machines running mythjobqueue, thereby spreading the load of that process.

There is no requirement for direct user interaction with the backend. The backend can use local HardWare/File Storage or have it mounted from another system. If remotely mounted, network performance should be considered as there will be considerable traffic on the network as recordings are stored and retreived by the backend process.

Command Line Options

Valid options are summarised below:

-h or --help or --usage        Display this help printout, or give detailed information of selected option.
-p or --pidfile                Write PID of mythbackend to filename
-d or --daemon                 Runs mythbackend as a daemon
--user                         Drop permissions to username after starting
--noupnp                       Disable use of UPnP
--printexpire                  List of auto-expire programs
--printsched                   Upcoming scheduled programs
--testsched                    Test run scheduler (ignore existing schedule)

Logging Options:
--enable-dblog                 Enable logging to database.
--loglevel                     Set the logging level.
--logpath                      Writes logging messages to a file in the directory logpath.
--nologserver                  Disable all logging but console.
-q OR --quiet                  Don't log to the console (-q).  Don't log anywhere (-q -q)
--syslog                       Set the syslog logging facility.  Set to "none" to disable, defaults to none.
-v OR --verbose                Specify log filtering. Use '-v help' for level info.

Communications Protocol

The mythbackend and mythfrontend communicate using their own Myth Protocol. Work on defining the Myth Protocol is being performed on this Wiki.

Troubleshooting

Mythbackend uses the logging routines shared by the rest of MythTV, and the command line options defined there can be used to control where and what debugging information is logged.

Need to add backend-specific troubleshooting help here, or at least link to Troubleshooting

Interpreting --printsched Output

The --printsched command line option prints out upcoming scheduled recordings.

This format is also used in mythbackend logs of scheduling activity (with -v schedule), and is particularly useful when obtaining schedule data with --testsched.

For example:

Title - Subtitle                    Ch Station Day Start  End   S C I  T N Pri
Ask This Old House - "Installi     21_2 WLIWDT2 13 16:30-17:00  1 1 1  A 1 0
The Simpsons - "Treehouse of Horro   11 WPIX    13 19:00-19:30  1 0 0  A R 0

Title, subtitle, channel (number), station (callsign), day, start (time) and end (time) are rather straight forward. The meanings of the other columns are:

  • S - Source ID
  • C - Card ID
  • I - Input ID
  • T - Recording Type Character
  • N - Recording Status Character
  • Pri - Priority

The meanings of the Recording Type Character (T) are:

  • S - Single record
  • T - Timeslot
  • W - Weekslot
  • C - Channel
  • A - All
  • F - Find one
  • d - Find one daily
  • w - Find weekly
  • O - Override or Don't record

The meanings of the Recording Status Character (N) are:

  • A - Aborted
  • R - Recorded / Current recording
  • X - Don't record
  • P - Previous recording
  • E - Earlier showing
  • T - Too many recordings
  • c - Cancelled
  • M - Missed
  • C - Conflict
  • L - Later showing
  • r - Repeat
  • x - Inactive
  • K - Low disk space
  • B - Tuner busy
  • f - Failed
  • N - Not listed
  • V - Never record
  • F - Offline
  • O - Other showing
  • (a number) - the card ID on which the show is currently recording