Difference between revisions of "User:Keithamus"

From MythTV Official Wiki
Jump to: navigation, search
(Notes on getting Mythbuntu working properly)
(Separate out each todo item)
 
(16 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
{|
 
{|
 
|
 
|
* Hanspree 37" 720p HDTV (Native Res: 1366x768)
+
* Samsung UE46D8000 1080p LED TV (Native Res: 1920x1080)
* [[Zotac Ion]], Intel Atom 330 1.6ghz (dual), 9400GS
+
* Zotac Ion, Intel Atom 330 1.6ghz (dual), 9400GS
 
* M350 Universal Mini-Itx Case
 
* M350 Universal Mini-Itx Case
 
* 2048MB RAM
 
* 2048MB RAM
* Mythbuntu 9.10 booting off of the Server via LTSP
+
* Mythbuntu 10.04 booting off of the Server via LTSP
 
|
 
|
 
|}
 
|}
Line 17: Line 17:
 
|
 
|
 
* Benq 24" 1080p LCD (Native Res: 1920x1080)
 
* Benq 24" 1080p LCD (Native Res: 1920x1080)
* [[Zotac Ion]], Intel Atom 330 1.6ghz (dual), 9400GS
+
* Zotac Ion, Intel Atom 330 1.6ghz (dual), 9400GS
 
* M350 Universal Mini-Itx Case
 
* M350 Universal Mini-Itx Case
 
* 2048MB RAM
 
* 2048MB RAM
* Mythbuntu 9.10 booting off of the Server via LTSP
+
* Mythbuntu 10.04 booting off of the Server via LTSP
 
|
 
|
 
|}
 
|}
Line 28: Line 28:
 
|
 
|
 
* Antec Mini-P180 Case
 
* Antec Mini-P180 Case
* AMD Sempron LE-1250 2.2ghz (planning to underclock to 1.6ghz @ 0.9v)
+
* AMD Sempron LE-1250 2.2ghz (successfully under-clocked to 1ghz @ 0.9v)  
 
* Gigabyte GA-MA74GM-S2H 740G mobo
 
* Gigabyte GA-MA74GM-S2H 740G mobo
 
* 2048MB RAM
 
* 2048MB RAM
Line 37: Line 37:
 
|}
 
|}
  
====Why I chose this system====
+
==Why I chose this system==
======Frontends======
+
====Frontends====
 
* The whole setup was good value for money (considering it is a 5tb fileserver/backend with two frontends + TVs), around £1000 (which is US$1600 (xe.com) at the time of writing).
 
* The whole setup was good value for money (considering it is a 5tb fileserver/backend with two frontends + TVs), around £1000 (which is US$1600 (xe.com) at the time of writing).
 
* The Zotac Ions are fantastic boards. They handle everything nicely, including 1080p content (with VDPAU enabled)
 
* The Zotac Ions are fantastic boards. They handle everything nicely, including 1080p content (with VDPAU enabled)
Line 44: Line 44:
 
* The M350 cases are tiny! They can be hidden in corners and crevices very nicely. They also have 2 hidden front usb ports, ideal for bluetooth, usb storage, or other dongles which don't need to see the light of day.
 
* The M350 cases are tiny! They can be hidden in corners and crevices very nicely. They also have 2 hidden front usb ports, ideal for bluetooth, usb storage, or other dongles which don't need to see the light of day.
 
* I have both Zotac machines completely hidden from view, one behind a door frame and one strapped to the back of the benq monitor.
 
* I have both Zotac machines completely hidden from view, one behind a door frame and one strapped to the back of the benq monitor.
* I chose the Benq for the 1080p, and that it is much cheaper than a 1080p HDTV. The Hanspree is a throwback from the old setup.
+
* I chose the Benq for the 1080p, and that it is much cheaper than a 1080p HDTV.
  
======Backend======
+
====Backend====
 
* Its 5tb in raid5...
 
* Its 5tb in raid5...
 
* The case was by far the most expensive component, but it almost perfectly suits the 5 1.5tb HDDs that it houses.
 
* The case was by far the most expensive component, but it almost perfectly suits the 5 1.5tb HDDs that it houses.
Line 66: Line 66:
 
* The 1.6ghz dual core processor in the Zotac Ions can be a bit slow at times. It is really painful to watch the "prescaling images" bar when you change theme/first open mythtv.
 
* The 1.6ghz dual core processor in the Zotac Ions can be a bit slow at times. It is really painful to watch the "prescaling images" bar when you change theme/first open mythtv.
  
===Wireless Fix===
+
==How I built the disk-less server==
If you are experiencing spotty wireless, whereby the wireless seems to stop working, although still says it is connected, then after 10 minutes of a lack of connection it suddenly springs to life. Well, you have crappy-wireless-driver syndrome. Just follow this command on Ubuntu:
+
This documentation is here so I will hopefully never forget it, and so I can repeat the steps in case of disaster.
  
<code>
+
===Setting up PXE/LTSP===
sudo apt-get install linux-backports-modules-jaunty-generic
+
First things first, on the server, install the appropriate packages:
</code>
 
  
Restart and you're golden
+
<pre>sudo apt-get update && sudo apt-get install dhcp3-server ltsp-server tftpd-hpa nbd-server nfs-kernel-server</pre>
  
==Old Setup==
+
The dhcp3 server will serve DHCP (Dynamic Host Configuration Protocol) IP addresses to all connected clients, so you need to take down your routers DHCP. The LTSP (Linux Terminal Server Project)package gives you scripts to create & serve LTSP images (for diskless clients with persistent storage). TFTPD (Trivial File Transfer Protocol Daemon) will give DHCP clients the ability to download the initrd and vmlinuz kernel files, and finally the NBD (Network Block Device) Server gives LTSP a port to connect to download the SquashFS images. Once these are installed, the following needs doing:
This is my old setup, left here for education/nostalgia.
 
  
=== Pundit-pvr ===
+
<pre>sudo nano /etc/dhcp3/dhcpd.conf</pre>
[[Image:Asus_Pundit.jpg|thumb|100px|right|frame|The Asus Pundit P1 in White]]
+
 
{|
+
Here is my dhcpd.conf:
|
+
 
* [[Asus Pundit]] P3-PH5X
+
<pre>
* Intel Core 2 Duo E2160 1.8ghz - Stock cooler
+
default-lease-time              600;
* 2048MB RAM
+
max-lease-time                  1440;
* 500GB Samsung Spinpoint drive
+
ddns-update-style ad-hoc;
* [[Hauppauge WinTV Nova-T 500 PCI]] dual DVB-T tuner
+
authoritative;
* <strike>ATi Radeon HD 3450 256mb Low Profile Passive PCIE</strike> XFX nVidia 8300GS 256mb Low Profile PCIE (I strongly advise anyone to avoid ATi, they are nightmarish)
+
 
* <strike>Mythbuntu 8.04</strike> Mythbuntu 9.04
+
subnet 192.168.0.0 netmask 255.255.255.0 {
|
 
|}
 
  
====Why I chose this system====
+
        range 192.168.0.110 192.168.0.199;
* The whole system was very cheap, around £200 ($400).
+
        filename "pxelinux.0";
* It has quite a small footprint, although much bigger than a set-top-box, it is no way as big as a desktop case.
 
* It looks quite stylish, which is always good for the [[WAF]]
 
* It'll run HD content.
 
* I chose the cheapest Core2Duo I could find. Any Core2Duo PC should be able to run atleast 720p content. Although dedicated HD graphics is recommended.
 
  
====Problems====
+
        option routers                  192.168.0.1;
* The Pundit P3 is a low profile system, as such, you'll need low profile cards. The Nova T 500 is '''not''' a low profile card, so you'll have to remove the PCI plate, and have the card lose in the slot (this is not desirable, as the card can easily become de-seated!) support@hauppauge.com will send you out at blanking plate, don't expect any correspondance, I tried several times asking about it, then finally just emailed my address over in the hopes of getting it, and 2 days later a blanking plate was in the post!
+
        option subnet-mask              255.255.255.0;
* The system isn't as quiet as I'd like - the stock cooler is quite whiny, and the stock case fan (attached with only 1 screw!) is very loud. Getting a good Scythe fan or two would definitely be recommended. With stock cooling the air runs cold - so you could probably get away with a small heatsink over the CPU and a good, quiet case fan.
+
        option broadcast-address        192.168.0.255;
* Still having slight problems with Mythbuntu. Overall I would say the system is worth it, but has its annoyances.
+
        option netbios-name-servers    192.168.0.101;
 +
        option netbios-node-type        2;
 +
        option domain-name-servers      208.67.222.222,208.67.220.220;
 +
        use-host-decl-names on;
  
====Real world figures====
+
        host ...your reserved IP leases go like this. one host for each.. well host... {
In terms of crunching power, wattage and temperatures, this system really can't be complained about;
+
                hardware ethernet 00:12:34:AB:CD:EF;
* I've been able to record 2 channels and watch HD-720p content with NO lag. Even with integrated graphics.
+
                fixed-address 192.168.0.102;
* 500GB is a hefty size for storing data. It'll easily store more content than you're likely to watch. Having said this, I'm beggining to run out of space, and 1TB is about £70, so cheap enough for consideration!
+
        }
* 1024mb seems to be enough. I would consider upgrading this if you have a bit more spare cash.
 
* Because its a relatively "slow" core 2 duo, its cold to the touch - with the stock cooler, but more than capable of running 720p
 
  
=OLD notes on MythBuntu tweaks=
+
        host ...your reserved DISKLESS hosts go like this, with the host-name option added... {
 +
                hardware ethernet 00:12:34:AB:CD:EF;
 +
                fixed-address 192.168.0.103;
 +
                option host-name "myth1";
 +
        }
 +
</pre>
  
==Hard Drive optimisation==
+
The "pxelinux.0" file comes from the root dir of TFTPD. So lets edit TFTPD to point to a sensible place.
A good partition setup is as follows:
 
# 20gb / ext3
 
# 1GB SWAP (make this the same as the installed memory for easy sleep/hibernation)
 
# Rest as /var/lib/ xfs
 
  
I would recommend setting the noatime and nodiratime options to your drives, for less intensive harddisk access. To do this, go to your /etc/fstab which may look like this, for example:
+
<pre>sudo nano /etc/default/tftpd-hpa</pre>
  
 
<pre>
 
<pre>
# /dev/sda1
+
#Defaults for tftpd-hpa
UUID=6e039164-c59f-49f1-9b96-e658a24aac2d /              ext3    errors=remount-ro 0      1
+
RUN_DAEMON="yes"
# /dev/sda3
+
# All the v's are for "verbose", the more vs the more verbose.
UUID=d8af15ba-f63e-465d-848e-9c8d3d020e4a /var/lib        xfs    relatime        0      2
+
OPTIONS="-l -s -vvvvvvvv /raid/pxe/"
# /dev/sda2
 
UUID=07a339be-0944-4a04-a71a-9b1e173cbb6e none            swap    sw              0      0
 
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0
 
 
</pre>
 
</pre>
  
Change this file to look more like this:
+
I chose /raid/pxe/ because my RAID device is mounted at /raid/. Choose a sensible directory for you. And make it before you start the server:
 +
 
 +
<pre>sudo mkdir -p /raid/pxe/</pre>
 +
 
 +
We're also going to do a few softlinks so we later don't have to move stuff. Everything will be in our raid folder:
 +
 
 +
<pre>sudo mkdir -p /raid/diskless/ /raid/pxe/ltsp/ /raid/pxe/pxelinux.cfg
 +
sudo ln -s /var/cache/mythbuntu-diskless/overlay /raid/diskless
 +
sudo ln -s /opt/ltsp /raid/pxe/ltsp</pre>
 +
 
 +
Now lets make an LTSP image:
 +
 
 +
<pre>sudo ltsp-build-client --mythbuntu --mythbuntu-user-credentials USERNAME:PASSWORD --chroot mythbuntu-karmic-`date +%Y%m%d`</pre>
 +
 
 +
This will start building a mythbuntu base install client. Leave it for a few hours and come back to find your "mythbuntu-karmic-TODAYSDATE" image installed! The build-client script also automatically manages NBD, so there isnt much to do there. But look out for the "port number" as stated toward the end of the script.
 +
 
 +
Next we'll make a pxelinux.cfg file for the mac addresses of our clients. So my client is 00-12-34-AB-CD-EF. So I'll do this:
 +
 
 +
<pre>sudo nano /raid/pxe/pxelinux.cfg/01-00-12-34-AB-CD-EF</pre>
 +
 
 +
Pay special attention to the "01-" at the beginning. In this file will be:
 +
 
 +
<pre>DEFAULT mythbuntu
 +
 
 +
LABEL mythbuntu
 +
        KERNEL ltsp/mythbuntu-karmic-20091205/vmlinuz nbdport=2001
 +
        APPEND rw root=/dev/ram0 initrd=ltsp/mythbuntu-karmic-20091205/initrd.img nbdport=2001 hostnameoverride=HOSTNAME ipv6.disable=1</pre>
 +
 
 +
Note because we put the "ltsp" dir in /raid/pxe/, we've made our lives alot easier inside the pxelinux scripts :D.
 +
 
 +
One last thing to do:
 +
 
 +
<pre>sudo nano /etc/exports</pre>
 +
 
 +
<pre>/raid/pxe/ 192.168.0.0/24(sync,ro,no_subtree_check)
 +
/raid/diskless/ 192.168.0.0/24(rw,no_root_squash,async,no_subtree_check)</pre>
 +
 
 +
Just shove the whole pxe dir into the whole subnet on NFS, not the most secure way of doing things but saves alot of fiddling around and hours of confusion as to why a particular directory isn't loading. Same goes for the diskless overlay dir, but make it rewritable otherwise our clients wont have persistent storage!
 +
 
 +
Finally, we'll restart the server, and test out our image. Working ok? Great. Lets customize it!!
 +
 
 +
<pre>sudo mount -o bind /proc /raid/pxe/ltsp/mythbuntu-karmic-TODAYSDATE/proc/
 +
sudo chroot /raid/pxe/ltsp/mythbuntu-karmic-TODAYSDATE</pre>
 +
 
 +
We're now Chrooted into our LTSP image. Any work done on this will effect the image and not your server, and it will mean re-updating the image file. To reupdate we do this:
 +
 
 +
<pre>sudo ltsp-update-image -a mythbuntu-karmic-`date +%Y%m%d`</pre>
 +
 
 +
It is very, VERY recommended that whenever you make a change to your image, make a snapshot of it incase you mess anything up:
  
<pre>
+
<pre>sudo cp /raid/pxe/ltsp/mythbuntu-karmic-NEWESTDATE/ /raid/pxe/ltsp/mythbuntu-karmic-`date +%Y%m%d`
# /dev/sda1
+
sudo mount -o bind /proc /raid/pxe/ltsp/mythbuntu-karmic-`date +%Y%m%d`/proc/
UUID=6e039164-c59f-49f1-9b96-e658a24aac2d /               ext3    noatime,errors=remount-ro 0      1
+
sudo chroot /raid/pxe/ltsp/mythbuntu-karmic-`date +%Y%m%d`
# /dev/sda3
+
#make your changes here
UUID=d8af15ba-f63e-465d-848e-9c8d3d020e4a /var/lib        xfs    noatime,nodiratime,logbufs=8        0      2
+
sudo ltsp-update-image -a mythbuntu-karmic-`date +%Y%m%d`
# /dev/sda2
+
sudo nano /raid/pxe/pxelinux.cfg/01-00-12-34-AB-CD-EF
UUID=07a339be-0944-4a04-a71a-9b1e173cbb6e none            swap    sw              0      0
+
#change the name of the old PXE details over to the new ones.</pre>
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0
 
  
</pre>
+
===Stuff to install on the Mythbuntu build===
 +
For my particular setup, I made the following changes to the default mythbuntu build:
  
==Fixing LIRC for Hauppauge remotes==
+
<pre># enable mythbuntu mythtv updates repository
Mythbuntu uses the incorrect lircrc for the Hauppauge remote, you should copy and paste the one from the [[Hauppauge WinTV Nova-T 500 PCI]] page. Save this as ~/.lircrc and make links from this to ~/.mythtv/lircrc and ~/.lircrc/mythtv
+
wget http://www.mythbuntu.org/files/mythbuntu-repos.deb && dpkg -i mythbuntu-repos.deb</pre>
  
Another annoying problem stems from the "events" on the system. These don't stay put, so on one boot you'll have your receiver on event6, the next, it'll be event3. Obviously Lirc can't magically detect this for you, but luckily, other system processes can.
+
<pre>#update os
 +
apt-get update && apt-get upgrade</pre>
  
First you want to find the event the receiver is currently running on:
+
<pre># install essentials + extras
<pre>cat /proc/bus/input/devices | grep -iA4 receiver</pre>
+
apt-get install lirc openssh-server mythtv-themes* mythbuntu-apple-trailers mythplugins nano bash-completion flashplugin-installer gstreamer0.10-plugins-good gstreamer0.10-plugins-bad nfs-common openssh-server vlc wget nvidia-common nvidia-current</pre>
  
Now, run the following command:
+
<pre># make sure nonfree drivers are loaded
<pre>udevinfo -a -p $(udevinfo -q path -n /dev/input/[OUTPUT_FROM_ABOVE_COMMAND]) | grep -i vendor</pre>
+
echo -e "\nblacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist.conf</pre>
  
Hopefully you'll get one line saying "SYSFS{vendor}="0x99999" or something to that effect, if you get more than one, then usually its the first you need. Now, using your favourite editor, open /etc/udev/rules.d/10-local.rules:
+
<pre># autostart mythtv
<pre>sudo mousepad /etc/udev/rules.d/10-local.rules</pre>
+
mkdir -p /home/<USER>/.config/autostart/
 +
ln -s /usr/share/applications/mythtv.desktop /home/<USER>/.config/autostart/mythtv.deskop</pre>
  
Add the following line:
+
<pre># autologin mythbuntu
<pre>KERNEL=="event*",SYSFS{vendor}=="0x99999",SYMLINK="lirc0"</pre>
+
nano /etc/gdm/custom.conf</pre>
  
Obviously this is bit you replace 0x99999 with the code you received from one of the above commands. Once this is done, restart the udev server:
+
<pre># /etc/gdm/custom.conf
<pre>/etc/init.d/udev restart</pre>
+
[daemon]
 +
DefaultSession=mythbuntu
 +
TimedLoginEnable=false
 +
AutomaticLoginEnable=true
 +
TimedLogin=<USER>
 +
AutomaticLogin=<USER>
 +
TimedLoginDelay=0
 +
</pre>
  
And voilas. To test, you can  check the listing of lirc0;
+
<pre>nano /etc/lirc/hardware.conf</pre>
<pre>ls -la /dev/lirc*</pre>
 
It should output "lirc0 --> event6" or whatever your receivers eventid is.
 
  
===For reference: /etc/lirc/hardware.conf===
+
<pre># /etc/lirc/hardware.conf
<pre>
+
REMOTE="Cyberlink Remove Control"
# /etc/lirc/hardware.conf
+
REMOTE_MODULES="lirc_dev"
#
 
REMOTE="Hauppauge TV Card"
 
REMOTE_DEVICE="/dev/lirc0"
 
 
REMOTE_DRIVER="devinput"
 
REMOTE_DRIVER="devinput"
REMOTE_MODULES="lirc_dev lirc_i2c"
+
REMOTE_DEVICE="/dev/input/by-path/pci-0000:00:04.0-usb-0:6:1.1-event-mouse"
 +
REMOTE_SOCKET=""
 
REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf"
 
REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf"
 
REMOTE_LIRCD_ARGS=""
 
REMOTE_LIRCD_ARGS=""
 
 
START_LIRCD="true"
 
START_LIRCD="true"
 
LOAD_MODULES="true"
 
LOAD_MODULES="true"
</pre>
+
LIRCMD_CONF=""
 +
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
 +
START_LIRCMD=""</pre>
 +
 
 +
<pre>nano /etc/lirc/lircd.conf</pre>
 +
 
 +
<pre>begin remote
 +
 
 +
        name cyberlink
 +
        bits 32
 +
        eps 30
 +
        aeps 100
 +
 
 +
        one 0 0
 +
        zero 0 0
 +
        gap 135995
 +
        toggle_bit_mask 0x0
 +
 
 +
                begin codes
 +
#NoGap
 +
                        Home            0x80010066
 +
                        DVD            0x8001018E
 +
                        Music          0x8001018F
 +
                        Pictures        0x80010190
 +
                        Videos          0x80010191
 +
                        Radio          0x80010181
 +
                        LiveTV          0x80010179
 +
#NoGap
 +
                        SAP            0x80010188
 +
                        Teletext        0x80010184
 +
                        LastCH          0x8001016B
 +
                        Subtitle        0x80010172
 +
                        Language        0x80010170
 +
                        Aspect          0x80010173
 +
                        Back            0x8001009E
 +
                        Guide          0x80010082
 +
                        Menu            0x8001008B
 +
#NoGap
 +
                        VolUp          0x80010073
 +
                        VolDown        0x80010072
 +
                        Mute            0x80010071
 +
                        ChanUp          0x80010192
 +
                        ChanDown        0x80010193
 +
#NoGap
 +
                        Pause          0x80010077
 +
                        Record          0x800100A7
 +
                        Play            0x800100CF
 +
                        Rewind          0x800100A8
 +
                        Forward        0x800100D0
 +
                        SkipFoward      0x800100A3
 +
                        SkipBack        0x800100A5
 +
#NoGap
 +
                end codes
 +
 
 +
end remote</pre>
 +
 
 +
<pre>nano /etc/lirc/mythtv.conf</pre>
 +
 
 +
<pre># LIRCRC Created by Keithamus
 +
# Author: Keithamus
 +
# Created for use with LIRCRC, completely free for any use whatsoever.
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Home
 +
        config = ALT+H
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = DVD
 +
        config = ALT+D
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Music
 +
        config = ALT+M
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Pictures
 +
        config = ALT+P
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Videos
 +
        config = ALT+V
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Radio
 +
        config = ALT+R
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = LiveTV
 +
        config = ALT+T
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = SAP
 +
        config = F8
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Teletext
 +
        config = F2
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = LastCH
 +
        config = H
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Subtitle
 +
        config = T
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Language
 +
        config = +
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Aspect
 +
        config = W
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Back
 +
        config = Esc
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Guide
 +
        config = I
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Menu
 +
        config = M
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = VolUp
 +
        config = F11
 +
        repeat = 1
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = VolDown
 +
        config = F10
 +
        repeat = 1
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Mute
 +
        config = F9
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = ChanUp
 +
        config = Up
 +
        repeat = 0
 +
        delay = 0
 +
end
 +
 
 +
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = ChanDown
 +
        config = Down
 +
        repeat = 0
 +
        delay = 0
 +
end
  
==Recommended extra packages==
+
begin
If using wireless, install WICD!, this will enable mythbuntu to silently connect to your wireless network, without nagging you for keyrings, or d/cing after a sleep. To do this; add
+
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Pause
 +
        config = P
 +
        repeat = 0
 +
        delay = 0
 +
end
  
<pre>#WICD, Wireless network manager
+
begin
deb http://apt.wicd.net hardy extras</pre>
+
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Record
 +
        config = R
 +
        repeat = 0
 +
        delay = 0
 +
end
  
to your /etc/apt/sources.list file. From this point, just run "sudo apt-get install wicd" and you should be good to go; you might need to add /opt/wicd/tray.py to your startup programs, to get a tray icon.
+
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Play
 +
        config = Enter
 +
        repeat = 0
 +
        delay = 0
 +
end
  
Also perhaps add wine, depending on how you use the machine, I personally run some windows games I own, so wine is helpful:
+
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = Rewind
 +
        config = <
 +
        repeat = 0
 +
        delay = 0
 +
end
  
<pre># Wine
+
begin
deb http://wine.budgetdedicated.com/apt gutsy main
+
        remote = cyberlink
deb-src http://wine.budgetdedicated.com/apt gutsy main</pre>
+
        prog = mythtv
 +
        button = Forward
 +
        config = >
 +
        repeat = 0
 +
        delay = 0
 +
end
  
Then apt-get install wine!
+
begin
 +
        remote = cyberlink
 +
        prog = mythtv
 +
        button = SkipForward
 +
        config = PgDown
 +
        repeat = 0
 +
        delay = 0
 +
end
  
==Mysql Crashing==
+
begin
It would be a good idea to get mythbuntu to repair the tables on reboot. Having to manually repair the tables when the box crashes is annoying, so why not automate. Add this to your system startup, whichever way you prefer:
+
        remote = cyberlink
 +
        prog = mythtv
 +
        button = SkipBack
 +
        config = PgUp
 +
        repeat = 0
 +
        delay = 0
 +
end</pre>
  
<pre>mysqlcheck -umythtv -pPASSWORD --auto-repair mythconverg</pre>
+
<pre>mkdir /home/myth/.lirc/ && ln -s /etc/hardware/mythtv.conf /home/myth/.lirc/mythtv</pre>
  
[[Category:User_Systems]]
+
[[Category:LIRC_Configuration_Files]]
 +
[[Category:MythPeople]]

Latest revision as of 00:36, 23 January 2012

Current Setup

I currently have one backend with 2 Zotac Ion frontends.

Frontend 1

  • Samsung UE46D8000 1080p LED TV (Native Res: 1920x1080)
  • Zotac Ion, Intel Atom 330 1.6ghz (dual), 9400GS
  • M350 Universal Mini-Itx Case
  • 2048MB RAM
  • Mythbuntu 10.04 booting off of the Server via LTSP

Frontend 2

  • Benq 24" 1080p LCD (Native Res: 1920x1080)
  • Zotac Ion, Intel Atom 330 1.6ghz (dual), 9400GS
  • M350 Universal Mini-Itx Case
  • 2048MB RAM
  • Mythbuntu 10.04 booting off of the Server via LTSP

Backend

  • Antec Mini-P180 Case
  • AMD Sempron LE-1250 2.2ghz (successfully under-clocked to 1ghz @ 0.9v)
  • Gigabyte GA-MA74GM-S2H 740G mobo
  • 2048MB RAM
  • 250gb HDD for OS
  • 5 x Samsung F2 1.5TB in RAID 5 (totalling 6000GB or 5.8TB)
  • Hauppauge WinTV Nova-T 500 PCI dual DVB-T tuner

Why I chose this system

Frontends

  • The whole setup was good value for money (considering it is a 5tb fileserver/backend with two frontends + TVs), around £1000 (which is US$1600 (xe.com) at the time of writing).
  • The Zotac Ions are fantastic boards. They handle everything nicely, including 1080p content (with VDPAU enabled)
  • The Zotac boards are supposed to take around 21w of power under full load.
  • The M350 cases are tiny! They can be hidden in corners and crevices very nicely. They also have 2 hidden front usb ports, ideal for bluetooth, usb storage, or other dongles which don't need to see the light of day.
  • I have both Zotac machines completely hidden from view, one behind a door frame and one strapped to the back of the benq monitor.
  • I chose the Benq for the 1080p, and that it is much cheaper than a 1080p HDTV.

Backend

  • Its 5tb in raid5...
  • The case was by far the most expensive component, but it almost perfectly suits the 5 1.5tb HDDs that it houses.
  • The server is really surprisingly quiet, and runs very cool.
  • According to my calculations as well as other peoples reviews, this will use about 60w under full load, when underclocked. Not bad for a 5tb server backend.
  • Its 5tb in raid5...

Problems

  • Forget about putting anything inside the M350 cases except for a mobo, an hdd or two and some ram. These tiny cases have no room inside them, but then again, theres nothing else you need in them!
  • The wireless is utter crap. Read the fix down the page. Even when it is fixed, watching live tv with it is a bit poor - I have a Wireless N switch with Gig eth and when I browse the internet on my laptop, it'll slow the tv down.
  • Disk-less is a wild beast. Minor changes to the base system mean running ltsp-update-image which takes about half an hour to finish.
  • The servers network card is pretty crap, I recommend replacing them with Intel Pro cards.

Real world figures

In terms of crunching power, wattage and temperatures, this system really can't be complained about;

  • Zotac Ions play 1080p fine with VDPAU. No issues. No questions asked. It Just Works (TM).
  • I said on the notes to my old setup that 500gb is more media than one can watch. That was a bit of a Bill Gates moment. I stand corrected, 6tb might be enough though (I hope!)
  • 2GB is so damn cheap and it runs these systems fine, any more would be overkill. I would say 2GB is overkill but at about £20 for a matched pair noone is complaining.
  • The 1.6ghz dual core processor in the Zotac Ions can be a bit slow at times. It is really painful to watch the "prescaling images" bar when you change theme/first open mythtv.

How I built the disk-less server

This documentation is here so I will hopefully never forget it, and so I can repeat the steps in case of disaster.

Setting up PXE/LTSP

First things first, on the server, install the appropriate packages:

sudo apt-get update && sudo apt-get install dhcp3-server ltsp-server tftpd-hpa nbd-server nfs-kernel-server

The dhcp3 server will serve DHCP (Dynamic Host Configuration Protocol) IP addresses to all connected clients, so you need to take down your routers DHCP. The LTSP (Linux Terminal Server Project)package gives you scripts to create & serve LTSP images (for diskless clients with persistent storage). TFTPD (Trivial File Transfer Protocol Daemon) will give DHCP clients the ability to download the initrd and vmlinuz kernel files, and finally the NBD (Network Block Device) Server gives LTSP a port to connect to download the SquashFS images. Once these are installed, the following needs doing:

sudo nano /etc/dhcp3/dhcpd.conf

Here is my dhcpd.conf:

default-lease-time              600;
max-lease-time                  1440;
ddns-update-style ad-hoc;
authoritative;

subnet 192.168.0.0 netmask 255.255.255.0 {

        range 192.168.0.110 192.168.0.199;
        filename "pxelinux.0";

        option routers                  192.168.0.1;
        option subnet-mask              255.255.255.0;
        option broadcast-address        192.168.0.255;
        option netbios-name-servers     192.168.0.101;
        option netbios-node-type        2;
        option domain-name-servers      208.67.222.222,208.67.220.220;
        use-host-decl-names on;

        host ...your reserved IP leases go like this. one host for each.. well host... {
                hardware ethernet 00:12:34:AB:CD:EF;
                fixed-address 192.168.0.102;
        }

        host ...your reserved DISKLESS hosts go like this, with the host-name option added... {
                hardware ethernet 00:12:34:AB:CD:EF;
                fixed-address 192.168.0.103;
                option host-name "myth1";
        }

The "pxelinux.0" file comes from the root dir of TFTPD. So lets edit TFTPD to point to a sensible place.

sudo nano /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
# All the v's are for "verbose", the more vs the more verbose.
OPTIONS="-l -s -vvvvvvvv /raid/pxe/"

I chose /raid/pxe/ because my RAID device is mounted at /raid/. Choose a sensible directory for you. And make it before you start the server:

sudo mkdir -p /raid/pxe/

We're also going to do a few softlinks so we later don't have to move stuff. Everything will be in our raid folder:

sudo mkdir -p /raid/diskless/ /raid/pxe/ltsp/ /raid/pxe/pxelinux.cfg
sudo ln -s /var/cache/mythbuntu-diskless/overlay /raid/diskless
sudo ln -s /opt/ltsp /raid/pxe/ltsp

Now lets make an LTSP image:

sudo ltsp-build-client --mythbuntu --mythbuntu-user-credentials USERNAME:PASSWORD --chroot mythbuntu-karmic-`date +%Y%m%d`

This will start building a mythbuntu base install client. Leave it for a few hours and come back to find your "mythbuntu-karmic-TODAYSDATE" image installed! The build-client script also automatically manages NBD, so there isnt much to do there. But look out for the "port number" as stated toward the end of the script.

Next we'll make a pxelinux.cfg file for the mac addresses of our clients. So my client is 00-12-34-AB-CD-EF. So I'll do this:

sudo nano /raid/pxe/pxelinux.cfg/01-00-12-34-AB-CD-EF

Pay special attention to the "01-" at the beginning. In this file will be:

DEFAULT mythbuntu

LABEL mythbuntu
        KERNEL ltsp/mythbuntu-karmic-20091205/vmlinuz nbdport=2001
        APPEND rw root=/dev/ram0 initrd=ltsp/mythbuntu-karmic-20091205/initrd.img nbdport=2001 hostnameoverride=HOSTNAME ipv6.disable=1

Note because we put the "ltsp" dir in /raid/pxe/, we've made our lives alot easier inside the pxelinux scripts :D.

One last thing to do:

sudo nano /etc/exports
/raid/pxe/ 192.168.0.0/24(sync,ro,no_subtree_check)
/raid/diskless/ 192.168.0.0/24(rw,no_root_squash,async,no_subtree_check)

Just shove the whole pxe dir into the whole subnet on NFS, not the most secure way of doing things but saves alot of fiddling around and hours of confusion as to why a particular directory isn't loading. Same goes for the diskless overlay dir, but make it rewritable otherwise our clients wont have persistent storage!

Finally, we'll restart the server, and test out our image. Working ok? Great. Lets customize it!!

sudo mount -o bind /proc /raid/pxe/ltsp/mythbuntu-karmic-TODAYSDATE/proc/
sudo chroot /raid/pxe/ltsp/mythbuntu-karmic-TODAYSDATE

We're now Chrooted into our LTSP image. Any work done on this will effect the image and not your server, and it will mean re-updating the image file. To reupdate we do this:

sudo ltsp-update-image -a mythbuntu-karmic-`date +%Y%m%d`

It is very, VERY recommended that whenever you make a change to your image, make a snapshot of it incase you mess anything up:

sudo cp /raid/pxe/ltsp/mythbuntu-karmic-NEWESTDATE/ /raid/pxe/ltsp/mythbuntu-karmic-`date +%Y%m%d`
sudo mount -o bind /proc /raid/pxe/ltsp/mythbuntu-karmic-`date +%Y%m%d`/proc/
sudo chroot /raid/pxe/ltsp/mythbuntu-karmic-`date +%Y%m%d`
#make your changes here
sudo ltsp-update-image -a mythbuntu-karmic-`date +%Y%m%d`
sudo nano /raid/pxe/pxelinux.cfg/01-00-12-34-AB-CD-EF
#change the name of the old PXE details over to the new ones.

Stuff to install on the Mythbuntu build

For my particular setup, I made the following changes to the default mythbuntu build:

# enable mythbuntu mythtv updates repository
wget http://www.mythbuntu.org/files/mythbuntu-repos.deb && dpkg -i mythbuntu-repos.deb
#update os
apt-get update && apt-get upgrade
# install essentials + extras
apt-get install lirc openssh-server mythtv-themes* mythbuntu-apple-trailers mythplugins nano bash-completion flashplugin-installer gstreamer0.10-plugins-good gstreamer0.10-plugins-bad nfs-common openssh-server vlc wget nvidia-common nvidia-current
# make sure nonfree drivers are loaded
echo -e "\nblacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist.conf
# autostart mythtv
mkdir -p /home/<USER>/.config/autostart/
ln -s /usr/share/applications/mythtv.desktop /home/<USER>/.config/autostart/mythtv.deskop
# autologin mythbuntu
nano /etc/gdm/custom.conf
# /etc/gdm/custom.conf
[daemon]
DefaultSession=mythbuntu
TimedLoginEnable=false
AutomaticLoginEnable=true
TimedLogin=<USER>
AutomaticLogin=<USER>
TimedLoginDelay=0
nano /etc/lirc/hardware.conf
# /etc/lirc/hardware.conf
REMOTE="Cyberlink Remove Control"
REMOTE_MODULES="lirc_dev"
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/by-path/pci-0000:00:04.0-usb-0:6:1.1-event-mouse"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf"
REMOTE_LIRCD_ARGS=""
START_LIRCD="true"
LOAD_MODULES="true"
LIRCMD_CONF=""
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
nano /etc/lirc/lircd.conf
begin remote

        name cyberlink
        bits 32
        eps 30
        aeps 100

        one 0 0
        zero 0 0
        gap 135995
        toggle_bit_mask 0x0

                begin codes
#NoGap
                        Home            0x80010066
                        DVD             0x8001018E
                        Music           0x8001018F
                        Pictures        0x80010190
                        Videos          0x80010191
                        Radio           0x80010181
                        LiveTV          0x80010179
#NoGap
                        SAP             0x80010188
                        Teletext        0x80010184
                        LastCH          0x8001016B
                        Subtitle        0x80010172
                        Language        0x80010170
                        Aspect          0x80010173
                        Back            0x8001009E
                        Guide           0x80010082
                        Menu            0x8001008B
#NoGap
                        VolUp           0x80010073
                        VolDown         0x80010072
                        Mute            0x80010071
                        ChanUp          0x80010192
                        ChanDown        0x80010193
#NoGap
                        Pause           0x80010077
                        Record          0x800100A7
                        Play            0x800100CF
                        Rewind          0x800100A8
                        Forward         0x800100D0
                        SkipFoward      0x800100A3
                        SkipBack        0x800100A5
#NoGap
                end codes

end remote
nano /etc/lirc/mythtv.conf
# LIRCRC Created by Keithamus
# Author: Keithamus
# Created for use with LIRCRC, completely free for any use whatsoever.

begin
        remote = cyberlink
        prog = mythtv
        button = Home
        config = ALT+H
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = DVD
        config = ALT+D
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Music
        config = ALT+M
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Pictures
        config = ALT+P
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Videos
        config = ALT+V
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Radio
        config = ALT+R
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = LiveTV
        config = ALT+T
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = SAP
        config = F8
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Teletext
        config = F2
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = LastCH
        config = H
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Subtitle
        config = T
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Language
        config = +
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Aspect
        config = W
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Back
        config = Esc
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Guide
        config = I
        repeat = 0
        delay = 0
end
begin
        remote = cyberlink
        prog = mythtv
        button = Menu
        config = M
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = VolUp
        config = F11
        repeat = 1
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = VolDown
        config = F10
        repeat = 1
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Mute
        config = F9
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = ChanUp
        config = Up
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = ChanDown
        config = Down
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Pause
        config = P
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Record
        config = R
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Play
        config = Enter
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Rewind
        config = <
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = Forward
        config = >
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = SkipForward
        config = PgDown
        repeat = 0
        delay = 0
end

begin
        remote = cyberlink
        prog = mythtv
        button = SkipBack
        config = PgUp
        repeat = 0
        delay = 0
end
mkdir /home/myth/.lirc/ && ln -s /etc/hardware/mythtv.conf /home/myth/.lirc/mythtv