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