LokiProject

Building & Managing Your Digital World

Monday, October 24, 2005

Bittorrent system and download information.

Bittorrent is an economical, fast, and popular method of distributing large files to many people. To download this software you’ll need a Bittorrent client, of which there are many free variants.
My favorite is the Azureus Bittorrent client for Windows. It is a Java application, so you may also need the Java Runtime found here. Click the ‘Download J2SE JRE’ option.

Posted by brian on 10/24 at 02:37 AM
(0) CommentsPermalink

Thursday, November 10, 2005

mythfilldatabase is fixed…

The mythfilldatabase tool downloads the latest programming information from ZapToIt. Version 0.17 had an automatic download function built into the GUI that worked well, and seems to be broken now. I bet there’s a permission problem somewhere. Let me know if you find something and I’ll update the instructions. In the mean time, I’ve updated the Sofware installation instructions to include updating the programming database using cron as recommended by http://www.wilsonet.com.

I think that’s the meat of the lokiproject platform configuration. This weekend I hope to post some instructions on how to backup the MythTV database, and manage videos.

Posted by brian on 11/10 at 05:50 AM
(11) CommentsPermalink

Wednesday, November 09, 2005

Fixed the remote’s buttons in movies…

Updated the software page to include some remote control fixes. Tomorrow will include some mythfilldatabase fixes.

http://www.lokiproject.com/index.php/lokiproject/lokiproject/C8/

Posted by brian on 11/09 at 05:45 AM
(6) CommentsPermalink

Tuesday, November 08, 2005

Software Configuration Updates and minor site tweaks…

I’ve added some instructions on configuring your system after the core software suite’s installed. Expect more updates here shortly. I’ve also added some links and cleaned up some formatting. View the new instructions here: http://www.lokiproject.com/index.php/lokiproject/lokiproject/C8/

Posted by brian on 11/08 at 05:36 AM
(4) CommentsPermalink

Monday, November 07, 2005

Toms hardware struggles with a DIY PVR box.

An older article, I’m just now clearing out my list of articles to review. But it demonstrates the challenge that we face in building home DVR machines.

http://www.tomshardware.com/howto/20051003/index.html

Posted by brian on 11/07 at 12:28 AM
(3) CommentsPermalink

Tuesday, October 25, 2005

Yet another MythTV project

MythicTV. They’re using a knoppix distribution and attempting to define a reference hardware configuration. It’s close to what we’re attempting, but at a lower level.

This was submitted by my friend with the site: http://www.podcast.ch

Posted by brian on 10/25 at 05:33 AM
(4) CommentsPermalink

Forums are up!

The LokiProject forums are up and running! You can find them at: Forums

Posted by brian on 10/25 at 05:12 AM
(5) CommentsPermalink

IE support in LokiProject…

Uhg… The site looks terrible in IE.

I suspect that this won’t be a major concern with the members of the site, so I won’t put a lot of effort into supporting both browsers. If you do use IE, please download, install, and use Firefox. Thanks!

Posted by brian on 10/25 at 05:04 AM
(10) CommentsPermalink

Wow… Does IE suck…

Do you know that IE parses:

<script>
</script>

Differently from:

<script/>

Stunning, and a total disaster. A 260 Billion dollar company can’t get that right…

Did I mention that you’re encouraged to use Firefox with this site.

smile

Posted by brian on 10/25 at 04:53 AM
(9) CommentsPermalink

Monday, October 24, 2005

Moved to a new site management package…

The move to pMachine’s Expression Engine appears to be a success. I’ll be making many more updates over the next couple days and weeks now that I believe the web site is stable and productive. Let me know what you think at: brian (at) lokiproject.com.

Posted by brian on 10/24 at 05:31 AM
(0) CommentsPermalink

About Me and this Site…

I’m a life long technology enthusiast who’s now building a family and looking for a way to manage all the digital memories and media we’re accumulating, rapidly. I’ve got MiniDV video’s and a wife with a 5 Mega Pixel camera that doesn’t have a chance to cool down. I want to share my music with my kids and give them quick access to “The Wiggles” when they need it the most.


I appreciate the other DVR/PVR/Media PC solutions out there, but the objectives of those systems is the maintenance of a business model. The customer doesn’t enter the picture at all. Furthermore, when Hung Lo computing of Redmond WA goes bankrupt, how do I renew my DRM keys to my wedding video? Open solutions ensure my memories are preserved for future generations.


I live and work outside of beautiful Seattle, WA, not far from our primary competitor.


This site is a commercial venture and I do hope to make a modest profit, but I hope to do so while providing genuine value to my visitors. If I don’t provide value, let me know at brian@lokiproject.com and I’ll go do something else.
I do appreciate that I’m capitalizing off of other peoples very hard work, so if a profit’s generated, I’ll contribute a portion to those who helped make this project a success. That includes those fighting to guarantee our access to our own media like the Electronic Freedom Foundation.

Posted by brian on 10/24 at 05:11 AM
(0) CommentsPermalink

Links

Official MythTV Configuration Howto:

Installing and using MythTV

Community Sites:

The PVR Guide
Build Your Own PVR

Programming Information:

Zap2it Labs
LxMSuite

MythTV Device Construction:

The Vulture's Nest
mysettopbox.tv
KnoppMythWiki

Constituent Parts Links:

The technically compelling, but politically troubled database: MySQL
The source for Fedora Core MythTV packages: ATrpms.net. Thanks Axel.
The cornerstone of our system: MythTV
The foundation of this adventure: Fedora Core.
This used to employ the CMS system by Typo3. Unfortunately, we need a community system so we've moved on...
www.wilsonet.comThis site would not have been possible without Jared. In fact, the install scripts are largely his instructions, codified.

Legal Links:

These guys are working hard to maintain & expand our digital freedoms: Electronic Freedom Foundation

Fun Stuff:

Fun and free games, apps, and media: Foozel.com

My friend's sites:

http://www.backbyrner.com
http://www.podcast.ch : A bunch of Swiss stuff. The colors hurt my eyes. You'll have to ask the owner...
http://www.talkenglish.com : Learn how to master english.
http://www.thehotfix.net : Cutting edge Windows information.
http://www.bestofeurope.org : A fun travel site.
http://www.kenyondurr.cjb.net : A portfolio site.

My wife's sites...

www.bizzymom.us
http://www.scrapbees.com
Posted by brian on 10/24 at 05:08 AM
(0) CommentsPermalink

Hardware

Motherboard:

Asus A7N8X-VM/400
A great little motherboard, but I think it's being phased out. I'll have to look into a replacement soon.
Load it up with 512MBs RAM.

CPU:

AMD Sempron 2200+
We need a fast CPU, but not the state of the art. The Semprons do well in this role, and are priced right.

Tuner:

Hauppauge PVR-350
So far, I've tested the PVR-350 available below. I have a 250 working on a test system and will be testing it within the context of the LokiProject shortly. Don't get the MCE package. It doesn't include the remote interface.

Drives:

Seagate 400
The bigger the better. I'm partial to Seagate 400s.
Any DVD drive will do, preferably a recordable one.

Remote Control:

OneForAll 6131
This is a great little remote and not only does it support all the LokiProject features, it also controls my TV, Set Top Box, and Kenwood Receiver.

Case:

CoolerMaster ATC-620C-BX1
Any Micro ATX will do. I really like the above, pictured below:
Posted by brian on 10/24 at 01:53 AM
(0) CommentsPermalink

Software

Installation

Media

We'll need three pieces of installation media:
  1. The Fedora Core 3 installation set.
  2. The LokiProject software on CD.
  3. And a floppy disk with the Fedora Core 3 kickstart file.

Fedora Core 3

Of course, we'll be using Fedora Core 3 as our OS. It can be downloaded in either CD or DVD form factors, either directly from the Fedora Core Project, or via bittorrent. I'd recommend the DVD image via bittorrent route.
Bittorrent is an open protocol, implemented by a variety of clients, that provides fast downloads of large files. I like the Azureus bittorrent client for Windows. The Fedora Core 3 DVD torrent can be found here, which was found at http://torrent.dulug.duke.edu/. Or you can download the CDs from the Fedora Core Project. You'll need:
  1. FC3-i386-disc1.iso
  2. FC3-i386-disc2.iso
  3. FC3-i386-disc3.iso
  4. FC3-i386-disc4.iso

LokiProject

I can't afford the bandwidth to host the LokiProject installation set on my site, so I've built a bittorrent link that can be found here:lpsa.01.iso.torrent.

After downloading the image or images, burn them to a CD or DVD, respectively. I like Nero for all my optical media burning chores.

Floppy disk

Now that you have all the installation media on CD or DVD, insert the LokiProject CD and floppy into your workstation (the Linux or Windows machine your viewing this document on,) and copy the file:
platform/ks.cfg
...from the CD to the root of the floppy disk.

Fedora Core 3 Installation

Insert the Fedora Core 3 distribution disk into the optical drive and boot. At the first Linux installation prompt, insert the floppy disk you created above and enter:
linux ks=floppy
...provided you have the correct hardware, that should install completely and automatically, without incident. Remove the CD and floppy, and reboot as requested.

LokiProject Installation

After the system reboots, log in as:
username: root
password: changeme
Click the 'Red Hat' icon found in the lower left corner of the screen, then 'Run Command.' Enter:
xterm
...and you'll see the xterm window appear. Insert the LokiProject CD you created above into the optical drive. Make sure the CD is mounted by typing:
mount /media/cdrom
Note: Your system's CD drive could be listed as /media/cdrecorder. If that's the case use /media/cdrecorder instead of /media/cdrom. This applies anywhere you see /media/cdrom.

Change to the directory:
cd /media/cdrom/scripts
Type the command:
ls
...to make sure you can see the files and directories located there, specifically: one.pl, two.pl, and three.pl. Enter the command:
perl one.pl -c ../config/standalone.xml
This command upgrades the system with a known set of working software updates. At this script's completion, remove the CD and reboot the system. Log in again as root, insert and mount the LokiProject CD, start xterm, and change to the scripts directory, all as above. Now run the command:
perl two.pl -c ../config/standalone.xml
This script configures virtually everything else including:
  1. The user account
  2. Samba
  3. System Files
  4. Installing all the required drivers
  5. Configuring LIRC
  6. MySQL
Reboot and go on to the next section.

NOTE: For this release, log in again as root one last time, run xterm, and type:
passwd mythtv
...then enter:
changeme
...twice. For some reason, the mythtv account's password isn't being set correctly.

MythTV Configuration

Now we'll setup the MythTV system. This time, login as:
username: mythtv
password: changeme
Run xterm by double clicking its icon on the desktop. Type:
mythtvsetup
...then:
1) Select your preferred language.
2) Select "Yes Delete Card Settings"
3) Select "Yes Delete Channel Settings"
Make the following configuration changes to the sections and screens shown in the mythtvsetup application as directed below:
Section: General
   Screen: Host-specific backend setup
      Directory to hold recordings: /mnt/store/recordings
      Directory to hold buffers: /mnt/store/buffer
Section: Capture Cards
   Screen: New Capture card
      Card type: MPEG-2 Encoder Card (PVR-250, PVR-350)
      Default Input: Tuner 0
Section: Video Sources
   Screen: New Video Source
      Video Source Name: Cable
      Enter the UserID and Password you used to subscribe to the DataDirect Service.
      Click: Retrieve Lineup
Section: Input Connections
   Click: [MPEG /dev/video0] (Tuner 0) -> None
      Set the Video Source to: Cable

...escape out of this tool back to the xterm window and run the following command:
mythfilldatabase
...which will fill the database with all the programming information that DataDirect provides.
Finally, run the following command to switch to the root user:
su
...enter:
changeme
...for the password. Insert the LokiProject CD, make sure its mounted, change to the scripts directory as above, then run:
perl three.pl -c ../config/standalone.xml
...this last command sets the backend to run on boot and such things.

Remote Control Configuration

The 6131 configuration directions were derived from: http://www.vulturesnest.net/mythtvremote.html
Open the OneForAll 6131 remote, add batteries, and perform the following actions:
1) Configure the PVR Button:
  1. Press the PVR button (to select the PVR device).
  2. Press and hold the SET button until the LED blinks twice, then release it.
  3. Enter 992. The LED should blink twice.
  4. Press the VCR button once.
  5. Press the PVR button once. The LED will blink twice.
  6. Press the PVR button. (Again, select the new secondary VCR device).
  7. Press and hold the SET button until the LED blinks twice, then release it.
  8. Enter 0081. The LED should blink twice.
2) Configure the undefined buttons on the remote:
  1. Press the device button you have programmed to VCR code 0081.
  2. Press and hold the SET button until the LED blinks twice, and release it.
  3. Press 994
  4. Tap the SET key. The LED should blink once.
  5. Enter a three-digit code from the table below.
  6. Press the corresponding remote control button from the table.
  7. Repeat for all of the buttons in the table (or, as many as you feel the need to program)
147Replay (Backwards curved arrow)
178Skip (Arrow pointing right with vertical line)
140Enter (1)
113PIP
145SWAP
236Move
240PVR Menu
(1) This maps ENTER to act the same as SELECT (so that they send out the same code)

Additional Configuration

Since the software's been released, my QA department (spousal unit) has discovered some issues that need to be resolved.
All of these steps will have to be automated, but for now, here are the instructions.

Sound:

Log in as root as described elsewhere in the documentation.
Click through the following menu items:
Hat->Control Center->Sound & Multimedia->Sound System
Un-check the "Sound System" box.
Don't worry if it crashes...

Time:

Click through the following menu items:
Hat->System Settings->Date & Time Network Time Protocol tab Enable Time Protocol Add: pool.ntp.org
Click OK...

Create the storage partition:

We'll need a partion of the hard drive to store all our TV shows and movies. I've chosen the XFS file system developed by Silicon Graphics because it handles large files efficiently. Luckily, our kernel comes with XFS support built in. We simply need to install some support tools that didn't make in on the first install. Download the following files to your system:
xfsdump-2.2.19-0_10.rhfc3.at.i386.rpm
xfsprogs-2.6.9-0_8.rhfc3.at.i386.rpm
From xterm install the packages using the command:
rpm -i xfsprogs
rpm -i xfsdump
...now we have everything we need to build the file system. Hopefully, you've selected a hard drive that's larger than 8GB, the size of our root partition. If not, stop, buy and install at least a 250GB drive. From the xterm window, logged in as root, enter the command:
fdisk /dev/hda
...now, enter the following keystrokes:
nCreates a new partition.
pCreates a primary partition.
3Creates partition number 3. 1 & 2 are the root and swap partitions.
enterAccepts the default beginning of the partition.
enterAccepts the default ending of the partition, that is, the remainder of the disk.
tSet the type of a partion.
3Select partition 3
83Creates a new partition.
wWrites the partition table and exits.

...reboot for good luck. When the system comes back up, log in as root again. Now we must place a file system on the partition we just created. Run xterm again and enter the following command:
mkfs.xfs /dev/hda3
Now, it'd be nice if our new volume was available after a reboot. To do this, we need to enter a command into the fstab file. Edit it with the command:
nedit /etc/fstab
...and enter the following line:
/dev/hda3 /mnt/data auto defaults 0 0

Autoload:

Download the file:
myth_load.sh
...and copy it to:
/home/mythtv/.kde/Autostart
...finally, go to the following directory with the command:
cd /home/mythtv/.kde/Autostart
...and run the command:
chmod +x myth-load.sh
...which configures the file to be executable.

Remote Control Fixes:

The original licrc file didn't support FFW & REV in movies. The following instructions fix that... Download the file:
lircrc
...and over-write the file it at:
/home/mythtv/.mythtv/lircrc
...with this file. Now the FFW (>>wink and REW (<<wink buttons work by fast forwarding 30 seconds and rewinding 10. Furthermore, the skip button fast forwards 10 minutes and the replay button rewinds one minute.

mythfilldatabase Configuration:

The auto execution of mythfilldatabase within the GUI worked with Myth 0.17 but it doesn't now...
To fix this, download the following file:
crontab.txt
Log in as mythtv and run the xterm application. Execute the following command:
export EDITOR=nedit
...which sets your default text editor. nedit is part of the lokiproject distribution. Then run the command:
crontab -e
...and copy/paste the contents of crontab.txt into the nedit window. Save, exit and you're good to go. This configuration will update your TV programming database sometime after 11:00am. Why that time? I've been told that everyone updates their database sometime in the middle of the night. This should remove some of the load on the programming servers.

Posted by brian on 10/24 at 01:52 AM
(1) CommentsPermalink

Logical Volume Manager

After releasing the software, my primary goal was getting the code in production at my home. Before I could do this, I had to get 600 gigs moved off my old hand built system so I could format the drives and start over. We'll, that took some work and you can read about it here:

This is not, technically, part of the LokiProject, but I thought people would like to hear about what I did to build an array for all my data...

A while ago I proved a theory that it was possible to simultaneously record and read NTSC video streams from a remote server over a 100MB network. Now the project's underway, I had an excuse to engineer that theory into a working solution.

Typically I run a very modest P3 500 with an enterprise Linux installation that supports a source control package I use. Its "enterprise" status gives me some comfort in it's stability and use as a software LVM platform. So I went down to Fry's and picked up a couple 400GB drives at ~$200 each and lashed them together into an 800GB Volume. This has worked very well with the exception that I only got about 720GB of storage out of it. More on that later.

I've never done this before so I took it slow, growing the volume and running frequent consistency checks. I started out by creating the LVM volume on a single drive. That's when I first noticed the loss of ~40GB, so I tried again by creating two 200GB partitions. That didn't help at all. So with a 400GB volume created I added the second drive and extended the volume to it. The process went uneventfully with the exception of these error reported by fsck.ext2 after the resize2fs command. Regretfully I didn't note the errors, but they occurred every time I expanded the volume and the errors seemed to indicate all the blocks were reporting incorrect free space size. It appears to work well after the errors were corrected though.

So the process I went through is this:

Install the two new 400GB drives, along side the existing 250GB drive with the OS on it.

Partition the first drive in half with fdisk, setting the partition types to 8e, the Linux LVM type.

Run pvcreate against each partition with the command:

pvcreate /dev/hdc1
pvcreate /dev/hdc2

...this adds some administrative data to each partition to support the LVM. Maybe that's were my 10% disk space loss went...

Create the Volume Group with the command:

vgcreate vg /dev/hdc1 /dev/dhc2

...this collects all the partitions into a single Volume Group with the name of 'vg'.

Now, we create the Logical Volume that'll appear as a single partition to our system. This was a bit tougher. I first ran:

vgdisplay vg

...to see how many PEs were available (see links below for an explanation of PEs) on the Volume Group. With that number, I ran the command:

lvcreate -l <FREE_PE_COUNT> vg /dev/vg/data

...which created the Logical Volume of the maximum size.

Now we'll put the file system on the volume. I did that with the command:

mkfs.ext3 -j /dev/vg/data

Finally we mount it to the file system. First create the mount point with the command:

mkdir /mnt/data

...then add the following line to the end of the /etc/fstab file:

/dev/vg/data /mnt/data ext3 defaults 0 0

...and mount it with the command:

mount /mnt/data

You should now be able to use the file system as usual. It's here that I copied about 300GBs of stuff to it from other machines. That took much of the night.

Now I wanted to extend the volume. I created a single, 400GB partition on the second drive with fdisk and assigned it's type to 8e as above, then created the Physical Volume with the command:

pvcreate /dev/hdd1

Then extend the Volume Group with:

vgextend vg /dev/hdd1

Then get the number of new extents with the command:p>

vgdisplay vg

...and extend the Logical Volume with the command:

lvextend -l <FREE_PE_COUNT> /dev/vg/data /dev/hdd4

Now comes the stressful part. Expanding the file system. First dismount the file system with the command:

umount /dev/data

For good luck, verify the volume's in good shape with the command:

fsck.ext3 -f /dev/vg/data

I guess you can do this with ext3's journal enabled so you have to turn it off with the command:

tune2fs /dev/vg/data -O ^has_journal

Now extend the file system with the command:

resize2fs /dev/vg/data

...that'll take a while... Now that the file system's been extended, check it again with the command:

fsck.ext2 -f /dev/vg/data

...this is where I had all the free space errors, just fix them and carry on. Add the journal back to the file system with the command:

tune2fs -j /dev/vg/data

Mount the file system again with:

mount /mnt/data

Now I have another 360GB of space that I tested with a series of reads and writes. It all looked good. After copying the rest of my data to the volume I had a measly hundred gigs left. So I ran through the same extension process above with the spare 200GB partition on the first drive containing the operating system.

So it's been a week since I set this up and we've been reading and writing a lot of data without incident. I have one more 400GB drive that I'm tempted to add, but I think I really should invest in a proper RAID5 system to protect my data smile

References

Learning Linux LVM, Part 1 on IBM's developerWorks

LVM HowTo

Posted by brian on 10/24 at 01:50 AM
(3) CommentsPermalink