Loading the Firmware

First you are going to need to download the SBIG Linux Development Kit. If you have a 2.4 series kernel, or an early 2.6 series kernel that uses the hotplug system, follow the directions in their README. If you have a more recent kernel that uses the udev system and you have a USB-based camera read on.

You are going to need to create one file in /etc/udev/rules.d in order to load the firmware. You are also going to have to copy the firmware files someplace “global.” The canonical location for firmware files is now /lib/firmware. In principle, the udev system will even take care of loading the firmware, but it requires cooperation from the device driver and we’re going to be using libusb (I only have a USB camera), so there is no driver per se.

Create a file in /etc/udev/rules.d (I named my “sbig.rules”) with a suffix of “.rules”. Add the following to it. I’ve used backslashes to indicate continuation and that actually works in the file. There are circumstances under which you don’t need them, but I haven’t quite figured out the rules and in some cases, when they are missing, the camera ends up in an endless cycle of loading firmware.

# udev's /sbin/firmware_helper won't work for this since the driver
# doesn't set up the correct files.  There's probably some way for
# that to be hacked here but I don't know how....

BUS=="usb", ACTION=="add", \
SYSFS{idVendor}=="0d97", SYSFS{idProduct}=="0001", ENV{DEVICE}!="", \
RUN+="/sbin/fxload -D $ENV{DEVICE} -I /lib/firmware/sbigucam.hex"

BUS=="usb", ACTION=="add", \
SYSFS{idVendor}=="0d97", SYSFS{idProduct}=="0002", ENV{DEVICE}!="", \
RUN+="/sbin/fxload -D $ENV{DEVICE} -I /lib/firmware/sbiglcam.hex"

BUS=="usb", ACTION=="add", \
SYSFS{idVendor}=="0d97", SYSFS{idProduct}=="0003", ENV{DEVICE}!="", \
RUN+="/sbin/fxload -D $ENV{DEVICE} -I /lib/firmware/sbigfcam.hex -t fx2"

# This is the ID presented once the firmware has been loaded.
BUS=="usb", ACTION=="add", \
SYSFS{idVendor}=="0d97", SYSFS{idProduct}=="0101", \
MODE="0666", SYMLINK+="sbig.%n"

There’s only one thing missing to make this work: the program fxload. fxload is/was a part of the hotplug system which, being deprecated, is probably not on your system anywhere. So you’re going to need to get a copy. The easiest thing to do (well, it was the easiest for me anyway) was to grab the RPM from the hotplug sourceforge repository and then use file-roller to extract the program which then needs to be copied to /sbin. Once your done those three things, you are ready to plug in your camera. What three things?

  1. Copy the SBIG-supplies firmware files to /lib/firmware. The SBIG README says to copy them to /usr/share/usb; ignore that. Uhm. Apparently SUSE 10.x does use that location, but it doesn’t exist on Fedora Core 5. So, where ever you put them, make the sbig.rules flie consistent with that location.
  2. Create the above /etc/udev/rules.d/sbig.rules file.
  3. If you don’t already have fxload, obtain fxload from the hotplug distribution and put it in /sbin.

Plug in your camera, both to the USB port of your computer and to power. The LED on the back of the camera should flicker briefly as the firmware downloads followed by it coming on steadily and the fan turning on. If not, double check all the usual suspects: did you really copy those files in the right places, are the firmware files readable, is fxload executable?

If the camera came on (as evidenced by the LED and fan), then congratulations, you’ve made it past the first hurdle.

SBIG ST-402/1603/3200

These cameras have a two-stage loader. I don’t own one, so I can’t actually test the install procedure, but Jan Soldan has been working with SBIG to get this to work correctly. The above directions won’t work if you have to copy of the SBIG Linux development kit from the SBIG web site. That’s because the second stage loader wants the firmware to live in /usr/share/usb. So you can either modify the above to put everything in /usr/share/usb, per the SBIG directions, you can put it in both locations, or you can put it in one and create symbolic links from the other.

If you have the kit from Jan, you can put everything in /lib/firmware.

Device Permissions

Fedora Core 5 is no longer bleeding edge, but its version of udev is newer than that installed on, for example, SUSE, RHEL4 and its derivatives (e.g., CentOS or Scientific Linux). That seems to be the cause of a discrepency between my udev rules file above and the one Jan Soldan is distributing. Jan needs to run an external script after the device is created in order to set the permissions on /proc/bus/usb/X/Y (X and Y are the bus and device numbers). Fedora Core 5 creates that node, but all I/O seems to go through the equivalent /dev/bus/usb/X/Y which the MODE=0666 directive modifies. It is unclear to me why Fedora Core 5 creates both but only applies the permission change to one. Since I don’t have SUSE, I can’t comment on what exactly is going on there.