Difference between revisions of "HD MythTV On A Budget"

From MythTV Official Wiki
Jump to: navigation, search
m (Fixed typos)
 
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
As part of keeping more of our paycheck (Thanks Dave Ramsey), we decided that we needed to get rid of DishTV.  Out of the entire package, we felt that losing DVR functionality was unacceptable, so thus started our MythTV journey.  Again, in the interest of budget, we found that building our own frontends with new hardware (intel atom boxes) would cost about 200-250.  Therefore, I priced out some criagslist prices and found that I could save about 100-200 over the entire project by buying used computers. Since almost all of the MythTV documentation online talked about older hardware, it seemed like a great path.
 
As part of keeping more of our paycheck (Thanks Dave Ramsey), we decided that we needed to get rid of DishTV.  Out of the entire package, we felt that losing DVR functionality was unacceptable, so thus started our MythTV journey.  Again, in the interest of budget, we found that building our own frontends with new hardware (intel atom boxes) would cost about 200-250.  Therefore, I priced out some criagslist prices and found that I could save about 100-200 over the entire project by buying used computers. Since almost all of the MythTV documentation online talked about older hardware, it seemed like a great path.
 +
 +
** Please See Inline Notes For Changes After Mythbuntu 10.04 and 10.10 LTS Intall **
  
  
 
'''Original Objectives:'''
 
'''Original Objectives:'''
 
   - Spend about 100 - 150 per frontend
 
   - Spend about 100 - 150 per frontend
   - All frontends should be able to handle HD TVs (current TVs are CRT, but you never know what Santa will bring)
+
   - All frontends should be able to handle HD TVs  
 
   - Diskless would save some money, power and noise
 
   - Diskless would save some money, power and noise
 
   - Original Estimate was $661.  Dish + Landline cost about $500/year.
 
   - Original Estimate was $661.  Dish + Landline cost about $500/year.
Line 17: Line 19:
 
   - 2G RAM
 
   - 2G RAM
 
   - 160G HD
 
   - 160G HD
   - 1TB HD - 90
+
   - 1TB HD - $90
  
  
Line 70: Line 72:
  
 
After some research, I found that mythbuntu was one of the more popular options in terms of forum and documentation support.  So I installed a BE/FE configuration on my backend for testing. After looking at the eye candy and the features, I got preliminary wife
 
After some research, I found that mythbuntu was one of the more popular options in terms of forum and documentation support.  So I installed a BE/FE configuration on my backend for testing. After looking at the eye candy and the features, I got preliminary wife
support to go ahead with the project.  So I ordered the Hauppage 2250 Tuner card.  This brought up problem #1.
+
support to go ahead with the project.  So I ordered the Hauppauge 2250 Tuner card.  This brought up problem #1.
  
 
   '''Issue:''' Hauappage TV Tuner Card does not work in Linux out of the box
 
   '''Issue:''' Hauappage TV Tuner Card does not work in Linux out of the box
Line 76: Line 78:
 
     http://www.steventoth.net/blog/products/hvr-2250/  
 
     http://www.steventoth.net/blog/products/hvr-2250/  
 
   '''NOTE:'''  Whenever you update the kernel image, you WILL have to re-compile this
 
   '''NOTE:'''  Whenever you update the kernel image, you WILL have to re-compile this
 +
  '''10.04 LTS NOTE:  Supported in the Kernel.  You will still need the firmware files included in the link above.  Hauppauge
 +
    does have more recent drivers, but will not work due to hardcoded driver size in the kernel.  Good news, no more recompiling!
 +
 +
 +
  '''Issue:''' The tuner card does not like it when you watch the same channel on both tuners.  The picture is really bad.
 +
  '''Solution:''' Not sure if this is common with tuner cards or just this one.  No solution found yet.
  
  
Line 104: Line 112:
 
   '''WebSite:'''  http://ubuntuforums.org/showthread.php?p=2919008#post2919008
 
   '''WebSite:'''  http://ubuntuforums.org/showthread.php?p=2919008#post2919008
 
   '''Solution #2:''' While working on Frontend2, I found Ubuntu Minimal Install ISO.  This requires a little bit of additional  
 
   '''Solution #2:''' While working on Frontend2, I found Ubuntu Minimal Install ISO.  This requires a little bit of additional  
                 technical knowledge, but allows the option to install grub2 and mythbuntu from the install menus.  More details later.
+
                 technical knowledge, but allows the option to install grub2 and mythbuntu from the install menus.  More details later.      
 +
  '''10.04 LTS Solution: 10.04 installs grub2 by default, so the minimal install ISO is *not* needed any more 
 +
 
  
 
   '''Issue:''' Dell Optiplex 320 Does not recognize USB ports until after the middle of loading the OS.  So diskless bootup went out the  
 
   '''Issue:''' Dell Optiplex 320 Does not recognize USB ports until after the middle of loading the OS.  So diskless bootup went out the  
Line 114: Line 124:
  
 
   '''Issue:''' Wanted to use my existing DishTV remotes with the streamzap receiver.  
 
   '''Issue:''' Wanted to use my existing DishTV remotes with the streamzap receiver.  
   '''Solution:''' I will try to re-find and post the website that helped me with this. The most important key that I learned is  
+
   '''Solution:'''  The most important key that I learned is  
 
               that hopefully you have the Dish remote that can learn.  So I took the streamzap and the dish and had the Dish remote  
 
               that hopefully you have the Dish remote that can learn.  So I took the streamzap and the dish and had the Dish remote  
 
               learn all the streamzap codes.  That way, the streamzap receiver just thought the Dish remote was the streamzap and  
 
               learn all the streamzap codes.  That way, the streamzap receiver just thought the Dish remote was the streamzap and  
 
             from there, just got all the codes straightened out and mapped the way I want them.  Will include the file later.
 
             from there, just got all the codes straightened out and mapped the way I want them.  Will include the file later.
  '''Maybe solution:'''  Not sure if I had to do this, but I did install the latest version of lirc.  This will also have to be
 
                    recompiled after every linux image update.
 
  
  
Line 139: Line 147:
  
 
More research and advice from my co-worker (thanks Erik), I came across Ethernet over Powerline.  While scary sounding (don't be messing with my power) and expensive, I was too far into the project to quit now.  Sure enough, it worked great!  From all the power outlets that I cared about, the bandwidth was plenty.
 
More research and advice from my co-worker (thanks Erik), I came across Ethernet over Powerline.  While scary sounding (don't be messing with my power) and expensive, I was too far into the project to quit now.  Sure enough, it worked great!  From all the power outlets that I cared about, the bandwidth was plenty.
 +
 +
  '''UPDATE: A recent mythtv patch made it so that the bandwidth to one of my frontends was no longer sufficient.  Sometimes the recorded shows menu locks up, other times it would try to start the show, but starting in 10.10, it just has an X error and logs you out of the logged in session.  Bad stuff.  Therefore, I am currently working on wiring my one frontend with CAT 6 cable.  My other frontend still works great with EoP.
  
  
Line 167: Line 177:
 
A major contributing factor may have been that I replaced the TV antenna also.  We found that bad reception was very bad for the computer CPU usage :)  So bought a better TV antenna and with the minimal install, its working great.  Probably wasted a bunch of time with that, but I learned about the minimal install ISO and how it lets you install grub2 from there, so that's good.
 
A major contributing factor may have been that I replaced the TV antenna also.  We found that bad reception was very bad for the computer CPU usage :)  So bought a better TV antenna and with the minimal install, its working great.  Probably wasted a bunch of time with that, but I learned about the minimal install ISO and how it lets you install grub2 from there, so that's good.
  
 +
  '''10.04 LTS Update: This box has worked just fine starting with mythbuntu 9.10.  No need to do minimal installs anymore.  I just pop in the CD and use the slim playback setting and it works fine. 
  
Last thing on order is a 1TB Hard drive.  The kids shows alone are taking about 40+G transcoded, so when the TV season starts, the adult shows are going to stretch our 80G limit.
+
 
 +
The kids shows alone are taking about 40+G transcoded, so when the TV season starts, the adult shows are going to stretch our 80G limit.  Therefore, we bought a 1TB hard drive.  Could probably get away with less, but you would only save like $20.
  
 
----
 
----
Line 177: Line 189:
  
 
   '''Hard Drive Partitioning:'''   
 
   '''Hard Drive Partitioning:'''   
     /      :ext380G (overkill - but all updates take up disk space)
+
     /      :ext470G (overkill - but all updates take up disk space)
    /var/lib:xfs: 10G  (mythbuntu likes putting stuff here, but its mainly just going to be the database once you set everything up)
+
     /liveTV :xfs: 80G  (we are using usually 1 TV and LiveTV takes approx 40G after a night of watching.  So 2 TVs might take up 80G)
     /liveTV :xfs: 80G  (we are using usually 1 TV and LiveTV takes approx 40G after a night of watching.  So 2 TV might take up 80G)
+
     /video :xfs: 920G (make sure to keep LiveTV and media in separate partitions. If they are on the same partition, you never  
     /media :xfs: the rest (make sure to keep LiveTV and media in separate partitions. If they are on the same partition, you never  
 
 
               really know how much free space you have because LiveTV auto-expires.  So you could have 3G one day, then 30G the next)
 
               really know how much free space you have because LiveTV auto-expires.  So you could have 3G one day, then 30G the next)
     NOTE:  media = recordings, movies, music, etc.  If you have lots of movies or music, you may want another partition for those
+
    /var    : ext4: 1G
 +
     NOTE:  video = recordings, movies, music, etc.  If you have lots of movies or music, you may want another partition for those
  
  
Line 189: Line 201:
 
     - In mythbuntu control center, go to advanced, and turn on the mythweb tweak option
 
     - In mythbuntu control center, go to advanced, and turn on the mythweb tweak option
 
     - Same menu, pick the automatic database optimization
 
     - Same menu, pick the automatic database optimization
    - Same menu, turn on automatic xfs defrag
+
 
  
 
   - Frontends:
 
   - Frontends:
Line 196: Line 208:
 
     - Play around with the Playback profiles in Setup->TV->Playback.  I use Slim for my Dell and I made a new one called Xvmc for  
 
     - Play around with the Playback profiles in Setup->TV->Playback.  I use Slim for my Dell and I made a new one called Xvmc for  
 
       the HP.  Will post details.
 
       the HP.  Will post details.
     - Install latest video drivers.  You will have to download from the nvidia website and compile these yourselves. 
+
     - Install latest video drivers.
      Didn't have a huge impact, but everything helps.
+
    - 10.04 LTS NOTE: The "Nvidia Current" version in ubuntu works fine, so no need to download and compile yourself until ubuntu gets
    - As stated before, use the ubuntu minimal ISO.  the advantage is that it automatically grabs the current latest and greatest
+
       outdated.
       versions of everything, so you don't have go through the update manager and it will over-write pretty much your entire install.
 
 
     - I set up all the transcodes and commflag processes to be run during the night.  By default they run right after the program is over.
 
     - I set up all the transcodes and commflag processes to be run during the night.  By default they run right after the program is over.
 
       Since these processes can take up a lot of CPU, that was not good.
 
       Since these processes can take up a lot of CPU, that was not good.
Line 217: Line 228:
 
     '''NFS'''
 
     '''NFS'''
 
     - Backend:
 
     - Backend:
       - fstab: (have a second harddrive for just the mythtv stuff.  This will change
+
       - /etc/fstab:  
           when I have multiple partitions as outlined above)
+
           /dev/sdb1  /liveTV  xfs    defaults,noatime,nodiratime,logbufs=8,allocsize=512m    0    0
           /dev/sdb1   /video  xfs    defaults,noatime,nodiratime,logbufs=8,allocsize=512m    0    0
+
           /dev/sdb2   /video  xfs    defaults,noatime,nodiratime,logbufs=8,allocsize=512m    0    0
       - export:
+
       - /etc/export:
 +
          /liveTV    *(rw,async,no_root_squash,no_subtree_check)
 
           /video    *(rw,async,no_root_squash,no_subtree_check)
 
           /video    *(rw,async,no_root_squash,no_subtree_check)
 +
      - /etc/hosts.allow:
 +
        ALL : 192.168.1. : allow
 
     - Frontends:
 
     - Frontends:
 
       - fstab:
 
       - fstab:
           192.168.1.101:/video /video nfs rsize=8192,wsize=8192,intr
+
          192.168.1.101:/liveTV /liveTV nfs rsize=8192,wsize=8192,intr
+
           192.168.1.101:/video /video nfs rsize=8192,wsize=8192,intr  
 +
 
 +
 
 
   '''Xvmc'''
 
   '''Xvmc'''
 
     All I had to do here is put this in the /etx/X11/xorg.conf file:
 
     All I had to do here is put this in the /etx/X11/xorg.conf file:
Line 266: Line 282:
 
       - Same but Video Bitrate: 1800
 
       - Same but Video Bitrate: 1800
  
  Remote Mapping:
 
    ~/.lirc/mythtv:
 
<code><pre>
 
# LIRCRC Auto Generated by Mythbuntu Lirc Generator
 
# Author(s): Mario Limonciello, Nick Fox
 
# Created for use with Mythbuntu
 
# OK/Select
 
begin
 
prog = mythtv
 
button = OK
 
config = Space
 
end
 
  
# Play
+
  '''Ubuntu Minimal CD stuff'''
begin
+
  - The good:
prog = mythtv
+
    - At least on my backend, the normal mythbuntu CD has bad graphics.  The only way to install on my backend is the minimal install.
button = Play
+
    - Helps you install just the bare minimum of what you need (although by the time you are done, you have all the junk anyway)
config = Return
 
end
 
  
# Stop
+
  - Process:
begin
+
    - Download ISO from https://help.ubuntu.com/community/Installation/MinimalCD
prog = mythtv
+
    - Use a program to either burn the iso to a CD or a usb thumb drive (think I used a program called usb-creator)
button = Stop
+
    - Plug into computer, start it up.  At the boot> prompt, you can type in one of two things:
config = Esc
+
      - cli  :  This is the default menus.  Still requires above newbie knowledge, but its decent.
end
+
      - cli-expert : I am no expert, but I found that this provided the freedom of options that I wanted.
 +
    - The first time I ran this, one of the menus allowed me to pick what flavor of ubuntu to install.  This list even included
 +
      mythbuntu frontend.  However, the second time I tried this, it never gave me that menu.  No clue why, but I did not feel
 +
      like spending the time to figure it out.  Just hope that you get that menu, I think it was in the "Select and Install
 +
      Software" portion.  If you do not get that menu, here is what to do:  (based one website:
 +
      http://www.psychocats.net/ubuntu/minimal )
 +
     
  
# Escape/Exit/Back
+
  '''Remote Mapping:'''
begin
 
prog = mythtv
 
button = Exit
 
config = Esc
 
end
 
  
# Power Off/Exit
+
This process was a mess in 10.10.  What happened seems that the Linux Input Layer suddenly decided after all this time that it likes my remote as a keyboard.  While this would be fine with me, its not cool when it doesnt recognize all of your buttons and there is no way of altering its behavior!
#begin
 
#prog = mythtv
 
#button = Power
 
#config = Esc
 
#end
 
  
 +
Based on a few websites: here is the general procedure:
 +
  - Get HAL to ignore the remote
 +
  - Install LIRC to take over
 +
  - Configure LIRC.
 +
 
 +
*NOTE:*  Since LIRC is still subject to the Linux Input Layer, the normal streamzap button mappings no longer worked.  Instead I had to use the devinput button mapping codes.
  
# CHUP becomes tuner change
+
Here are the websites I used:
begin
+
- http://www.lirc.org/html/devinput.html
prog = mythtv
+
- /etc/lirc/hardware.conf (important stuff)
button = ChUp
+
  - The Device Address I think could be /dev/input/irremote, but instead I got the actual address from:
config = Y
+
    /proc/bus/input/devices
end
+
    *Note: The address will no longer work if you change USB ports
 +
- [[Streamzap_Remote|Streamzap lircrc and lircd.conf]]
 +
<code><pre>
 +
#Chosen Remote Control
 +
REMOTE="Streamzap_PC_Remote"
 +
REMOTE_MODULES=""
 +
REMOTE_DRIVER="devinput"
 +
REMOTE_DEVICE="phys=usb-0000:00:13.0-1/input0"
 +
REMOTE_LIRCD_CONF="/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap"
 +
REMOTE_LIRCD_ARGS=""
 +
</pre></code>
  
# ChDown becomes Time Stretch
+
- /etc/lird.conf
begin
+
<code><pre>
prog = mythtv
+
include "/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap"
button = ChDown
+
</pre></code>
config = A
 
end
 
  
 +
- /etc/udev/rules.d/60-symlinks.rules
 +
<code><pre>
 +
KERNEL=="event*",ATTRS{name}=="Streamzap*",SYMLINK+="input/irremote"
 +
</pre></code>
  
# Pause
+
- /usr/share/hal/fdi/preprobe/20thirdparty/lirc.fdi
begin
+
  - To make sure this works, type:  lshal
prog = mythtv
+
  - Look for the entry for the IR and make sure that it has something that says it is ignored.
button = Pause
+
   
repeat = 3
 
config = P
 
end
 
 
 
# Mute
 
begin
 
prog = mythtv
 
button = Mute
 
repeat = 2
 
config = F9
 
end
 
 
 
begin
 
prog = mythtv
 
button = SeekBack
 
repeat = 2
 
config = Left
 
end
 
 
 
# Rewind (10 sec default)
 
begin
 
prog = mythtv
 
button = SeekFw
 
repeat = 2
 
config = Right
 
end
 
 
 
# Skip forward (10 min default)
 
begin
 
prog = mythtv
 
button = TrackNext
 
repeat = 2
 
config = PgDown
 
end
 
 
 
# Skip backward (10 min default)
 
begin
 
prog = mythtv
 
button = TrackPrev
 
repeat = 2
 
config = PgUp
 
end
 
 
 
# Record
 
begin
 
prog = mythtv
 
button = Record
 
repeat = 2
 
config = R
 
end
 
 
 
# Volume Up
 
begin
 
prog = mythtv
 
button = VolUp
 
repeat = 2
 
config = ]
 
end
 
 
 
# Volume Down
 
begin
 
prog = mythtv
 
button = VolDown
 
repeat = 2
 
config = [
 
end
 
 
 
 
 
# Widescreen
 
begin
 
prog = mythtv
 
button = Red
 
repeat = 2
 
config = W
 
end
 
 
 
# Display EPG while in live TV,
 
# View selected show while in EPG
 
begin
 
prog = mythtv
 
button = Menu
 
repeat = 2
 
config = M
 
end
 
 
 
# Scroll Right
 
begin
 
prog = mythtv
 
button = Right
 
repeat = 2
 
config = Right
 
end
 
 
 
# Scroll Left
 
begin
 
prog = mythtv
 
button = Left
 
repeat = 2
 
config = Left
 
end
 
 
 
# Scroll Up
 
begin
 
prog = mythtv
 
button = Up
 
repeat = 2
 
config = Up
 
end
 
 
 
# Scroll down
 
begin
 
prog = mythtv
 
button = Down
 
repeat = 2
 
config = Down
 
end
 
 
 
 
 
 
 
# Info
 
begin
 
prog = mythtv
 
button = Green
 
repeat = 2
 
config = I
 
end
 
 
 
# Seek to previous commercial cut point
 
begin
 
prog = mythtv
 
button = Yellow
 
repeat = 2
 
config = Q
 
end
 
 
 
# Seek to next commercial cut point
 
begin
 
prog = mythtv
 
button = Blue
 
repeat = 2
 
config = Z
 
end
 
 
 
# Numbers 0-9
 
 
 
begin
 
prog = mythtv
 
button = 0
 
repeat = 2
 
config = 0
 
end
 
 
 
begin
 
prog = mythtv
 
button = 1
 
repeat = 2
 
config = 1
 
end
 
 
 
begin
 
prog = mythtv
 
button = 2
 
repeat = 2
 
config = 2
 
end
 
 
 
begin
 
prog = mythtv
 
button = 3
 
repeat = 2
 
config = 3
 
end
 
 
 
begin
 
prog = mythtv
 
button = 4
 
repeat = 2
 
config = 4
 
end
 
 
 
begin
 
prog = mythtv
 
button = 5
 
repeat = 2
 
config = 5
 
end
 
 
 
begin
 
prog = mythtv
 
button = 6
 
repeat = 2
 
config = 6
 
end
 
 
 
begin
 
prog = mythtv
 
button = 7
 
repeat = 2
 
config = 7
 
end
 
 
 
begin
 
prog = mythtv
 
button = 8
 
repeat = 2
 
config = 8
 
end
 
 
 
begin
 
prog = mythtv
 
button = 9
 
repeat = 2
 
config = 9
 
end
 
 
 
 
 
### MPlayer lirc setup
 
 
 
# Show OSD
 
begin
 
prog = mplayer
 
button = Menu
 
repeat = 2
 
config = osd
 
end
 
 
 
# Pause playback
 
begin
 
prog = mplayer
 
button = Pause
 
repeat = 2
 
config = pause
 
end
 
 
 
# Skip ahead a minute if playing
 
# If paused, resume playing
 
begin
 
prog = mplayer
 
button = Play
 
repeat = 2
 
config = seek +1
 
end
 
 
 
# Stop playback and exit
 
begin
 
prog = mplayer
 
button = Stop
 
repeat = 2
 
config = quit
 
end
 
 
 
# Mute
 
begin
 
prog = mplayer
 
button = Mute
 
repeat = 2
 
config = mute
 
end
 
 
 
# Seek back 10 seconds
 
begin
 
prog = mplayer
 
button = SeekBack
 
repeat = 2
 
config = seek -10
 
end
 
 
 
# Seek forward 30 seconds
 
begin
 
prog = mplayer
 
button = SeekFw
 
repeat = 2
 
config = seek +30
 
end
 
 
 
# Quit
 
begin
 
prog = mplayer
 
button = Exit
 
repeat = 2
 
config = quit
 
end
 
 
 
# Seek forward 10 minutes
 
begin
 
prog = mplayer
 
button = TrackNext
 
repeat = 2
 
config = seek +600
 
end
 
 
 
# Seek backward 10 minutes
 
begin
 
prog = mplayer
 
button = TrackPrev
 
repeat = 2
 
config = seek -600
 
end
 
 
 
# Toggle full-screen
 
begin
 
prog = mplayer
 
button = Green
 
repeat = 2
 
config = vo_fullscreen
 
end
 
</pre></code>
 
    - /usr/share/lirc/remotes/streamzap/lircd.conf.streamzap
 
 
<code><pre>
 
<code><pre>
#
+
<?xml version="1.0" encoding="UTF-8"?>
# this config file was automatically generated
 
# using lirc-0.7.1-CVS(serial) on Fri Feb  4 23:20:56 2005
 
#
 
# contributed by Christoph Bartelmus
 
#
 
# brand:                      Streamzap
 
# model no. of remote control: PC Remote
 
# devices being controlled by this remote: USB receiver
 
#
 
  
begin remote
+
<deviceinfo version="0.2">
 +
  <device>
 +
    <match key="info.product" contains_ncase="Streamzap Remote Control">
 +
        <merge key="info.ignore" type="bool">true</merge>
 +
    </match>
 +
  </device>
 +
</deviceinfo>
  
  name  Streamzap_PC_Remote
 
  bits            6
 
  flags RC5|CONST_LENGTH
 
  eps            30
 
  aeps          100
 
 
  one          889  889
 
  zero          889  889
 
  plead        889
 
  pre_data_bits  8
 
  pre_data      0xA3
 
  gap          108344
 
  toggle_bit      2
 
 
 
      begin codes
 
          0                        0x00
 
          1                        0x01
 
          2                        0x02
 
          3                        0x03
 
          4                        0x04
 
          5                        0x05
 
          6                        0x06
 
          7                        0x07
 
          8                        0x08
 
          9                        0x09
 
          Power                    0x0A
 
          Mute                    0x0B
 
          ChUp                    0x0C
 
          VolUp                  0x0D
 
          ChDown                  0x0E
 
          VolDown                0x0F
 
          Up                      0x10
 
          Left                    0x11
 
          Ok                      0x12
 
          Right                    0x13
 
          Down                    0x14
 
          Menu                    0x15
 
          Exit                    0x16
 
          Play                    0x17
 
          Pause                    0x18
 
          Stop                    0x19
 
          TrackPrev                      0x1A
 
          TrackNext                      0x1B
 
          Record                  0x1C
 
          SeekBack                      0x1D
 
          SeekFw                      0x1E
 
          Red                    0x20
 
          Green                    0x21
 
          Yellow                  0x22
 
          Blue                    0x23
 
      end codes
 
 
end remote
 
 
</pre></code>
 
</pre></code>
 
 
 
 
----
 
----
  
Line 720: Line 368:
 
   - If you have satellite or cable, just pay the extra $5/month for the DVR.  Setting up mythTV just for a media center is not cost
 
   - If you have satellite or cable, just pay the extra $5/month for the DVR.  Setting up mythTV just for a media center is not cost
 
     efficient, but if you have the money for it, its awesome.
 
     efficient, but if you have the money for it, its awesome.
  - If you are thinking about Tivo, strongly consider setting up a MythTV system instead.  Myth has twice the functionality of a Tivo
 
    and overall a cheaper price. (no monthly fee)
 
 
   - You will need to already have knowledge of, or be willing to learn about Linux to get this working at peak performance.  Mythbuntu  
 
   - You will need to already have knowledge of, or be willing to learn about Linux to get this working at peak performance.  Mythbuntu  
     is a great start, but there is always something that will require command line intervention.  Safest bet is to pay your local
+
     is a great start, but there is always something that will require command line intervention.   
    computer geek a few dollars to set it up for you.  Best case, you will just have to learn about NFS and maybe the audio mixer.
 
 
   - There are media centers available for windows (sageTV), but you will need nicer computers than what I bought here because  
 
   - There are media centers available for windows (sageTV), but you will need nicer computers than what I bought here because  
 
     windows+HDTV is not going to be happy.  MythTV is the nicer on the wallet.
 
     windows+HDTV is not going to be happy.  MythTV is the nicer on the wallet.
  
  
Overall, for my family, it was worth it.  We are ditching our Dish Satellite and landline.  In a year and a half, we will be making about $60/month from going with mythTV.  Yes its more work, but if you are or know a computer guy, this project can be a fun (sometimes maddening) one.  If you are in doubt over your technical expertise, just compensate with better hardware. The majority of my issues came from buying previous generation equipment and expecting it to meet modern day demands.
+
Overall, for my family, it was worth it.  Above all, the automatic commercial skipping is worth every minute and dime spent on the system.  I figure all the money we save from having to buy the kids the new fancy thing they saw in a commercial should get added to the Mythtv "plus" side. 
 +
 
 +
We are ditching our Dish Satellite and landline.  In a year and a half, we will be saving about $60/month from going with mythTV.  Yes its more work, but if you are or know a computer guy, this project can be a fun (sometimes maddening) one.  If you are in doubt over your technical expertise, just compensate with better hardware. The majority of my issues came from buying previous generation equipment and expecting it to meet modern day demands.
 +
 
 +
--UPDATE:  The key to mythtv is one you get it working, do not upgrade unless you really really want the new feature.  Some upgrades are flawless, some result in hours of research and work to resolve.  If you just want something that works, no questions asked, spend the extra money and get Tivo or something.  Computer based solutions offer more freedom, but you pay for that freedom with time and sometimes stress.  
  
  
 
Thank for reading, hope it helps!
 
Thank for reading, hope it helps!

Latest revision as of 07:11, 28 October 2017

My Goal with this Wiki is to document the trials and tribulations of saving a few dollars on building a High Definition Capable MythTV system on a budget. This meant buying whatever I could at decent prices off of craigslist.


As part of keeping more of our paycheck (Thanks Dave Ramsey), we decided that we needed to get rid of DishTV. Out of the entire package, we felt that losing DVR functionality was unacceptable, so thus started our MythTV journey. Again, in the interest of budget, we found that building our own frontends with new hardware (intel atom boxes) would cost about 200-250. Therefore, I priced out some criagslist prices and found that I could save about 100-200 over the entire project by buying used computers. Since almost all of the MythTV documentation online talked about older hardware, it seemed like a great path.

    • Please See Inline Notes For Changes After Mythbuntu 10.04 and 10.10 LTS Intall **


Original Objectives:

  - Spend about 100 - 150 per frontend
  - All frontends should be able to handle HD TVs 
  - Diskless would save some money, power and noise
  - Original Estimate was $661.  Dish + Landline cost about $500/year.


Backend: Total: $202

  - I had a home-built Athlon 3700 box collecting dust (yay for breaking WoW addiction)
  - Hauppauge WinTV-HVR-2250 tuner card - $112
  - 2G RAM
  - 160G HD
  - 1TB HD - $90


Frontend 1: Total: $135

  - Dell Optiplex 320 3.0GHz  - $80 from craigslist
  - ZOTAC ZT-94TEH2L-FDR-V1 GeForce 9400 GT 512MB  - $41 from newegg
  - 1G RAM - $14 from Frys
  - 80G HD


Frontend 2: Total: $113.99

  - HP 2.6GHz - $80 from craigslist
  - ZOTAC ZT-62AA250-HSS GeForce 6200 256MB (AGP)  - $33.99 from newegg
  - 1G RAM
  - 80G HD


Networking: Total: $218

  - Linksys Router - already owned
  - Linksys PLK300 PowerLine AV - $145 
  - Linksys PLE300 - $73 from amazon
  *Note*  I tried a wireless card, SD channels showed up great, but the HD channels were horrible.  This was a WirelessG card.  
          Not sure how N would work.  The powerline stuff is expensive, but it is working really well.


TV:

 - Terk Technology HDTVi antenna - $45 from Frys
 - ScheduleDirect for program listing - $20/year

Remotes:

- 2 Streamzap PC Remotes from Amazon - $60


Total Cost:

 $793.99 + some shipping not included above 


Approx Savings from buying used instead of new hardware: (assuming $200 per frontend)

 $151.01


So there goes the budget :( It will take about a year and a half to start making money off of the setup. Of course, buying used you run the risk of the hardware going bad on you sooner, so I may need to spend that 150 anyway later on when one of my machines die.




Now, for the part you probably came here for, Getting MythTV Working.


Backend:

After some research, I found that mythbuntu was one of the more popular options in terms of forum and documentation support. So I installed a BE/FE configuration on my backend for testing. After looking at the eye candy and the features, I got preliminary wife support to go ahead with the project. So I ordered the Hauppauge 2250 Tuner card. This brought up problem #1.

 Issue: Hauappage TV Tuner Card does not work in Linux out of the box
 Solution:  God liked me and gave Steven Toth the great wisdom to make drivers for it.
   http://www.steventoth.net/blog/products/hvr-2250/ 
 NOTE:  Whenever you update the kernel image, you WILL have to re-compile this
 10.04 LTS NOTE:  Supported in the Kernel.  You will still need the firmware files included in the link above.  Hauppauge 
    does have more recent drivers, but will not work due to hardcoded driver size in the kernel.  Good news, no more recompiling!


 Issue: The tuner card does not like it when you watch the same channel on both tuners.  The picture is really bad.
 Solution: Not sure if this is common with tuner cards or just this one.  No solution found yet.


After getting it to work, I got LiveTV! Everything was working great on my backend. Then I noticed something.

 Issue: HD recordings can take up to 6Gb/hour.  SD is about half of that.  
 Solution:  Auto-Transcode the kids shows.  Make sure to watch the adult shows quickly.  Decided not to auto-transcode the adult 
            shows because we tend to watch them the same night.  When the shows build up, we may auto-transcode more of them.  
            Of course, we also ordered a 1TB HD :)   After transcoding, the kids shows take about 1G/30 minutes and adult shows 
            about 3G/hour


Then I realized I had DHCP on, so I had to lock in the IP address for the backend. After doing some reading, it seemed that the DNS name thing was kind of undependable, so IP address it was.

   Issue:  DHCP kept changing IP address of backend
   Solution:  Installed dd-wrt and set up a static lease for my backend  


So great, backend done, now for Frontend #1.


Frontend 1:

After some craigslist lurking, bought a Dell Optiplex 320. Small, quiet, PCI-express slot, 3Ghz, perfect, right? Only after about 20ish hours of work! :(

  Issue: Dell Optiplex 320 Does not like booting linux.  Not sure on the details, but after some research found that it needs Grub2
  Solution:  You will need to install Grub2.  This is not so easy with mythbuntu and requires some command line interaction.
  WebSite:  http://ubuntuforums.org/showthread.php?p=2919008#post2919008
  Solution #2: While working on Frontend2, I found Ubuntu Minimal Install ISO.  This requires a little bit of additional 
               technical knowledge, but allows the option to install grub2 and mythbuntu from the install menus.  More details later.       
  10.04 LTS Solution: 10.04 installs grub2 by default, so the minimal install ISO is *not* needed any more  


  Issue: Dell Optiplex 320 Does not recognize USB ports until after the middle of loading the OS.  So diskless bootup went out the 
         window since the machine would boot off the USB, but then I had to unplug it and plug it back in when the mythbuntu bar 
         was about halfway across the screen. Painful.
  Solution:  Hard Drive install.  Tried network booting, but could not figure out how to manage the mythbuntu network boot features.
             I could create the linux image, but updating it and maintaining it seemed painful.  Also, could not get network booting 
             to work very well on the Dell.
  Issue: Wanted to use my existing DishTV remotes with the streamzap receiver. 
  Solution:  The most important key that I learned is 
             that hopefully you have the Dish remote that can learn.  So I took the streamzap and the dish and had the Dish remote 
             learn all the streamzap codes.  That way, the streamzap receiver just thought the Dish remote was the streamzap and 
            from there, just got all the codes straightened out and mapped the way I want them.  Will include the file later.


  Issue:  Audio was too low
  Solution:  Go to Mixer and turn up all the volumes, then type:
              sudo alsactl store
              in a terminal to save all the settings
  NOTE:  Turn OFF automatic updates.  As mentioned above, if it installs updated linux kernels, you will have to recompile things, 
  which is a pain.  If you want the latest and greats of the important stuff, go to the mythbuntu website and set up the automatic 
   weekly builds. Just make sure to do the fixes branch.  


So Frontend 1 is working great with the video card installed. Able to watch LiveTV, view movies I put on the backend, record things, working great. I learned enough about NFS to connect the media directories on the backend machine to the frontend machine so now all the frontends can share one video library. YAY. Now its time to disconnect it from the router :)


Purchased a wirelessG card. SD channels work great, but most of the channels now transmit HD over the air. So only like 2 channels worked. All of the other ones would play for a minute, stop, play another minute, stop, etc. All the stuff online said it worked, but that was written a long time ago and probably didn't cover HD. Let me tell you right now, even in the same room 10 feet away, WirelessG will NOT work for HD channels.


More research and advice from my co-worker (thanks Erik), I came across Ethernet over Powerline. While scary sounding (don't be messing with my power) and expensive, I was too far into the project to quit now. Sure enough, it worked great! From all the power outlets that I cared about, the bandwidth was plenty.

  UPDATE: A recent mythtv patch made it so that the bandwidth to one of my frontends was no longer sufficient.  Sometimes the recorded shows menu locks up, other times it would try to start the show, but starting in 10.10, it just has an X error and logs you out of the logged in session.  Bad stuff.  Therefore, I am currently working on wiring my one frontend with CAT 6 cable.  My other frontend still works great with EoP.


So Frontend 1 was now live in a room across the house. After some testing and more diddling (that's the thing with MythTV, there's always room to tweak), it was time to continue with the project. I will try to cover some of the more important tweaks a little later.


Frontend 2:

The bad part about craigslist is that you either have uber patience to find the price/item you want, or grab what you can take. So I bought a HP 2.6GHz. Again, from reading online, 2.6GHz was marginal, but should work. Mythbuntu stated recommended for HD was 3GHz, but I waited a week or so and couldn't find another Dell Optiplex 320 for a decent price.


Anyway, install went smoothly, mythbuntu Frontend. Got it all hooked up to the backend database, started the Frontend up and...

  Issue:  2.6GHz really isn't enough for HD content.  OOPS  The CPU was maxed out.  Frontend was at like 50% CPU and xorg was the 
          other 50%
  Solution:  Get a decent AGP video card and hope that it can take some of the pressure off the CPU


So I got the AGP video card and crossed my fingers. No luck. Nothing was better. So more research. Found the playback settings and changed the playback profile to slim. Great improvement, but not there yet. Tried Xvmc. Better still, but still maxing out the CPU and causing visual issues.


So research all available optimizations of mythtv Frontends. Came across a site that suggested that you trash all the extras and install minimal Ubuntu. First, I tried not even installing gnome, only a basic window manager. Tried to get that working, but decided my technical knowledge was not enough for that (it decided for me, but that's besides the point). So exploring the menus found that it lets you install mythbuntu right from there. By this point, I was pretty tired of all this, so I went straight to installing the mythbuntu frontend option. Installed the latest drivers, kept everything else as minimal as possible.


By some miracle, the minimal mythbuntu Frontend install actually performs better than the mythbuntu install! xorg only takes up about 10% CPU now and mythFrontEnd takes from 70-80% So its barely working, but its working!


A major contributing factor may have been that I replaced the TV antenna also. We found that bad reception was very bad for the computer CPU usage :) So bought a better TV antenna and with the minimal install, its working great. Probably wasted a bunch of time with that, but I learned about the minimal install ISO and how it lets you install grub2 from there, so that's good.

  10.04 LTS Update: This box has worked just fine starting with mythbuntu 9.10.  No need to do minimal installs anymore.  I just pop in the CD and use the slim playback setting and it works fine.  


The kids shows alone are taking about 40+G transcoded, so when the TV season starts, the adult shows are going to stretch our 80G limit. Therefore, we bought a 1TB hard drive. Could probably get away with less, but you would only save like $20.



Technical Stuff:


  Hard Drive Partitioning:   
    /       :ext4:  70G  (overkill - but all updates take up disk space)
    /liveTV :xfs: 80G  (we are using usually 1 TV and LiveTV takes approx 40G after a night of watching.  So 2 TVs might take up 80G)
    /video  :xfs: 920G (make sure to keep LiveTV and media in separate partitions. If they are on the same partition, you never 
              really know how much free space you have because LiveTV auto-expires.  So you could have 3G one day, then 30G the next)
    /var    : ext4: 1G
    NOTE:  video = recordings, movies, music, etc.  If you have lots of movies or music, you may want another partition for those


  Optimizing:
  - Backend:
    - In mythbuntu control center, go to advanced, and turn on the mythweb tweak option
    - Same menu, pick the automatic database optimization


  - Frontends:
    - Go to Setup-TV-> Program Guide and turn off channel icon and genre text.  This is useless and seems to improve program 
      guide performance
    - Play around with the Playback profiles in Setup->TV->Playback.  I use Slim for my Dell and I made a new one called Xvmc for 
      the HP.  Will post details.
    - Install latest video drivers.
    - 10.04 LTS NOTE:  The "Nvidia Current" version in ubuntu works fine, so no need to download and compile yourself until ubuntu gets
      outdated.
    - I set up all the transcodes and commflag processes to be run during the night.  By default they run right after the program is over.
      Since these processes can take up a lot of CPU, that was not good.
    


   Movie Storing:
  - I tried using the MythTV movie archiving program, but I must be below the intelligence threshold for it, because I failed.  I found
    it easier to find a good mencoder command off the internet and use that on the command line.  Here is the process I follow:
    - Start up mythfrontend and go to DVD ripping area.  It is pretty good at finding the correct title track
    - enter the following command:
          mencoder dvd://1 -dvd-device /media/cdrom0 -ovc xvid -xvidencopts pass=1 -alang en -oac mp3lame -o dvd.avi
    - Where dvd://1 :  1 = title number of main movie gotten from mythFrontEnd step.
    Yes, thats complicated, one of these days I will figure out how to use the mythfrontend ripping system.


   NFS
   - Backend:
      - /etc/fstab: 
          /dev/sdb1   /liveTV  xfs    defaults,noatime,nodiratime,logbufs=8,allocsize=512m     0     0
          /dev/sdb2   /video  xfs    defaults,noatime,nodiratime,logbufs=8,allocsize=512m     0     0
      - /etc/export:
          /liveTV    *(rw,async,no_root_squash,no_subtree_check)
          /video    *(rw,async,no_root_squash,no_subtree_check)
      - /etc/hosts.allow:
        ALL : 192.168.1. : allow
   - Frontends:
      - fstab:
          192.168.1.101:/liveTV /liveTV nfs rsize=8192,wsize=8192,intr
          192.168.1.101:/video /video nfs rsize=8192,wsize=8192,intr 


  Xvmc
   All I had to do here is put this in the /etx/X11/xorg.conf file:
   Section "Device"
      Identifier     "Device0"
      Driver         "nvidia"
      VendorName     "NVIDIA Corporation"
      Option         "UseEvents"   "True"                 
  EndSection


  Xvmc Playback Profile
   Create a new Playback Profile and use the following settings:
     - All resolutions
     - Decoder: Standard Xvmc
     - OSD: chrom...
     - Primary Deinterlacer: Box (2x)
     - Fallback: One Field
   
  General Tweaking of settings
   - Frontend - Turned on auto commercial skipping - then auto-rewind for 7 seconds after skip
   - Frontend - Record 90 seconds before and after scheduled recording


  Transcoding Options
   - Autodetect from MPEG2  (this is minimum bitrate, but good enough for low quality TV sets)
      - Codec: Mpeg-4
      - Bitrate: 1500
      - Max quality: 2
      - Min Quality: 15
      - Max difference: 3
      - Audio Codec: MP3
      - Sampling Rate: 32000
      - MP3 Quality: 7
      - Volume: 92
   - High Quality
      - Same but Video Bitrate: 2200
   - Medium Quality
      - Same but Video Bitrate: 1800


  Ubuntu Minimal CD stuff
  - The good:
    - At least on my backend, the normal mythbuntu CD has bad graphics.  The only way to install on my backend is the minimal install.
    - Helps you install just the bare minimum of what you need (although by the time you are done, you have all the junk anyway)
  - Process:
    - Download ISO from https://help.ubuntu.com/community/Installation/MinimalCD
    - Use a program to either burn the iso to a CD or a usb thumb drive (think I used a program called usb-creator)
    - Plug into computer, start it up.  At the boot> prompt, you can type in one of two things:
      - cli  :  This is the default menus.  Still requires above newbie knowledge, but its decent.
      - cli-expert : I am no expert, but I found that this provided the freedom of options that I wanted.
    - The first time I ran this, one of the menus allowed me to pick what flavor of ubuntu to install.  This list even included
      mythbuntu frontend.  However, the second time I tried this, it never gave me that menu.  No clue why, but I did not feel
      like spending the time to figure it out.  Just hope that you get that menu, I think it was in the "Select and Install
      Software" portion.  If you do not get that menu, here is what to do:  (based one website: 
      http://www.psychocats.net/ubuntu/minimal )
      
  Remote Mapping:

This process was a mess in 10.10. What happened seems that the Linux Input Layer suddenly decided after all this time that it likes my remote as a keyboard. While this would be fine with me, its not cool when it doesnt recognize all of your buttons and there is no way of altering its behavior!

Based on a few websites: here is the general procedure:

  - Get HAL to ignore the remote
  - Install LIRC to take over
  - Configure LIRC.
  
  • NOTE:* Since LIRC is still subject to the Linux Input Layer, the normal streamzap button mappings no longer worked. Instead I had to use the devinput button mapping codes.

Here are the websites I used:

- http://www.lirc.org/html/devinput.html
- /etc/lirc/hardware.conf (important stuff)
  - The Device Address I think could be /dev/input/irremote, but instead I got the actual address from:
    /proc/bus/input/devices
   *Note: The address will no longer work if you change USB ports
- Streamzap lircrc and lircd.conf
#Chosen Remote Control
REMOTE="Streamzap_PC_Remote"
REMOTE_MODULES=""
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="phys=usb-0000:00:13.0-1/input0"
REMOTE_LIRCD_CONF="/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap"
REMOTE_LIRCD_ARGS=""

- /etc/lird.conf

include "/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap"

- /etc/udev/rules.d/60-symlinks.rules

KERNEL=="event*",ATTRS{name}=="Streamzap*",SYMLINK+="input/irremote"

- /usr/share/hal/fdi/preprobe/20thirdparty/lirc.fdi

  - To make sure this works, type:  lshal
  - Look for the entry for the IR and make sure that it has something that says it is ignored.
    
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
     <match key="info.product" contains_ncase="Streamzap Remote Control">
        <merge key="info.ignore" type="bool">true</merge>
     </match>
  </device>
</deviceinfo>


Conclusion:


So I figure if you start with absolutely nothing and want a mythtv system for 2 TVs, you are probably looking at about a $1100 price tag. This includes a backend, two frontends, network infrastructure, antenna, cables, etc. Adding additional TVs will cost about $300 per TV (computer, network, cables).

How do you figure out if its the right decision for you? Here are a few factors:

  - Movie junkies and parents of kids will LOVE the fact they can just choose a movie and watch without worrying about looking 
    for and scratching the DVDs.
  - MythTV is a fully functioning DVR and media center.  It is not as "clean" as a Tivo or DishDVR, but its "good enough"
  - If you have satellite or cable, just pay the extra $5/month for the DVR.  Setting up mythTV just for a media center is not cost
    efficient, but if you have the money for it, its awesome.
  - You will need to already have knowledge of, or be willing to learn about Linux to get this working at peak performance.  Mythbuntu 
    is a great start, but there is always something that will require command line intervention.  
  - There are media centers available for windows (sageTV), but you will need nicer computers than what I bought here because 
    windows+HDTV is not going to be happy.  MythTV is the nicer on the wallet.


Overall, for my family, it was worth it. Above all, the automatic commercial skipping is worth every minute and dime spent on the system. I figure all the money we save from having to buy the kids the new fancy thing they saw in a commercial should get added to the Mythtv "plus" side.

We are ditching our Dish Satellite and landline. In a year and a half, we will be saving about $60/month from going with mythTV. Yes its more work, but if you are or know a computer guy, this project can be a fun (sometimes maddening) one. If you are in doubt over your technical expertise, just compensate with better hardware. The majority of my issues came from buying previous generation equipment and expecting it to meet modern day demands.

--UPDATE: The key to mythtv is one you get it working, do not upgrade unless you really really want the new feature. Some upgrades are flawless, some result in hours of research and work to resolve. If you just want something that works, no questions asked, spend the extra money and get Tivo or something. Computer based solutions offer more freedom, but you pay for that freedom with time and sometimes stress.


Thank for reading, hope it helps!