Tue 8 Jul 2008
A frew months ago, I built a small home-server based on a VIA C7 Eden min-itx board. The machine has a 1TB drive attached and runs FreeBSD without any problems. I mostly use it to run some background network utilities and serve up media to the Playstation 3 in the living room. I occasionally stream music from it over a SSH tunnel as well. The lofty ideal was that we would take all of our DVDs (mostly TV series) onto the media server so that we could select an episode to watch without having to go through DVD cases. Ripping the DVDs was not a problem with an external drive, however, encoding the videos into a format that the PS3 could understand was a very time-consuming job on the c7.
This gave me the idea of using a second computer that I have around as an on-demand processing engine. The c7 can rip the DVDs fairly quickly and store the raw files on a network share, it can then wake up the amd64 and queue up the various encoding tasks. The amd64 should process the queue leaving the results on the network share and then turn its self off when the queue is completed. Although my c7 runs FreeBSD, I chose Linux for the amd64 since I may use it to develop embedded images at some point.
The network infrastructure is currently 100baseT, however, I have already bought a 1000baseT switch and cards for all of the machines. I haven’t put the gig-E in place just yet as the network file system (NFS) can serve data more quickly than the amd64 can encode over the 100baseT. Although the amd64 boots off an internal drive and then mounts the NFS, I am thinking of moving it to an 8GB solid state drive, as it only needs the bare essentials to encode videos.
Powering the system down can be easily done in software using the standard Linux/Unix shutdown command. This puts the system into S5/Soft Power-Off mode which doesn’t care if you remove the power. Waking up the system is more tricky. Many of the Wake-on-* features of the BIOS are designed to wake the system from S3, which is a state where all of the system is powered-off with the exception of the RAM. Power can still be removed as the hard drive buffers are synched before the system goes into “standby”. I would really prefer to do a full shut-down (S5) so this is not an option. One work around is to enable the machine to wake up from S5/S4/S3 via PS2 mouse click. I haven’t yet worked this out fully, however, I am thinking of linking the mouse (through some logic) to the wake-on-lan output of the gig-E card, or to some output port on the c7. Alternatively, I can latch the power button to the wake-on-lan port.
The final step is to design a queue system. My current thought is to create a special directory on the NFS partition that would contain automatically-generated shell scripts to automate encoding. The scripts would be generated by c7 and would be intended to run on the amd64 machine, probably via cron job that polls the directory periodically. Once the job is complete, the last line of the shell script can be used to move the script to a completed directory. A second cron job can then poll the queue directory less frequently and issue a shutdown when all of the jobs are completed and the directory is empty. Finally, the mediatomb DLNA server can be configured to periodically scan the media directories and add new files into its database.
So far, I have mostly automated DVD ripping with chapter support, and have somewhat worked out how to generate the queue shell scripts. I am still working out the best encoding option for the PS3 to recognize. I have not implemented the queue control cron jobs or a way to wake the amd64 machine from S5, so that is forthcoming. As usual, any helpful hints or experiences are very welcome.
del.icio.us |
digg

July 10th, 2008 at 3:55 am
It is possible to configure wake-on-lan to boot up the computer from s5 with a udp packet. I had an older machine that was shut all the way down (not sleeping) and it could be woken. A simple client on another machine sends the special udp packet to the athlon64 box, which then boots up. As always, the Gentoo wiki has more info (and most of it is generic enough for any distro) http://gentoo-wiki.com/Wake_on_lan
July 10th, 2008 at 6:57 am
Thank you for the helpful link. My main problem is that this is a small form factor system (athlon64) and so the mainboard is missing some features. I do not see bios support for the wake-on-lan feature in the integrated chipset and don’t think that a PCI card can wake the system up from S5. There are no wake-on-lan or wake-on-ring headers on the board either. I will definitely try it though when the gigE cards come in. If I can get WOL to work, then that would be the best case.
July 11th, 2008 at 2:38 pm
I think that the pci bus supports having the nic wake up the machine, without needing a cable, at least according to that wiki. The two machines I use it on have nics integrated on the motherboard, and are full atx as well. But if your bios doesn’t support, then I guess you need to be more creative. (Are there any updates for the bios?)
July 11th, 2008 at 10:45 pm
That is true, I will try it next week. It may be a good time to get a new machine anyway. The newer Athlon64 cpu+mainboard combos are getting very cheap.