Firewire kernel module and device permissions

FFADO uses the kernel's raw firewire support module raw1394. Before you can start the ffado-dbus-server, you must make sure that the module is loaded, and that you have sufficient permissions to read and write the corresponding device file /dev/raw1394.

If you are using a FireWire PCMCIA/CardBus/Express card in your laptop, be sure to put it in before proceeding, since most distros will only load the module when an appropriate device is present at boot or after it has been hot-plugged at runtime.

Checking for the kernel module

To check that the module is there, do

$ lsmod | grep 1394

You should see something like

raw1394                45184  16
dv1394                 38144  0
ohci1394               50868  9 dv1394
ieee1394              122216  3 raw1394,dv1394,ohci1394

As long as the raw1394 module is there, you are fine. In all modern distros, this module should be loaded automatically

If it's not, you need to log in as root and do

$ modprobe raw1394

Check out your distribution manuals and user forums to find out how to automate this.

Checking permissions

Now you have to make sure that you (i.e. the user you're currently logged in as) has read and write access to the hardware. As is traditional in UNIX, a piece of hardware is represented as a virtual device file, with the usual file permissions:

$ ls -al /dev/raw1394

You should see something like

crw-rw---- 1 root video 171, 0 2008-10-21 00:50 /dev/raw1394

This tells you that the user root and members of the group "video" both can read and write. The name of the group can differ between distributions. As long as you are a member of that group, you're all set.

You can use the command

$ id

to find all groups you belong to:

uid=1000(youruser) gid=1000(users) groups=1000(users),1001(video)

If you don't have sufficient permissions, you can either add yourself to the group of your /dev/raw1394 node (video in this example) or change its group affiliation. In modern distributions, device permissions are set dynamically by the udev daemon. That means you need to change the corresponding udev rule; if you directly change the device node using chgrp and friends, your changes will be lost after the next boot. While the rules for udev are standard, usage appears to vary from one distro to another.The aim is to include the text :

KERNEL=="raw1394*",               GROUP="video"

in the right file in /etc/udev/rules.d, but the file name that we need to use will vary from one distro to another. There are three possible scenarios. Firstly, run the following command to find if a file with the needed rule already exists in the /etc/udev/rules.d folder:

$ grep -r raw1394 /etc/udev/rules.d 

If grep shows that the rule already exists in a file, for example /etc/udev/rules.d/50-udev-default.rules then you are all set, apart from possibly changing the name of the group that is specified. If no such rule is found, then check to see if a file called /etc/udev/rules.d/50-udev-default.rules already exists. If it does, append the text as shown above to the existing file. The third scenario is that 50-udev-default.rules does not exist in /etc/udev/rules.d. If this is the case, your distro is using a different directory for the default rules, and you must use a name other than 50-udev-default.rules to avoid overwriting all the default rules - it is suggested that you call this file /etc/udev/rules.d/50-raw1394.rules. Place the same text as above, (KERNEL=="raw1394*", GROUP="video") into the new file.

In any of the above three cases, you might also wish to change the group specified in the rules file to one of which you are already a member, or you could make yourself a member of the currently set group. (The writers of the distro used in this example assumed that any interesting device on firewire has to be a DV camera, hence their choice of the 'video' group.)

Further information on udev configuration can be found in the udev manual page and possibly in /usr/share/doc/udev*/html/writing_udev_rules.html (online version).

After editing the udev rules, tell udevd to re-read them (as root):

$ udevadm control --reload-rules

Note that if you chose to change your group membership, you will need to log out and back in to put the change in effect. If instead you changed the udev rule, you need to unload and reload the module (again as root):

$ rmmod raw1394
$ modprobe raw1394

(No need to reboot, though - this is ain't that other operating system :)