Firewire 1394 on Jetson TK1?

Has anyone been able to capture from PtGrey firewire 1394 cameras on the Jetson TK1? I would like to be able to use a Pt Grey bumblebee camera with the board. I connected a mini PCIe firewire card with 2x 1394b and 1x 1394a connections to the TK1. The firewire bus is detected, but no camera is detected. What do need to make this work? Any suggestions are much appreciated.

So far as hot plug hardware goes I work with USB, not firewire. I would think that the firewire works the same or similar to USB and probably has similar log messages upon plug and unplug events. Before and after plugging in and unplugging your camera try “dmesg | tail -n 10” and watch for messages which change after the event. Depending on logging, same with “tail -n 10 /var/log/messages”.

Point one is that it sounds as if the firewire is detected and working, so drivers for this are likely not an issue. Many people have had to use back ported drivers though for various camera or wireless devices (see the grinch kernel sticky topic), and I’m going to guess that no driver has yet been configured for the camera itself. Check what messages you find and post again.

Thanks for the reply. I did some inspections with dmesg, and eventually the following message appeared:
vgaarb: this pci device is not a vga device

PtGrey only support usb cameras on ARM based systems. My hope was that there would be some generic firewire driver that would support OHCI compliant hardware.

Actually, upon further reading the message about VGA device is related to monitor and not the camera.

Yes, the VGA comment is actually harmless (unless you are doing remote CUDA display). One of the software components is recognizing the Kepler as a VGA device not used as a video card (or at least I think this is why it says this).

There is generic OHCI and all of the historic hot plug variants available in the linux kernel. The issue is that even though your firewire works, this does not mean the actual camera driver was installed. The first driver supports communications, e.g., USB or firewire…this is working. The second driver required is for the camera, and this is what you are looking for on log messages. Something to hint at seeing a device it doesn’t understand, where some sort of ID might tell you what driver to compile.

I’m not too familiar with Linux, so bear with me. I inspected the PCI buses using sudo lspci -kvv. The firewire card is listed as:

01:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 08) (prog-if 10 [OHCI])

However, I do not see any line which says what kernel driver is being used. Searching online I found someone posting a similar result of lspci, but there the firewire-ohci was listed as the driver.

It appears as if no firewire drivers are at all present on the Tegra TK1? I did find the file which blacklists the older firewire stack, so (if present) the newer Juju firewire stack would be loaded.

When I check the kernel source code from https://developer.nvidia.com/linux-tegra-rel-19, I see the firewire driver code present in the driver directory.

Do I understand correctly that I should build a Linux 4 tegra version which enables the firewire driver somehow? Or am I completely off here.

Thanks very much!

About drivers and linux…drivers are often created in a chain of drivers allowing each part of the chain to work. How the device is physically connected requires a driver, but this does not in any way enable the device. Plugging a PCI card into a PCI slot only helps if the PCI driver is present…but the PCI card itself still needs its own driver. A camera in a USB or firewire slot could work if USB or firewire drivers exist. USB and firewire in no way support cameras, mice, keyboards, or any other device…they are just a dumb hotplug layer to tell the kernel to search for a driver of the camera. Once USB or firewire tells the kernel a device is plugged in a second driver for the specific device needs to step up and offer to service the device.

lsmod is what lists kernel modules, but many drivers are built in…no module listing for these drivers because it is integrated. lspci shows your hardware present on the PCI bus, and could be useful for finding the right driver if the driver isn’t present…via the chipset listing and research (in a similar way lsusb shows usb hardware). The kernel can have drivers directly integrated or as a module…if you build a module against a particular kernel you can insert just that one driver even while the system is running. If you are willing to recompile the whole kernel, then the driver can be integrated (which has some advantages). Any message about detecting a firewire card or any message that something was connected or disconnected from firewire means the firewire itself has complete driver support already and is not at fault for the camera not working.

So what you need to do is to search for log messages generated by plugging in or unplugging devices as a clue to whether the system first can see your device. Once you know the device is visible, you need messages to indicate the driver was loaded or present (thus an indication of the need for a driver or already-installed driver). If there are clues that the module or integrated kernel support is there, it is time to configure the system to actually use the device.

Thus the questions about log messages. Logs offer a clue as to which stage of the chain is present, absent, or just not configured. A typical way to see what is going on is to run this before and after a device is plugged in or unplugged (to see if it notices and changes):

dmesg | tail

…there are also files in /var/log/ which offer clues. Exact files depend on system logging configuration, but typically it’s nice to check the log “kernel”, “messages”, or anything interesting. E.G., “tail /var/log/kern.log”.

Thank you very much for your help so far. I checked the ring buffer and various logs. The ring buffer has nothing about PCI card or firewire camera. The logs (syslog and kern.log) show messages related to initialization of the PCI buses. The mini PCIe card is detected on pci:0000:01:00.0. I don’t see any logs which would indicate that some problem occurred. Connecting, disconnecting, and re-connecting the firewire camera generates no messages or log entries.

One thing that comes to mind is that if you’ve done an update to system packages (my experience is on R19.3) you may have lost some logging because of package changes. Before moving on from looking for messages, take a look at the bottom of this file:

/etc/rsyslog.d/50-default.conf

…there is a comment: Some “catch-all” log files. Uncomment the debug and info lines below this so it looks like this:

#
# Some "catch-all" log files.
#
*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

Once this is done, reboot and use tail -f on /var/log/messages and /var/log/debug while unplugging and plugging in your firewire device (or even different firewire devices).

Specific logging depends on what driver authors added, but it is very strong evidence of lack of firewire driver if adding/removing firewire devices shows nothing at all in logs (the devices added/removed do not need to function, they just need to be noted so the kernel can ask for drivers to support the device…without that it means firewire itself may not be installed). The note of the card existing in PCI listings means the PCI bus drivers function. From there we can go down the driver chain and figure out which driver is used for firewire (or if it is the camera needing driver).

I uncommented, rebooted and plugged / unplugged the camera several times. I inspected /var/log/messages, /var/log/debug and other log files. Nothing shows up that indicates that the camera connection is being handled. Both messages and debug seem to only have some entries related to boot up.

You mentioned this earlier from lspci:

1:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 08) (prog-if 10 [OHCI])

If you run lspci with the “-v” verbose option, what does this entry show? Trying to add info, we already know it is an LSI FW643.

Also, do you have explicit model information or web link for the mini-PCIe firewire card?

Here’s the output of sudo lspci -v

01:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 08) (prog-if 10 [OHCI])
        Subsystem: Device 5901:1101
        Flags: bus master, fast devsel, latency 0, IRQ 130
        Memory at 32200000 (64-bit, non-prefetchable) 
        Capabilities: [44] Power Management version 3
        Capabilities: [4c] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [60] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [170] Device Serial Number 01-08-00-00-00-01-5a-51

I would have expected a line with kernel driver or module which would list firewire_ohci, but there’s no mention of any driver or module.

Sorry, the model mini PCIe is StarTech.com part# MPEX1394B3

There appears to be a series of LSI firewire chips with different speeds (and perhaps port count) which use the same driver. This specific card is listed as having a driver on at least mainstream architectures, and the manual for this card says no specific driver is required as there is native support on all listed o/s. I see the R19.x kernel does not enable firewire by default. So it is just a matter of adding a kernel module or compiling a kernel with the driver. Keep in mind this is the firewire support, camera will be a similar effort once firewire works.

Regardless of L4T version I’m going to guess the same steps are needed (but kernel version to compile is slightly different).

Which Jetson L4T version are you using? You can find out via:

head -n1 /etc/nv_tegra_release

Also, run this command to see the exact kernel version:

uname -r

Once you have downloaded the kernel source (depends on the uname -r result) you can configure it to match this kernel version and enable firewire options, build the module, and install the module. Firewire should work at that point and you can move forward to camera drivers and configuration.

Here’s the L4T version:

# R19 (release), REVISION: 2.0, GCID: 3896695, BOARD: ardbeg, EABI: hard, DATE: Fri Apr 18 23:10:46 UTC 2014

Kernel version:

3.10.24-g6a2d13a

Ok, this gives a good starting point. I think your biggest issue will be in obtaining this particular kernel’s source…it is from R19.2, but of R19, currently the downloadable source is R19.3 or R21.1.

Anyone know where to get R19.2 kernel “3.10.24-g6a2d13a”? There is probably a git repo with this. If not, upgrade of the whole system to R19.3 or R21.1 would be required.

In general if you wish to compile a driver and use it on a running system the same kernel source must be used and that source must have the same configuration as the running kernel…one can then compile a module that matches that kernel. A non-matching or unconfigured kernel source will cause failure.

The essential steps are download the kernel source, get the running config via a copy of /proc/config.gz, run the configuration program with this config, and alter the config to add the firewire support. One can then build the kernel and install just that module making firewire happy. Rinse and repeat with the camera module if the camera has an existing driver.

One other snag is this…if you have not ever upgraded your boot loader will be fastboot. Should firewire require some form of kernel option during boot you’ll have to flash the kernel instead of just copying a module to the right place (u-boot is nice because you can install new kernels without flashing…including leaving the old kernel functional and simple tests of kernel command line option changes). Typically this will not be an issue for something simple, so you’d copy the module over and try it out, not bothering with a kernel flash unless the module complains.

I am able to interface Point grey firewire 1394 camera with Jetson board and can see the video using coriander. But I am not able to get the video on OpenCV. Did you also did that?

which PCIe mini card did you use ? Did you have to do a special build of the kernel ? were you able to make it work with OpenCV after ?