Download Pages - Small Vision System or Capture Software, Linux


INSTALLING IEEE/1394 CAPABILITY ON LINUX
Kernel 2.4.18 (RH 7.3) has built-in IEEE 1394 support.  If you are using a MEGA-D, DCAM, or Dual-DCAM (STH-DCAM/-VAR), you should be able to use this version without any kernel recompilation.  Any 2.4.x kernel, with x >= 19, will work.

Check Version of GCC
With the latest versions of RedHat and some other Linux distributions, GCC has moved from version 2.95 to version 3.x.  Source code compiled under these different versions are incompatible.

To check which version you have, execute:

    gcc -v

This will tell you which version you have.  Make sure you download the correct SVS or DCAM software distribution for your GCC version.

Installation
To complete Linux installation for SVS, follow these instructions.

A. Get and install the libraw1394 libraries
B. Install hardware, check /sbin/lspci to see that it's there
C. Insert IEEE/1394 drivers with modprobe


A. Get and install the libraw1394 libraries

These libraries are available from www.linux1394.org, under the libraw1394 project.  There are binary distributions for Red Hat and Debian distribution.  Get the latest distribution (libraw1394-0.9.0), and install it (you can get the i386 rpm, which installs the binaries directly).

B. Install hardware, check /sbin/lspci to see that it's there

Plug in the IEEE 1394 board, and restart the computer.  Most 1394 boards install just fine.  You can check using 

  /sbin/lspci -vvx

which gives verbose info about the PCI bus.  You should see the 1394 board, and make sure it is both a bus master and has 2 memory segments active.  If it doesn't, the problem is most likely a buggy BIOS.  On my stupid laptop, the BIOS doesn't configure the 1394 port properly, I have to do it by hand later.

On some systems it appears that the /dev/video1394 and /dev/raw1394 devices are not created.  You can check by doing:

  ls -l /dev/video1394
  ls -l /dev/raw1394
which should give you a listing.  If not, create the device as root using:
  mknod -m 666 /dev/video1394 c 171 16 [kernel 2.4.19 and above]
  mknod -m 666 /dev/video1394 c 172 0  [kernel 2.4.18 and below]
  
  mknod -m 666 /dev/raw1394 c 171 
 
C. Insert IEEE/1394 drivers with modprobe
Here's a sample shell for installing the drivers:
  echo "Adding modules..."
  /sbin/modprobe ieee1394
  /sbin/modprobe raw1394
  /sbin/modprobe ohci1394 attempt_root=1
  /sbin/modprobe video1394  
  /sbin/lsmod

In a desktop system, you can install a script with these commands at the end of /etc/rc.d/rc.local.  

You can check that the host controller is root by looking at the output from:

    cat /proc/bus/ieee1394/devices | grep Root

which should produce the output:

    Root     : yes

If the IEEE 1394 system ever gets hung, you have to unhang it by removing all the modules, and re-installing them.

 

Notes on installing PCMCIA cards

PCMCIA card support for IEEE 1394 is still undergoing changes in Linux.  The major transition is to include support for hotplugging PCI devices into the kernel drivers.  At the present point (kernel 2.4.18 and above), some of the drivers for PCMCIA cards must be loaded and unloaded manually.

Perform steps A and C above, without installing the PCMCIA card.  In step C, do not install the ohci1394 and video1394 drivers (you can have a startup script in /etc/rc.d/rc.local to install ieee1394 and raw1394).

 If you haven't applied the root patch, you must modify the /etc/modules.conf file to add a parameter to the ohci1394 module, which will be loaded automatically when the card is plugged in.  Use the following entry in modules.conf:

    add options ohci1394 attempt_root=1

Insert the PCMCIA card.  You should get two high beeps, to indicate the card driver was found by the PCMCIA subsystem.  Check (with /sbin/lsmod) to see that the ohci1394 driver was loaded.  If not, load it by hand (modprobe ohci1394 attempt_root=1).

Load video1394 (modprobe video1394); you can also have /etc/modules.conf load video1394 automatically after ohci1394.  Check that all modules are loaded, and that's it!

To take out the card, remove video1394 and ohci1394, in that order (rmmod).  Then eject the card.

 

Debugging

There are many places where the IEEE 1394 installation can go awry.  These are some of the common problems.

1. Make sure libraw access is working.  Run the program /usr/bin/testlibraw that comes with the libraw distribution, and check that there are no errors in the output.  Another good program to run is gscanbus, which will show devices on the bus.

2. Check that all required modules are loaded: ieee1394, raw1394, ohci1394, and video1394.  video1394 won't load if ohci1394 isn't loaded, or there are no OHCI cards present.

3. If there is a "no image, timed out" message in the smallv application when Continuous is invoked, then there may be a problem with the ohci1394 module.  Use the command:

    cat /proc/bus/ieee1394/devices | grep Root

If  Root is "no", then there is no IEEE 1394 root node, and interrupts will not be delivered.  Try installing the ohci1394 with attempt_root=1.  

4. If there is an error from smallv in accessing /dev/video1394, check that this device has been created and has the right permissions.  Make sure to look at the node creation information above.  Your console output, on opening the device, will look like this:

Imager ready.
Camera ISO speed set to 400 Mb/sec
Camera ISO parameters: 2000000
Failed to open video1394 device, errno XX
Opening Stereo Device Failed

Make sure you have the right node number for /dev/video1394.  For 2.4.18 kernels and below, use (172 0).  For 2.4.19 and above, use (171 16).

Here are the common sources of errors for failing to open video1394:

error 19:  video1394 driver is not installed - use "modprobe video1394"
error 13:  /dev/video1394 does not have "rw" permission for all users
error  2:  /dev/video1394 is not created
error  6:  /dev/video1394 has the wrong device number (172,0 or 171,16)