Foreword: A while back, whilst traversing a roundabout, some bastard drove into the side of my lovely car and, although it was his fault, claimed it was mine and that I was in the wrong lane, etc, etc. Before that point, I had been toying with the idea of installing a forward facing camera to capture my trips to Wales and the number of idiotic incidents one sees when driving anywhere. This was the final impetus I needed to start my project. My original system used a Mini ITX board without any hardware encoder, relying on the efforts of mencoder and the CPU to encode the raw stream to a useable size and of reasonable quality. I learned quite quickly, that a hardware encoder was required.
Choosing the Alix system: After getting fed up with the car I wanted to install a similar camera system onto my motorbike. Rather than doing something practical and spending lots of money on a bespoke system, I decided to use my experience from the CarCam project to build a system for the bike. Being short of space, I needed the smallest system I could find, with hardware encoding, USB support and run on 12V. Needless to say, I couldn’t find anything that fitted this requirement. How ever, I did find a supplier of MPEG2 Mini PCI cards which meant I only needed to find a small system board that accepted Mini PCI.
Development: It’s been over a year since I started working on this project. I have sold one system to a friend who has been using it to record his off-road exploits (as well as his commutes). During this time, I have refined the code to a stable release and optimised the time it takes to start recording from power on to around 25 seconds (from around a minute in the early code). The system is based on Slackware 13.0 with a heavily customised 2.6.30 kernel and environment. I am using aufs2 to mount over “/etc” and “/var” to prevent the Compact Flash card from being prematurely destroyed by OS writes. The handling of inserted/ejected media, as well as media errors, is done via syslog-ng which calls helper scripts when the appropriate kernel messages are generated. Other scripts are called from cron to check that the recording doesn’t exceed the 4GB file size limit of the FAT32 file system and that the USB device doesn’t fill up.
Video Quality: The output video needs some deinterlacing, but the overall quality is very good.
Linux Image: After much toil, I decided that the best way to offer the Linux image was through a Windows utility as most people will have access to a Windows system, even if they don’t run Windows themselves. After further toil, I decided to use R-Tools Technologies R Drive Image to create the image. It was a lightweight install without the need to boot from a CDROM or USB device to do its work. A 15 day evaluation copy of their software can be downloaded here and the latest Alix Linux image can be downloaded from here.
Hardware Required: Obviously an Alix 3d2/3d3 system. I would recommend the 3d2 as the older 3d3′s have a buggy BIOS (BIOS updates that fix the problem can be downloaded from here). Not only that, the 3d2 is cheaper and the onboard sound and graphics of the 3d3 are not required.
And the MPC622 hardware MPEG2 encoder.
Writing the Linux Image to Compact Flash: Download the Alix Linux image and install R Drive Image. Once R Drive Image is installed, you can double click on the “BikeCam.arc” file to begin the installation process. The original CF device was 2GB as that was the smallest I had. R Drive Image will allow you to install this on larger devices but not smaller. I can’t really see this being a problem as most companies only stock 2GB CF cards or larger. The process is straight forward apart from one little gotcha. When selecting the source and the destination, you must click on the square boxes to the left of the listbox (see image below). This instructs R Drive Image to include the whole image and not just a partition.
Once the source and destination have been selected the “Next” button will become available. At the time of writing this, the next page should be left default. When I experimented with “Expand/shrink partition to the whole disk”, this had no effect.
Once complete, you can insert the CF card into your Alix board and begin recording.
Function: The system uses the three LED lights to provide feedback on how it is functioning.
- LED #1 is used to indicate the power status.
- LED #2 is used to indicate that the inserted external media has been mounted.
- LED #3 is used to indicate that the system is recording from the video device to the external media.
The system will detect media insertion and removal. If necessary, the inserted media will be repartitioned and formatted as FAT32. Also, the inserted media will be repartitioned and formatted if it detects that the largest partition on the external storage is not within 95% (or so) of the total capacity of the external device. I would recommend at least an 8GB, performance, USB Flash drive for recording, though any external media is acceptable.
Useful Links:
PC Engines Homepage (manufacturers of the Alix motherboards)
Twam’s homepage & weblog (useful information on the Alix system)
Picco Computers (MPC622 hardware encoder)
Zercom (MPC622 hardware encoder)
« Blocking SSH Scans Using Syslog-ng Fitting a chain to a 1993 Tiger without draining the oil »
