Prerequisite: Make sure that the kernel is compiled with IEEE1394 built-in support. This is critical!
You can add support for the IEEE1394 devices by compiling the kernel again. Don't panic! Here are the steps to compile the kernel:
Go to the directory where your kernel source code is
present. Normally it is in /usr/src
. We suggest that you download
a fresh copy of the kernel source code (2.6.10) from www.kernel.org.
Thus, cd /usr/src/kernel-2.6.10 (kernel-2.6.10
is the name of the source code directory. It can vary from system to system.)
make menuconfig
The menu will come up. Select
The
menu will come up. SelectMark the following as <M> in the menu that is shown:
OHCI-1394 support
OHCI-1394 Video Support
OHCI-1394 DVI/O Support
RAW IEEE1394 I/O Support
Press ESC to come out of the menu
Save the configuration
Install libraw1394-1.2.0
The following steps are required to successfully install
the library (libdc1394). As a rule of thumb, the installation has
to be done as the root
user.
We already had this library installed in our Linux, so we skipped this step. If you do not have this library installed, make sure you install it before moving further. Here are the steps for the installation:
su root
tar -xvzf libraw1394-1.2.0.tar.gz
cd libraw1394-1.2.0
./configure
make
make install
Install libdc1394-1.1.0
su root (if you haven't already)
tar -xvzf libdc1394-1.1.0.tar.gz
cd libdc1394-1.1.0
./configure
cd libdc1394
make
make install
Install the modules
modprobe ohci1394
modprobe video 1394
modprobe ieee1394
modprobe raw1394
lsmod to view that all the modules (ieee1394, raw1394, ohci1394 and video1394) are now installed.
The modules have some dependencies:
ohci1394 to video1394
ieee1394 to video1394, ohci1394, and raw1394
So if you are installing modules with insmod, video1394 and raw1394 have to be installed first, followed by ohci1394 and ieee1394.
Create proper 1394 devices
cd /dev
mknod raw1394 c 171 0
chmod 666 /dev/raw1394
mkdir video1394
cd video1394
mknod 0 c 171 16
mknod 1 c 171 17
chmod 666 /dev/video1394/*
Every time the system is restarted, the nodes are destroyed and the modules are removed automatically. So we wrote a script to automate this installation task at start-up, to undo all the damage done during rebooting!
Set user paths
su user
Check for the
LD_LIBRARY_PATH
. It should contain /usr/local/lib
. This is necessary
to run the applications with the help of the shared
libdc1394_cotrol.so.13
object
file.
You can also set the path by adding /usr/local/lib
in /etc/ld.so.conf
.
This completes the installation phase.
In order to make sure the installation is correct, connect the camera to the IEEE1394 card (assuming that the IEEE1394 card is already installed on the system) and just run testlibraw:
$ testlibraw
This tests for the presence of the host card, camera and other related parameters. Below is a typical output from testlibraw:
Successfully got handle current generation number: 17 1 card(s) found nodes on bus: 2, card name: ohci1394 using first card found: 2 nodes on bus, local ID is 0, IRM is 1 doing transactions with custom tag handler trying to send read request to node 0... completed with value 0x23127bac trying to send read request to node 1... completed with value 0x60217dac using standard tag handler and synchronous calls trying to read from node 0... completed with value 0x04477dac trying to read from node 1... completed with value 0xd37380ac testing FCP monitoring on local node got fcp command from node 0 of 8 bytes: 01 23 45 67 89 ab cd ef got fcp response from node 0 of 8 bytes: 01 23 45 67 89 ab cd ef polling for leftover messages
The libdc1394-1.1.0
library comes with
some example programs which are very helpful in understanding how
the programs are to be written. There is a Makefile available in the
examples
folder of the tar file. To compile and execute the programs:
cd libdc1394-1.1.0/examples
make
You can get programs exclusively written for the Point Grey cameras at http://www.ptgrey.com/support/kb/data/grabdma.tgz.
Fortunately, we have an open source graphical application developed for the IEEE1394 cameras, known as Coriander that provides a nice Graphical User Interface for libdc1394 to help the user work with the camera more efficiently. Later we will discuss how Coriander helped us in debugging. Next, we briefly explain how to install Coriander.
Installation of Coriander
Make sure that you have libdc1394 and the Gnome
libraries (Coriander uses
gnome.h
) installed on your Linux
machine. For more details regarding the requirements, look into the user
manual provided by Coriander: http://damien.douxchamps.net/ieee1394/coriander/manual.php.
Download the following tar file from sourceforge.net:
coriander-1.0.1.tar.gz
, then proceed as shown below:
su root
tar -xvzf coriander-1.0.1.tar.gz
cd coriander-1.0.1
./configure
cd src
make
make install
Run Coriander as follows:
cd coriander-1.0.1/coriander-1.0.1/src ./coriander
Fortunately, the installation of the libdc1394 and related modules is simple and does not pose any major problems. Some minor problems you may face are due to mistakes such as not installing it as root or not changing the permissions of the newly created IEEE1394 devices.