FAQ

From IEEE 1394 FireWire Wiki
Jump to: navigation, search

OBSOLETE CONTENT

This wiki has been archived and the content is no longer updated.

Frequently Asked Questions

Also see the libdc1394 FAQ or Linux DV FAQ.

Beware! This page is still way out of date.


Contents


General

How do I upgrade the driver?

See the Source Repositories page for locations of current driver sources.

  1. cd /usr/src/linux (or the root of your kernel source tree)
  2. cd drivers
  3. move the existing drivers out of the way: mv ieee1394 ieee1394.orig
  4. download the new ieee1394 directory from the repository as a tarball or using svn with the checkout option
  5. If you are using the drivers as modules: recompile and install the drivers, unload old modules, load new modules
  6. If you are compiling the drivers into the kernel: recompile the kernel, install the kernel and update the boot loader, reboot

Remember, an understanding of kernel compilation and installation is a pre-requisite to the installation of ieee1394 and is beyond the scope of this document.

Compilation fails, now what?

The Subversion linux-2.4 branch and perhaps other versions of ieee1394 are known to fail with the preempt kernel patch.

Do not try to compile modules directly from the ieee1394 directory; you must compile from the top-level kernel source directory (e.g., /usr/src/linux).

If you get 1394 unrecognized symbol errors with crazy characters as part of the symbol names when you 'make modules_install' then try deleting all *.o in the ieee1394 directory, and run a 'make dep modules modules_install.'

How do I setup hotplug?

Older versions of hotplug and Linux1394 drivers only recognized a SBP-2 storage device and loaded the corresponding sbp2 driver; however, it did not register any devices with the SCSI subsystem. New versions of Linux 1394 drivers (kernel 2.4.21+ or Subversion branches/linux-2.4) support hotplug for a number of device types including DV AV/C devices and Digital Camera.

In order to fully leverage this, a new hotplug agent script is available now in Linux-Hotplug CVS. As of this writing (April 23, 2003), it is newer than what appears in any of the popular distributions. Specifically, you need to replace /etc/hotplug/ieee1394.agent.

Next, make sure an /etc/hotplug/ieee1394 directory exists. Then, you can create per-module scripts to make SCSI recognize partitions or start video applications. A kernel 2.6 system does not need a hotplug/ieee1394/sbp2 script because there is direct hotplug integration; however, a kernel 2.4 system should include /etc/hotplug/ieee1394/sbp2:

#!/bin/bash
if [ "${ACTION}" = "add" ]; then
        . /etc/hotplug/ieee1394/rescan-scsi-bus.sh
else
        . /etc/hotplug/ieee1394/rescan-scsi-bus.sh -r
fi

WARNING: Due to the completely unsafe implementation of the add/remove- single-device interface in the SCSI layer, automated calls of rescan-scsi-bus.sh are dangerous. Badly timed runs of that script may cause the kernel to oops or freeze. This happens especially if a rescan is run while the sbp2 host is removed. This particular situation does not occur in "typical" desktop usage, but it is not so far off given the time a rescan may take with more and/or slow SBP-2 devices.

An alternative to all of the above is to patch the Linux 2.4 SCSI subsystem to expose functions that allow sbp2 to communicate directly. After applying the patch, you must uncomment "#define SBP2_USE_SCSI_ADDREM_HACK" in drivers/ieee1394/sbp2.c. Finally, recompile and reload/reboot.

/etc/hotplug/ieee1394/dv1394 for DV cameras:

#!/bin/bash
if [ "${ACTION}" = "add" ]; then
        kino
fi

/etc/hotplug/ieee1394/video1394 for Digital Camera:

#!/bin/bash
if [ "${ACTION}" = "add" ]; then
        coriander       
fi

How do I use a 1394 port for TCP/IP networking?

There is a preliminary eth1394 driver. It is neither stable nor fully standards (RFC 2734) compliant--but getting close! Please test out with another Linux machine and submit bug reports and patches to the linux1394-devel mailing list.

How do I setup udev rules to create the device nodes for the various drivers?

Only recent versions of ieee1394 for Linux kernel 2.6 contain the sysfs files to support generic udev rules in order to create the /dev nodes for the protocol drivers. This means you need a 2.6.12 or newer kernel or 2.6.11 with ieee1394 from the linux1394.org Subversion server (rev 1240+). Create a file at /etc/udev/rules.d/10-ieee1394.rules, for example, with the following contents:

    KERNEL=="raw1394", NAME="%k", GROUP="users"
    KERNEL=="dv1394*", NAME="dv1394/%n", GROUP="users"
    KERNEL=="video1394*", NAME="video1394/%n", GROUP="users"

Note that it is quite difficult to setup dv1394 under udev the same as devfs does because udev wants to create a single file per device, and symlinks will not work.

How to get access to raw1394 as unprivileged user?

Answer added in October 2009

Many recent Linux distributions allow only the root user to access /dev/raw1394, either deliberately due to an incomplete understanding of FireWire security implications (Ubuntu), or because they didn't notice that some Ubuntu udev rules were merged into mainline udev.

In most desktop-oriented installations (if they still run the old ieee1394 driver stack rather than the newer firewire driver stack), it is most desirable to grant unprivileged users access to /dev/raw1394. Otherwise, applications like coriander, dvgrab, ffado, or kino won't be able to recognize attached cameras or audio interfaces. (Storage devices are unaffected because raw1394 is not used for them.) Steps to fix this:

  1. As root, make sure that the raw1394 driver is loaded into the kernel:
    modprobe raw1394
  2. List ownership and permissions of the device file:
    ls -l /dev/raw1394
  3. List the groups to which your normal account belongs to. As normal user, run
    id
  4. If /dev/raw1394 does not belong to a group of which you are member of, add an udev rule to permanently assign /dev/raw1394 to a suitable group. As root, run
    echo 'KERNEL=="raw1394", GROUP="video"' > /etc/udev/rules.d/raw1394.rules
    Instead of video, you may have to use another group name depending on which groups were listed by id.
  5. The new udev rule will be in effect after all subsequent reboots. To activate this change for the current login session i.e. without reboot, simply reload raw1394 as root:
    modprobe -r raw1394; modprobe raw1394

Is it safe to allow unprivileged users to access raw1394?

Answer added in November 2009

The risks of user access to raw1394 are:

  • It allows direct control of FireWire-attached devices. However, in order to do something really dangerous like overwriting device firmware or reading/ modifying data from a FireWire storage device, the user would need non-trivial purpose-made software.
  • It may allow read/ write access to memory of other PCs which are plugged into the FireWire bus together with the PC which runs raw1394. Whether such access is possible and to which extent depends on the remote PC's operating system and hardware platform.
  • It may allow read/ write access to memory of your PC if you have more than one FireWire controller and plug them together to a single bus. This depends on settings of the ohci1394 kernel driver and on the hardware platform of your PC.

In light of this, many people will consider it reasonably safe to allow unprivileged users access to /dev/raw1394 on a typical desktop PC.

Safety concerns with raw1394 and ohci1394 have been addressed by the replacement drivers firewire-core (which allows finer-grained access control due to separate device files per FireWire node) and firewire-ohci (which filters physical DMA).


Video

What is the video1394 driver/module for?

The video1394 driver/module is available at kernel configuration time, and many users are not sure whether to select it or not. Essentially, you need it if an application you intend to use requires it. You can check the documentation that comes with your application. It is currently being used with libdc1394, Coriander, and for DV export in Kino.

IMPORTANT: video1394 is currently exclusive to the ohci1394 driver and does not work with the pcilynx driver.

video1394 uses DMA (Direct Memory Access) technology available in hardware to make the data from isochronous channels on the 1394 bus available to applications. The traditional methods available in the libraw1394 API require the CPU to copy the data from the kernel's memory space to the user space of the application. Therefore, video1394's use of DMA is more efficient and requires less CPU usage. It is simply newer and currently less well understood than the libraw1394 API. Other benefits of video1394 include multi-buffering, frame synchronization, and the option to include 1394 headers, all performed in hardware.

UPDATE: The DMA capability is no longer exclusive to video1394. dv1394 and the new raw1394 isochronous API support DMA as well.

What does "isochronous" mean and what is it used for?

"Isochronous" is derived from the greek iso, which means uniform, and chronos, which means time. This means data is transmitted at guaranteed regular intervals. Most people think of this in terms of guaranteed bandwidth, but the timing is important too such that transmission will not be bursty. Isochronous channels for data transmission is a primary feature of the IEEE 1394 bus. The bus can handle up to 64 simultaneous channels. Digital video is a good example example of isochronous data.

The Linux 1394 project implements isochronous send and receive through several interfaces: libraw1394, video1394, and dv1394.

How do I install video1394?

First of all, video1394 only works with OHCI compliant adapters and the ohci1394 driver.

First, configure your kernel source to include the video1394 driver by either compiling it into the kernel or as a module. Then, build your kernel or module. Now, you need to make the device node:

mkdir /dev/video1394
mknod -m 666 /dev/video1394/0 c 171 16

The minor number indicates which adapater video1394 addresses. In this case 16 refers to the first device. So, if you have more than one card you can have multiple devices such as /dev/video1394/1 (minor=17), /dev/video1394/2 (minor=18), and so on.

Note: Versions of video1394 older than kernel 2.4.19 use char-major 172 and minor 0.

What is a Digital Camera and how does it differ from a DV camcorder or professional DV camera?

In general, there are two classes of cameras: DV and Digital Cameras. In the 1394 world, a Digital Camera is a camera that sends uncompressed video and complies with the 1394 Trade Association's Digital Camera specification. It is not a digital photo camera. Note, however, there is at least one digital photo camera with a 1394 port, the professional Nikon D1. However, it does not send DV nor Digital Camera uncompressed video.

Please see our compatibility list for some examples between these two classes of camera.

If you want to capture the video from your Digital Camera to disk, then you will need to write a program to do this yourself using libdc1394 and some video file format libraries. A video4linux driver is planned, and you will then be able to use gstreamer or XawTv to capture video to the disk. Coriander now captures still images to disk, ftp, or a Real streaming server.

How can I view the video from my Digital Camera in the X Window System?

Use Coriander. It automatically determines if you have video1394 or Xvideo extensions for optimal performance. Xvideo extensions are new with XFree86 4.0 and utilize the video YUV overlay features of your video card. Not all video cards and XFree86 drivers support this feature. Xv (short for Xvideo) provides a major performance advantage especially when used in conjunction with video1394.

Why does my Digital Camera fail to transmit video?

There can be two reasons. For one, you may not have instructed the camera to start isochronous transmission using libdc1394 or Coriander. Secondly, due to an incomplete implementation of bus managment in the subsystem, your camera may refuse to start iso transmission. A more complete implementation of bus management is currently being developed.

How do I send captured DV to my camera?

You can use dvgrab or Kino to capture DV into an AVI file. Only Kino, Cinelerra, or the dvconnect utility from the libdv project can transmit DV back to the camera.

Why does DV export to my camcorder not work?

First of all, not all cameras support this functionality, in particular many PAL models. Please check your documentation that came with your device to make sure it supports DV reception.

There are now three methods of exporting DV under Linux 1394: using video1394 (dvconnect, Kino, Cinelerra), using dv1394 (direct device file access, Kino, dv1394d), and using the new raw1394_iso API. dv1394, in practice, is the most reliable at this time.


Storage

How do I use a 1394 harddrive/CD-ROM/CD-RW/DVD-ROM/DVD-RAM/DVD-R/DVD-RW/flash reader?

All of these devices comply with a standard called SBP-2 (Serial Bus Protocol-2). They are accessed like SCSI devices in Linux since the sbp2 driver is a low-level SCSI provider. See the sbp2 driver page for more information.

Examples:

mount -t vfat /dev/sda1 /mnt

makes a DOS-format harddisk partition available in /mnt. Replace /dev/sda1 by whatever device file is indicated by

fdisk -l /dev/sd?
cdrecord dev=0,0 -v -dummy image.iso

starts a simulation to burn a CD image to a CD-R. Remove the -dummy option when it appears to work okay. Replace 0,0 by the numbers indicated by

cdrecord -scanbus

My FireWire hardisk/CD-ROM/DVD-Recorder is not recognized. Now what?

Did you run the rescan-scsi-bus.sh script mentioned on the sbp2 page? If that does not help, try

modprobe -r sbp2; modprobe sbp2

and watch /var/log/messages for output of the sbp2 driver and the SCSI drivers. If there are error messages or no messages at all:

  • unload sbp2, all other 1394 drivers, and all SCSI drivers including ide-scsi and usb-storage, if applicable. Then, try modprobe ohci1394 && modprobe sbp2.
  • If you run kernel 2.4.18 or older, please consider upgrading.
  • Contact the linux1394-user mailing list.

Is it possible to use a 1394 disk drive from two hosts simultaneously?

Yes, provided the drive accepts multiple initiators, i.e. concurrent logins. If in doubt, ask the manufacturer of the disk enclosure before purchase. So far, only disks which are based on SBP-2 bridge chips from Oxford Semiconductor are known to support up to 2 or 4 concurrent logins, at least with Oxford Semi's reference firmware. At the time of this writing, SBP-2 bridge chips from all other manufacturers (Initio, LSI, Prolific, Texas Instruments...) are known to not support multiple initiators. See also: Mailinglist discussions from 04/2006, 10/2006, 01/2007.

Further requirements: All hosts run Linux, the non-exclusive login option of sbp2 or firewire-sbp2 is used, and you take care for write locking and cache consistency, e.g. through a cluster filesystem. Oracle has an article that explains using Linux 1394 with the Oracle Cluster File System.

However, this is usually more difficult and troublesome than one expects or desires. Therefore, we recommend to use SBP-2 from one host only and share the files over Samba or NFS. Remember to unexport the disk and to "reload" the Samba or NFS service before you unmount and disconnect the drive.

I get a lot "aborting sbp2 command" lines in syslog, followed by I/O errors. Why, and what can I do about it?

Possible causes are bugs in Linux, firmware bugs of the drive, or defective hardware. Make sure the drive and bridge do not overheat, which happens easily in non-ventilated enclosures.

Look for a firmware update: Firmware Downloads. Alas, firmware updaters typically run on Windows or Mac OS, and some SBP-2 bridges cannot be updated at all.

Use serialized sbp2 operation (see parameters on sbp2 driver page). Note, serialized I/O is already the default mode since Linux 2.6.14, i.e. you don't need special load parameters. (You can check that you have the correct parameters: "cat /sys/module/sbp2/parameters/serialize_io" should show 1 or Y.) By the way, you should use much more recent kernels than 2.6.14 anyway if you want reliable SBP-2.

Post-2.6.22 kernels need to use the workarounds=1 option to firewire_sbp2. This claim is just wrong. The flag 1 is no fix for this.

Under Linux 2.6, try the CFQ I/O scheduler: echo cfq > /sys/block/sda/queue/scheduler (Replace sda by the correct device name.) Or make CFQ the default by appending the kernel parameter "elevator=cfq" at the boot prompt or in the boot loader configuration. This hint is obsolete and misleading. It apparently papered over some sbp2 driver bugs on some setups in older kernels.

What is required to safely unplug an iPod?

Use the command "eject /mnt/ipod" or "eject /dev/sdx". (Check for the correct path with "mount".)

Can Linux act as a FireWire disk?

Yes, a PC or device running Linux can be turned into a FireWire disk (a so-called SBP-2 target) by means of the program Endpoint. This program currently only works together with the raw1394 driver (and ieee1394 and ohci1394 or pcilynx). There is no SBP-2 target implementation available yet for the new alternative firewire drivers.

Personal tools