(I am reposting this from an entry on my website).
Signal Source: HDHomeRun
For signal, I bought a DB-4 antenna from Antennas Direct and an HDHomeRun. I installed the antenna in my attic, and since my house is already wired with Cat5E just dropped the antenna wire through the wall next to the ethernet jack, where I could put the HDHomeRun. Once I had it on the network, I tested it with the HDHomeRun-config-gui.app that they supply.
Computer Hardware: Mac Mini and Upgrades
I started with a base model 2009 Mac Mini (1GB/80GB) with a bluetooth keyboard and mouse. I bought a 320GB 7200 RPM drive (Seagate ST9320421AS) that has good reviews, plus a 2GB DDR3 RAM stick from Crucial.
I followed online instructions for opening up the Mini for the install. They were mostly good, but missed out on telling you about a few things
A high-quality (sharp-edged) plastic spatula can crack open the outer case while leaving absolutely no marks. Doing this is time-consuming and difficult but possible.
Once you have the outer case off, the tape off, and the antennas unmounted, it is very easy to accidentally unplug the bluetooth antenna cable when lifting the drive frame up off the motherboard. The antenna wire is easily reconnected but takes a surprising amount of force to get the connector back on that little coax mount.
When you replace the old HD you will have to unstick the temperature sensor and a couple of sound dampers. There's enough glue on them that they'll stick right back on to the new drive. **Remember where (on the old drive) these items were so that you can replace them on the new drive!
You can test run your mini with the outer case still off. That way you can tell if anything is loose or whatever before risking having to crack it again.
Computer Configuration
Once the new hard drive was installed, I hooked up a monitor and booted the system from the install disks (this is slightly easier using a USB rather than bluetooth keyboard and mouse by the way). First, I went to the system diagnostics (About This Mac...) to check that the RAM had been found. Then I started Disk Utility, and partitioned the drive into 80GB for the OS and 220GB for PVR recordings and other big files. The point of partitioning is twofold:
Make sure I can never hose the system by having recordings eat all available space
Keep stuff that requires no backups all in one place.
Though I have a NAS (ReadyNAS NV+) I did not want to use it to store recordings, since its throughput is unlikely to match the local 7200RPM drive.
Software Setup
Once the drive was partitioned, I put the original drive in a USB enclosure, and used Disk Utility to restore from the old drive onto the 80GB partition. Doing this is much faster than making and restoring from a Time Machine backup. I could then boot the machine, and run Software Update to get everything up to date. Then I told iTunes where to find music on my NAS, and copied some favorite photos into iPhoto.
Power Management
I configured the computer to never sleep, and never sleep the display or hard drive either. I also set it up to restart after a power failure.
DVR Software: MythTV
Backend
Next, it was time to install the MythTV backend. Though MythTV is mostly a Linux project, it does work on OSX with a few quirks. The main resource for this is the wiki page, and I had already experimented somewhat using my Mac Pro. Using the pointers on that page, I downloaded the latest SVN nightly build from Sniderpad.com (I haven't actually noticed big differences between this and the 0.21-fixes release). I downloaded the backend and frontend then unpacked the Myth* executables into my Applications folder.
MythTV Prerequisite: MySQL
I downloaded the OSX package for MySQL 5.0.77 and then I installed MySQL. It comes with a Preference Pane to turn it off and on, and can be set to automatically start up, which is what you want.
Partitioning and Files
On the Recordings partition, I created a folder named MythTV, with 4 subfolders entitled LiveTV, Groups, Default and Backups. I also created an account at SchedulesDirect to get TV listings. I created directory for mythtv logfiles, as /var/log/myth and I changed ownership of this directory to the GUI user rather than root so that Myth could write to it.
To set up the backend, I launched Terminal.app and ran the database commands from the wiki page. First I chose a password (mythtv is a good choice if you are not worried about security). Then I ran MythTV-Setup.app.
A quick note on running the Myth* apps: when you are first starting out, it is best to run these from the command line (in Terminal.app) rather than by double-clicking the icons. That way, you can see any useful error messages that would otherwise just disappear from sight. The way to do this is to start a new Terminal window, then run, for example,
/Applications/MythBackend/MythTV-Setup.app/Contents/MacOS/MythTV-Setup
I ran through the setup application, telling it what my database password was and that I have an HDHomeRun (no need to specify the IP unless you have more than one unit). For each of the HDHomeRun's 2 tuners, I had to tell the setup program about my SchedulesDirect account. I also had to let it scan for channels, but that was necessary to do on only one tuner. (As a side note, channel scanning seemed fine on the Mini but it choked on the Mac Pro, probably due to threading issues. I put a note on the wiki page about that).
I told setup to go ahead and mark commercials during recording. I also told it which directories to put files in (the ones on the Recordings partition), and that mythfilldatabase should log to a file in /var/log/myth.
Once setup was done, I could run mythfilldatabase (which I again elected to do from the command line) and then start the backend.
Frontend
Now I could set up the frontend. I started the front end and told it the database password in the setup menu, and that I wanted it to automatically skip commercials. I tested LiveTV and recordings. I did not bother to set up any of the other features or plugins since I planned to get all that from Plex.
Automatic Startup
Once I was happy with MythTV's workings (and it actually took a few iterations -- you're getting the cleaned up version here), I made a launchd configuration file to automatically start mythbackend on boot, or at any time the backend crashes. You only want to do this after everything is really truly working because otherwise launchd may eat half your CPU just restarting mythbackend over and over, and it is fairly complicated to stop that behavior without a reboot. To enforce autostartup, I put a file named MythBackend.plist in /Library/LaunchDaemons, with the following content:
Disabled
KeepAlive
Label
MythBackend
ProgramArguments
/Applications/MythBackend/MythBackend.app/Contents/MacOS/MythBackend
-l
/var/log/myth/MythBackend
UserName
dvr
Please note that the UserName variable should be set to the GUI user name.
Plex
Now I could do the easy part -- set up Plex. I downloaded the latest version, installed it, and set up MythFrontend as an available external app. I also told it where to find movies, photos and home videos on my NAS and installed a couple of plugins. I cannot say enough about how awesome Plex is, so I'll let you discover it for yourself. I set up the user account so that it would automatically start Plex at login. Then I unplugged the Mini and brought it to my AV system, plugging it into a 100MB/sec segment of my network.
Final Connections
Using a mini-DVI to HDMI adapter I bought at Monoprice, I connected my Samsung PN-63B550 plasma display using HDMI input #2, and used a TOSLink optical cable to connect from the dual-use output jack of the Mini to an optical input of my Onkyo DS-777 AV receiver. Booting the Mini got me a nice display on the plasma right away. The Mac autodetected the plasma and set its video appropriately, choosing to overscan by default. The overscan is a little too much and hides the top menubar but I don't mind since I'm usually using Plex or Myth. You can turn off overscan in System Preferences->Display. Does anyone know if this Samsung has a "Just scan" option?
Monitoring
The best way to monitor the MythTV backend is by using Console.app. It's provided by Apple, and is lightweight with a nice interface. Just point it at the appropriate files in /var/log/myth.
Results
Both sound and video are smooth and good-looking to my untrained ear and eye. When MythBackend is recording and marking commercials, CPU usage is about 100-125% and MythFrontend playback gets untolerably jumpy in 1080i (720p is acceptable). However, full-res Plex playback is still just fine while MythBackend is working this hard (obviously because Plex is using CoreVideo and the GPU).
Plex's slideshows are nice (they launch as a screensaver), along with its ability to play iTunes playlists with the visualizer. I'm thrilled with the Myth ability to autoskip commercials. As a computer monitor the Samsung is acceptable for short periods but it would give you eyestrain to try to use it for a whole day.
To Do:
Remote Buddy (maybe using a Wii controller?)
Try to set up commercial flagging on the Mac Pro without making it have to stay on all the time
Problems:
At one point after an upgrade, MythBackend could not see the MySQL database. Since launchd was eating 70% CPU by launching it over and over, I had to remove MythBackend.plist, reboot, launch mythbackend manually, quit mythbackend, restore MythBackend.plist, and reboot again. The problem disappeared.
With the Apple Remote, MythFrontend views each button press as two presses. This makes it impossible to select half the items on any list with an even number of choices.
This revision: April 8, 2009
Contact: htpc(at)boonstra.org
Signal Source: HDHomeRun
For signal, I bought a DB-4 antenna from Antennas Direct and an HDHomeRun. I installed the antenna in my attic, and since my house is already wired with Cat5E just dropped the antenna wire through the wall next to the ethernet jack, where I could put the HDHomeRun. Once I had it on the network, I tested it with the HDHomeRun-config-gui.app that they supply.
Computer Hardware: Mac Mini and Upgrades
I started with a base model 2009 Mac Mini (1GB/80GB) with a bluetooth keyboard and mouse. I bought a 320GB 7200 RPM drive (Seagate ST9320421AS) that has good reviews, plus a 2GB DDR3 RAM stick from Crucial.
I followed online instructions for opening up the Mini for the install. They were mostly good, but missed out on telling you about a few things
A high-quality (sharp-edged) plastic spatula can crack open the outer case while leaving absolutely no marks. Doing this is time-consuming and difficult but possible.
Once you have the outer case off, the tape off, and the antennas unmounted, it is very easy to accidentally unplug the bluetooth antenna cable when lifting the drive frame up off the motherboard. The antenna wire is easily reconnected but takes a surprising amount of force to get the connector back on that little coax mount.
When you replace the old HD you will have to unstick the temperature sensor and a couple of sound dampers. There's enough glue on them that they'll stick right back on to the new drive. **Remember where (on the old drive) these items were so that you can replace them on the new drive!
You can test run your mini with the outer case still off. That way you can tell if anything is loose or whatever before risking having to crack it again.
Computer Configuration
Once the new hard drive was installed, I hooked up a monitor and booted the system from the install disks (this is slightly easier using a USB rather than bluetooth keyboard and mouse by the way). First, I went to the system diagnostics (About This Mac...) to check that the RAM had been found. Then I started Disk Utility, and partitioned the drive into 80GB for the OS and 220GB for PVR recordings and other big files. The point of partitioning is twofold:
Make sure I can never hose the system by having recordings eat all available space
Keep stuff that requires no backups all in one place.
Though I have a NAS (ReadyNAS NV+) I did not want to use it to store recordings, since its throughput is unlikely to match the local 7200RPM drive.
Software Setup
Once the drive was partitioned, I put the original drive in a USB enclosure, and used Disk Utility to restore from the old drive onto the 80GB partition. Doing this is much faster than making and restoring from a Time Machine backup. I could then boot the machine, and run Software Update to get everything up to date. Then I told iTunes where to find music on my NAS, and copied some favorite photos into iPhoto.
Power Management
I configured the computer to never sleep, and never sleep the display or hard drive either. I also set it up to restart after a power failure.
DVR Software: MythTV
Backend
Next, it was time to install the MythTV backend. Though MythTV is mostly a Linux project, it does work on OSX with a few quirks. The main resource for this is the wiki page, and I had already experimented somewhat using my Mac Pro. Using the pointers on that page, I downloaded the latest SVN nightly build from Sniderpad.com (I haven't actually noticed big differences between this and the 0.21-fixes release). I downloaded the backend and frontend then unpacked the Myth* executables into my Applications folder.
MythTV Prerequisite: MySQL
I downloaded the OSX package for MySQL 5.0.77 and then I installed MySQL. It comes with a Preference Pane to turn it off and on, and can be set to automatically start up, which is what you want.
Partitioning and Files
On the Recordings partition, I created a folder named MythTV, with 4 subfolders entitled LiveTV, Groups, Default and Backups. I also created an account at SchedulesDirect to get TV listings. I created directory for mythtv logfiles, as /var/log/myth and I changed ownership of this directory to the GUI user rather than root so that Myth could write to it.
To set up the backend, I launched Terminal.app and ran the database commands from the wiki page. First I chose a password (mythtv is a good choice if you are not worried about security). Then I ran MythTV-Setup.app.
A quick note on running the Myth* apps: when you are first starting out, it is best to run these from the command line (in Terminal.app) rather than by double-clicking the icons. That way, you can see any useful error messages that would otherwise just disappear from sight. The way to do this is to start a new Terminal window, then run, for example,
/Applications/MythBackend/MythTV-Setup.app/Contents/MacOS/MythTV-Setup
I ran through the setup application, telling it what my database password was and that I have an HDHomeRun (no need to specify the IP unless you have more than one unit). For each of the HDHomeRun's 2 tuners, I had to tell the setup program about my SchedulesDirect account. I also had to let it scan for channels, but that was necessary to do on only one tuner. (As a side note, channel scanning seemed fine on the Mini but it choked on the Mac Pro, probably due to threading issues. I put a note on the wiki page about that).
I told setup to go ahead and mark commercials during recording. I also told it which directories to put files in (the ones on the Recordings partition), and that mythfilldatabase should log to a file in /var/log/myth.
Once setup was done, I could run mythfilldatabase (which I again elected to do from the command line) and then start the backend.
Frontend
Now I could set up the frontend. I started the front end and told it the database password in the setup menu, and that I wanted it to automatically skip commercials. I tested LiveTV and recordings. I did not bother to set up any of the other features or plugins since I planned to get all that from Plex.
Automatic Startup
Once I was happy with MythTV's workings (and it actually took a few iterations -- you're getting the cleaned up version here), I made a launchd configuration file to automatically start mythbackend on boot, or at any time the backend crashes. You only want to do this after everything is really truly working because otherwise launchd may eat half your CPU just restarting mythbackend over and over, and it is fairly complicated to stop that behavior without a reboot. To enforce autostartup, I put a file named MythBackend.plist in /Library/LaunchDaemons, with the following content:
Disabled
KeepAlive
Label
MythBackend
ProgramArguments
/Applications/MythBackend/MythBackend.app/Contents/MacOS/MythBackend
-l
/var/log/myth/MythBackend
UserName
dvr
Please note that the UserName variable should be set to the GUI user name.
Plex
Now I could do the easy part -- set up Plex. I downloaded the latest version, installed it, and set up MythFrontend as an available external app. I also told it where to find movies, photos and home videos on my NAS and installed a couple of plugins. I cannot say enough about how awesome Plex is, so I'll let you discover it for yourself. I set up the user account so that it would automatically start Plex at login. Then I unplugged the Mini and brought it to my AV system, plugging it into a 100MB/sec segment of my network.
Final Connections
Using a mini-DVI to HDMI adapter I bought at Monoprice, I connected my Samsung PN-63B550 plasma display using HDMI input #2, and used a TOSLink optical cable to connect from the dual-use output jack of the Mini to an optical input of my Onkyo DS-777 AV receiver. Booting the Mini got me a nice display on the plasma right away. The Mac autodetected the plasma and set its video appropriately, choosing to overscan by default. The overscan is a little too much and hides the top menubar but I don't mind since I'm usually using Plex or Myth. You can turn off overscan in System Preferences->Display. Does anyone know if this Samsung has a "Just scan" option?
Monitoring
The best way to monitor the MythTV backend is by using Console.app. It's provided by Apple, and is lightweight with a nice interface. Just point it at the appropriate files in /var/log/myth.
Results
Both sound and video are smooth and good-looking to my untrained ear and eye. When MythBackend is recording and marking commercials, CPU usage is about 100-125% and MythFrontend playback gets untolerably jumpy in 1080i (720p is acceptable). However, full-res Plex playback is still just fine while MythBackend is working this hard (obviously because Plex is using CoreVideo and the GPU).
Plex's slideshows are nice (they launch as a screensaver), along with its ability to play iTunes playlists with the visualizer. I'm thrilled with the Myth ability to autoskip commercials. As a computer monitor the Samsung is acceptable for short periods but it would give you eyestrain to try to use it for a whole day.
To Do:
Remote Buddy (maybe using a Wii controller?)
Try to set up commercial flagging on the Mac Pro without making it have to stay on all the time
Problems:
At one point after an upgrade, MythBackend could not see the MySQL database. Since launchd was eating 70% CPU by launching it over and over, I had to remove MythBackend.plist, reboot, launch mythbackend manually, quit mythbackend, restore MythBackend.plist, and reboot again. The problem disappeared.
With the Apple Remote, MythFrontend views each button press as two presses. This makes it impossible to select half the items on any list with an even number of choices.
This revision: April 8, 2009
Contact: htpc(at)boonstra.org

















