Image Capture from a Basler A102fc in Linux

Monday, March 30, 2009


Even though this image is nothing to write home about (by photography standards), it's one of the first I was able to capture using a Basler A102fc -- a firewire camera that we use in our vehicle.

Capturing this image in Windows is fairly straightforward; they provide a driver disc and some sample code. In linux, you need the libdc1394 library and some patience.

Before even getting to the point where I was worried about software, the first hurdle was how to power it on. The camera gets power from its 6-pin firewire port (4 pins for data, 2 for power) but my laptop has only a 4-pin port (no power).

The first idea was to pick up a powered firewire hub from the local electronics store. However, this led to a lot of frustration on my part before discovering that a powered firewire hub does not ... actually ... power ... firewire. It just amplifies the data signal so it can be repeated on the other ports!

One cannibalized firewire cable and 9V power supply later, I had my own powered firewire hub.

The software took only slightly less time, as the documentation for the libdc1394 library covers versions 1.x while the library itself is up to the non-compatible 2.x. However, I made great use of an existing project called grabdma.tgz.

After finding the details of the video mode I wanted using coriander, I set the proper image conversion function (the camera returns YUV images, not a Bayer pattern) and everything fell into place.