MythTV on Mac OS X

From MythTV Official Wiki
Revision as of 14:30, 23 November 2009 by Brianboonstra (talk | contribs) (Server Startup)

Jump to: navigation, search

New users: before attempting to install MythTV for the first time, please familiarize yourself with the distinction between frontend and backend.

MythTV works just fine on OSX (but see the backend gotchas below).

Hardware Requirements

Frontend

To watch TV at acceptable speeds, you'll want at least an 800 MHz G4 or better. For HDTV nearly any Intel-based Mac released from 2008 onwards will suffice. MythTV will not use GPU acceleration on OSX until #2381 or an equivalent has been finished.

Backend

The backend takes very little CPU power, except when marking commercials. An 800 MHz G4 PPC or CoreDuo Intel Mac is fine.

Pre-built Downloads

Version Download
0.22-fixes
0.21-fixes
0.21
0.20.2
0.20-fixes
0.20
0.19-fixes
0.19
0.18.1-fixes
0.18.1
0.18
0.16
older

Nigel Pearson can also provide a 0.15 or 0.17 binary, if you really need one.

svn (nightly builds)


Using MythFrontend

MythFrontend is a normal OSX app that has no special dependencies to run. It is compatible with versions of OSX from 10.3.x (Tiger) through 10.6.x (Snow Leopard).

You can start MythFrontend immediately after downloading it from one of the locations above, though it won't do very much if you lack a backend to point it at. If the frontend doesn't start properly, see the Troubleshooting section below.

If you already have a working backend, you will be able to watch TV as soon as you tell MythFrontend where to find it. Note that your frontend and backend generally need to be the same major version to work together. See the User Manual for more information on configuring the frontend.

Installing MythTV Backend

Important.png Note: To use an OS X backend, it may be easier to start with a Linux machine running a recent SVN version of MythTV to act as a backend. If you've never installed MythTV, you can first set up Linux version such as MythBuntu, and only look at the OS X version once everything's working properly there. That said, don't be discouraged; many people use a OS X with FireWire STBs, IPTV, and the HD Home Run.


Warning.png
Snow Leopard: The prebuilt MythBackend binaries from 0.21-fixes do not work on OSX Snow Leopard 10.6.x as of 20090921 SVN Revision 21625. The status of 0.22 is that the backend will not build on 10.6, but will probably run there (please remove this warning from the Wiki once 0.22 is building and running on 10.6). You may wish to wait to upgrade to Snow Leopard if you require the backend on OSX.


Install Wget

The MythFillDatabase program (fetches schedule info) depends on wget which is not included in the default install of Mac OSX. You can install wget directly, via Fink or MacPorts, or by downloading and building it. MythTV-Setup also uses wget when trying to obtain the channel list so one must install wget before trying to use the backend.

Set Up MySQL

The MythTV backend relies on having a MySQL database available for storing information about upcoming and past recordings, channel setup, and the like.

Download and Install

Grab and install MySQL 5.0 for Mac OS X from the Mysql site.

Server Startup

After installation, the MySQL server needs to be started. Rebooting is the simplest way.

The MySQL distribution sets itself to start automatically on boot by creating a startup item /Library/StartupItems/MySQLCOM and setting a value in /etc/hostconfig. Therefore the easiest way to start the mysqld daemon is simply to reboot. To start MySQL manually you can call /usr/local/bin/mysql/bin/mysqld. If you get an error message for lack of access to the directory, type chmod oug+rwX directory to enable access, then start the database server again.

Initial Database Setup

Open Terminal. Type in the following and press enter:

shell> cd /usr/local/mysql/bin/

Here, the shell> characters indicate the shell prompt, not something you need to type.

Configuring Default Database Users

Enter the specialized MySQL shell

shell> ./mysql -u root

which should start and prompt you for input with the mysql> prompt.

Delete the anonymous MySQL accounts by entering the following command:

mysql> DROP USER ;


If you don't know your machine's hostname, look it up in the table produced by entering

mysql> SELECT Host, User FROM mysql.user;


Then, set passwords for the root account by entering the below commands and substituting your desired password for newpwd and your backend machine's hostname for host_name.

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'host_name.local' = PASSWORD('newpwd');

This root password is not one you will generally have to share, but you should definitely make a record of it.

Database Privileges and Character Set

Finally, create the mythtv user and mythconverg database in MySQL, substituting your desired password for that user where it says mythtv-password:


mysql> CREATE DATABASE IF NOT EXISTS mythconverg;
mysql> GRANT ALL ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv-password";
mysql> FLUSH PRIVILEGES;
mysql> GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv-password";
mysql> FLUSH PRIVILEGES;
mysql> ALTER DATABASE mythconverg DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


This MythTV password will be given to any frontend you use, and is therefore going to be kept relatively insecure, so don't choose a password that is important to you. The customary choice for this password is mythtv.

The above commands are equivalent to the setup script that runs automatically when you install MythTV on Linux distributions.

Finishing Backend Setup

Now download the backend (from one of the servers above).

Launch MythTV-Setup.app and go through the configuration steps (detailed explanations can be found in the User Manual). Follow the instructions (it will tell you to run MythFillDatabase.app once you've setup your capture card).

You're done! Watch and record TV using MythFrontend.app.

Automatic Backend Startup

Method 1: Login Item

Make MythBackend a Login Item for the DVR user, using the Accounts section of System Preferences.

Method 2: Launchd

MythBackend is really a daemon, and it is nice to control it as such. The approved way to automatically start processes in OSX is to use launchd. Placing the following property list in ~/Library/LaunchAgents/MythBackend.plist of the relevant user account will cause MythBackend to be started whenever that user logs in, and restarted if killed or crashed.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>MythBackend</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/MythBackend/MythBackend.app/Contents/MacOS/MythBackend</string>
		<string>-l</string>
		<string>/var/log/MythBackend</string>
	</array>
</dict>
</plist>

Note that the path to the MythBackend application binary should be set to where you happen to keep it. If you need to stop the process, you cannot just kill it. Instead use

launchctl unload -w ~/Library/LaunchAgents/MythBackend.plist

and once you are ready to start it again type

launchctl load -w ~/Library/LaunchAgents/MythBackend.plist

in a Terminal window.

Gotchas and Warnings

Limited Tuners

As of v0.21, the Mac OS X backend does not support the majority of tuners listed as being supported by the (Linux) version of MythTV. The following tuners are known to work using the Mac version of Myth backend: HDHomeRun. Recording via firewire from set top boxes such as the Motorola 6412 or Motorola DCT 6200 is also known to work. Plans (if any) for additional support are unknown.

Dolby AC3 Sound

(As of mythtv 22-fixes-20091115) You cannot yet use AC3 passthrough of Dolby digital audio, due to the bug discussed in #5552. Do not enable this option in your frontend setup.

Firewire Recording

(As of mythtv 0.21-fixes-20090316) There is one important note if trying to record via FireWire on an Intel Mac. The MythBackend cannot get a LAM lock signal when recording TV via FireWire. The solution is to check the "Open with Rosetta" checkbox on the Get Info panel of MythBackend.app. See this post for information.

Because of this, it's important to open MythBackend.app from the Finder and not from a Terminal window because it won't open with Rosetta. There must be some PPC-specific FireWire code in there.

This method had successfully been used to record HD over FireWire on a Intel Mac Mini (Macmini3,1) on a Motorola DCT 6200 cable box.

Setting up MythWeb

MythWeb is a convenient collection of website code that lets you set up recordings, browse the schedule, and review existing recordings without having to start the complete frontend. Since Macs have a built-in webserver, it's pretty simple to get MythWeb going as well. For complete setup instructions, please see MythWeb_on_Mac_OS_X.

Troubleshooting and Monitoring

Process View and CPU Usage

To see if you have processes running, you can use the ps command in a terminal, or even better, you can use the Activity Monitor supplied by Apple (usually found in /Applications/Utilities/). Sort by process name. You should see MySQL as mysqld and MythBackend as MythBackend.

Log Files

By default, MythBackend and MythFrontend log to standard output (often /var/log/system.log). It is convenient to separate the backend log from the general system log; if you launch the backend with the -l logfilename directive then it will log to logfilename instead. You can view the logs with tail in a command-line window, or more conveniently using Console.app, also in /Applications/Utilities/.

MythFillDatabase sends messages both to the standard output and the standard error. You may find it convenient to similarly redirect that output.

Building MythTV Yourself

Building Automatically

The easiest way to build MythTV from source is to download the packager script. Either http://svn.mythtv.org/svn/branches/release-0-22-fixes/mythtv/contrib/OSX/osx-packager.pl or http://svn.mythtv.org/svn/trunk/packaging/OSX/build/osx-packager.pl. This script just needs XCode and an internet connection - it downloads and builds all the dependencies, and if you are lucky gives you several double-clickable applications.

Building Manually

Sadly, the packager script doesn't always work. Maybe one of the downloadable dependencies has been outdated, and someone needs to try building against a newer one. Maybe the MythTV source code has changed and broken Mac builds. Look on the Myth_on_Mac_-_Build_status page for hints about this. For instructions about building by hand, see Building MythTV on Mac OS X

If you just want to watch TV on your Mac, and you aren't planning to do development, you're better off using a prebuilt binary.


Tips and Tricks

Remote Control

Apple Remote

The Apple Remote can be used to control the most common MythTV functions:

  • Directional keys: arrow keys
  • Play/Pause: Enter
  • Menu: Escape

Holding down buttons will generate alternate inputs:

  • Hold Play/Pause: P (play/pause playback)
  • Hold Menu: M (Menu in playback)
  • Hold Left/Right: Home/End

See the Keybindings page for what these key equivalents will do in any given situation. Keybindings can be altered in the settings menu using MythWeb. For example you may wish to try changing the "Pause" setting for TV Playback from P to P,Enter to support the play/pause button on the Apple Remote.

The Apple Remote will not work properly on versions of Snow Leopard prior to 10.6.2 (#7112).

Other Infrared Remotes

See Keyspan Express Remote.

Bluetooth Control

If you want to try controlling MythTV via Bluetooth, Brad came up with a 'Salling Clicker' action http://members.shaw.ca/dignon/MythTV%20Remote%20Suite%20v1_1.cgz

Computer To Computer Network Control

If you want to try controlling MythTV from another Mac (perhaps by a PowerBook from the couch), Generally Helpful Software has released an early beta of a remote control application, Remote Remote GH for MythTV http://web.mac.com/grhowes/iWeb/Generally%20Helpful%20Software/Remote%20Remote%20GH.html

Another Mac OS X network remote control is available at http://ignasiak.googlepages.com/mythremote

Playback Settings

In the setup screens, explore the "TV Settings" -> "Playback" options. You'll find two pages of Mac-specific settings there. If your machine isn't fast enough, you can choose to drop frames here. If you have cycles to spare, you'll find fun settings like video in the Dock, on the Desktop, or in a floating (and optionally translucent) window.

MythGrowl Notifications

There is an application for Mac OS X called MythGrowl that generates Growl notifications when your MythTV backend starts or finishes a recording. Not part of Mythfrontend but worth a mention. It can be downloaded at http://mythgrowl.sourceforge.net/

Performance Tweaks for Underpowered Systems

To improve playback performance try new 'Use libmpeg2' setting (on the first page of Setup, Settings, TV Settings, Playback. Running TV playback in a smaller window can also improve performance, as can customising your backend recording settings. (e.g. Smaller capture from analog cards, 44.1KHz audio is a better match to some Macs than 48KHz)

For more information

Mailing Lists

If you have problems with this guide, the mythtv-users mailing list is the best place to start. Check the searchable archive to see if your problem has already been discussed. Also, you can check the mythtv-dev list to see if it's a problem with SVN; if you can't compile MythTV, you may just have to wait a few days and try again.

External Links

Wiki

  • The user manual at User_Manual:Index has a lot of material, though it is Linux-oriented
  • For MythTV on Mac OS X on Intel machines, there is also also Myth on Mac x86. (However, that page is very out of date in many respects.)

Help Improve This Page

Finally, remember that this is a Wiki. If you find an inaccuracy, or have advice that may be helpful to others, improve this guide by adding your information!