User:SredniV
I've been using MythTV since late 2003 when I put together my first system using Myth 0.12/0.13. Since then, I've upgraded my frontend and backend a couple of times resulting in the following setup:
Contents
Hardware
Frontend
Mac mini (2009 version)
This system works well on it's own, but using the current mythbuntu patches for VDPAU, it's running very nicely.
AppleTV running Mythbuntu 8.04.
The setup is pretty much as described for the atv-bootloader pages. I'm looking forward to finding a quiet small form factor system with an nVidia 8 or 9 series GPU in the future, though.
Backend
Server running CentOS 5. The following are the Myth specifics:
- 2TB RAID 5 (4 x 750GB) array for storage (3Ware 9550SX controller)
- 6GB memory
- 2x AMD Opteron 275 @ 2.2GHz
- Motorola DCT-3200 via FireWire (uses a TI XIO2200(A) chip)
- HDHomeRun
- Hauppauge HD-PVR
- APC BH500NET for battery backup and remote power port control of DCT-3200, HDHomeRun, and HD-PVR
- APC SmartUPS 1000 for battery backup of server
Notes
Mac mini Setup
I used the following blog entry as a guide for getting Linux (Mythbuntu 8.10) installed: http://blog.costan.us/2009/03/ubuntu-810-or-904-on-mac-mini.html
Sound & Other Drivers
Sound was relatively easy to get working by specifying the following in /etc/modprobe.d/options
:
options snd_hda_intel model=mbp3
I also set IPv6 and the Bluetooth driver to not load by modifying /etc/modprobe.d/aliases
. In particular the directives for net-pf-10
and net-pf-31
were set to off
:
alias net-pf-10 off alias net-pf-31 off
VDPAU
This was also close to a no brainer. I used the VDPAU / Ubuntu repository that Jean-Yves Avenard has created at http://www.avenard.org/media/Ubuntu_Repository/Ubuntu_Repository.html. He's also hosting the VDPAU compatible nVidia drivers. I simply uninstalled the original Mythbuntu-provided MythTV packages and installed the ones from the Avenard repository.
Getting the nVidia drivers was a bit more involved. I had to update those separately and I did so from a command line login (not through X). The commands were somewhat similar to the following:
service gdm stop apt-get install nvidia-glx-180 rmmod nvidia modprobe nvidia service gdm start
The following is my xorg.conf
, in case it's of use:
Section "Extensions" Option "Composite" "Disabled" EndSection Section "Module" Load "glx" EndSection Section "Monitor" Identifier "Configured Monitor" EndSection Section "Device" Identifier "Configured Video Device" Driver "nvidia" Option "DPI" "100x100" Option "UseEvents" "1" Option "XvmcUsesTextures" "false" Option "NVAGP" "1" Option "AddARGBVisuals" "1" Option "AddARGBLXVisuals" "1" Option "NoLogo" "1" EndSection Section "Screen" Identifier "Default Screen" Device "Configured Video Device" Monitor "Configured Monitor" DefaultDepth 24 SubSection "Display" Depth 24 Modes "nvidia-auto-select" "1920x1080" "1280x720" "1024x768" "720x480" "800x600" "640x480" EndSubSection EndSection
I think I can get rid of some of the options in the "Device"
section since they're appropriate for XvMC setups, which the mini can't do.
As of 3/25/09, I've also noticed some A/V sync issues, but haven't gotten a handle on the conditions. They may be a result of bad re-encodings of files, rather than a problem with VDPAU.
Workarounds
Failed Recordings
I see failures sometimes because of issues with connectivity to the HDHomeRun or to the DCT-3200 via FireWire. It's usually the FireWire system that's fallen down causing the node of the DCT-3200 to change. For these situations, I've written a simple script that looks for the string "Recorder Failed" in the backend logs and emails me information about what died.
From there, I can manually go in to:
- Stop mythbackend.
- Unload the FireWire modules.
- Power cycle the DCT-3200.
- Reload the modules and start mythbackend.
I do steps 2 & 3 just to be sure that things are reset right. (In the Aliens sense of "it's the only way to be sure", that is.)
The following is the script I use to recognize a failed recording in the logs. And, yes, Rube Goldberg did assist with design and implementation of this script.
#!/bin/bash # Stores a record of what had failed before EXISTING_LIST=/var/log/mythtv/failed_recordings.log CUR_DATE=`date +%Y%m%d_%H%M%S` DIS_DATE=`date +%Y-%m-%d\ %H:%M:%S` #NEW_LIST=/tmp/new_failed_$CUR_DATE.log NEW_LIST=/tmp/new_failed.log NOTICE=" Canceled recording (Recorder Failed):" MARKER="< " if [ -f $NEW_LIST ]; then rm -f $NEW_LIST fi grep "Recorder Failed" /var/log/mythtv/mythbackend.log > $NEW_LIST if [ -f $EXISTING_LIST ]; then FAILED=`diff $NEW_LIST $EXISTING_LIST | grep -v "^>" | grep "^<"` FAILED=${FAILED//$NOTICE/} FAILED=${FAILED//$MARKER/\\n\\n} FAILED=${FAILED//cardid 1, sourceid 6/FireWire} FAILED=${FAILED//cardid 2, sourceid 2/HDHomeRun_0} FAILED=${FAILED//cardid 3, sourceid 2/HDHomeRun_1} fi #echo "Failed Recordings as of $DIS_DATE:" #echo -e $FAILED ### Mail function if [ -n "$FAILED" ]; then SENDER="<sender>" RECIPIENT="<recipient>" MAILER="/usr/sbin/sendmail" ( echo "From: MythBot (<sender>)" echo "To: Name (<Recipient>)" echo "Subject: MythTV: Failed recordings" echo " " echo " " echo "As of $DIS_DATE, the following recordings have failed:" echo -e $FAILED echo " " ) | $MAILER -f $SENDER $RECIPIENT fi cp $NEW_LIST $EXISTING_LIST rm -f $NEW_LIST
I'll eventually update this script to use mythtv-status to check when the next recording is. If it's more than 30 minutes away, I'll have it take care of the power cycling and module reloading so that I'll just get notified if something goes wrong. The failures occur on such an infrequent basis that I don't really care much about it yet.
The script is set to run via cron at two minutes past every half-hour (i.e. HH:02 and HH:32).
BH-500NET Control
It's a bit off-topic for MythTV, but since I use the BH-500NET for battery backup and remote power switch control of the HDHomeRun, HD-PVR, and DCT-3200, it's probably useful for the one other person that might be wanting to control one from Linux.
Background: The web-interface of the BH-500NET works from Internet Explorer just fine. Stray away from that and you find that it's an abomination. When I was trying to figure out how I could script it, I noticed that several of the techniques they use violate the Geneva Conventions. (They use NULL characters for string separators, for example.)
I finally came up with some CURL calls that could provide control of the power switches from a script, though.
You'll need the following:
- CURL installed on your system. It's probably already there.
- The password and username for the BH-500NET.
- The default username is
admin
. - For the password, you need to convert the actual password to hyphenated hex ASCII. That is, the password "
password
" will become "70-61-73-73-77-6F-72-64
".
- The default username is
The following script will set the values for the power ports (1 - 3) to "off - on - on".
#!/bin/bash PASSWORD="<HEX ASCII PASSWORD>" USER="<USER NAME>" HOST="<HOST NAME OR IP of BH-500NET>" CURL=/usr/bin/curl $CURL "http://$HOST/Logon.cgi" $CURL "http://$HOST/2?n=$USER&T=$PASSWORD" $CURL "http://$HOST/3?s=1&a=2&u=3&l=4&o=1&p=0&q=0&S2=Apply"
The request URL in the last CURL call has the interesting bits. "o
", "p
", "q
" represent power ports 1, 2, and 3, respectively. For each of those, values of 0, 1, and 2 are possible, with 0 representing "On", 1 representing "Off", and 2 representing "Reboot/PowerCycle".