Next: , Previous: Introduction, Up: Top


2 Installation

Possibly the most complex task you face in using kacq is to install the prerequisites. It could involve compiling and installing a linux kernel, along with a few other packages.

kacq should work with different analog-to-digital cards and on different linux distributions. The details of our configuration is given simply to allow one to just follow them to make the installation process easier.

2.1 Computer and analog-to-digital cards

The first step is to choose a computer for the acquisition. The more channels and the higher the sampling rate you want to use, the faster the computer you need. kacq was written to take advantage of multi-core processors (see Code section of manual). A processor with 4 cores should give you optimal results. You would also benefit from a computer with a decent graphic card to display the oscilloscope. We have been developping kacq with a Dell OptiPlex 780-Desktop equipped with an Intel Core i7 processor.

kacq uses the comedi drivers to interact with the acquisition cards. You can have a look at the comedi website to know which acquisition cards are supported. If you want to record from only one board, you can probably pick any card that is supported and that fits your requirements. Because we want to record 64 channels at 20kHz, we need to work with two cards simultaneously. We opted for 2 NI PCI-6259 cards. These cards support RTSI (Real Time System Integration) bus. This is used to synchronize the two cards. You need a bus cable to connect the RTSI of the two cards. The cable can be ordered from National Instruments. Note that the method to synchronize two cards varies depending on which cards you are using. So if you want to use kacq with more than one card without changing the code, better stick to the PCI-6259.

2.2 Insalling a Gnu/Linux operating system

Once you have the computer equipped with the card(s), you need to install a recent Linux operating system. This usually involves burning a DVD and rebooting your system with the DVD in the computer. We are using the 64-bit version of Fedora 14.

2.3 Building a new vanilla kernel Getting a right linux kernel

Because the linux kernel coming with Fedora are heavily modified, we need to compile and install a vanilla kernel on the computer to be able to use the comedi drivers. The configuration of the kernel is key to good acquisition performance. When kacq acquires data from many channels at high sampling rates, large amounts of data accumulate quickly in the driver buffers and kacq must empty this buffer regularly to avoid buffer overflow, which results in loss of data. Long delays between reading the driver buffer can be caused by other processes running on the computer. To avoid this situation, steps can be taken to ensure that kacq regularly empty the data from the driver buffer. There are several solutions available. One is to enable the option “Preemptible Kernel “ in the kernel option. This should reduce significantly the low latency responses of the computer. Another solution is to install the real-time patch to the vanilla kernel. This creates a kernel with very low latencies. We are developping kacq with the preemtive option found in the kernel version 2.6.35 Here are the steps to install that kernel.

  1. As a normal user, download the vanilla kernel from www.kernel.org and save the compressed file in your home directory.

    cd ; wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.9.tar.bz2

  2. Extract the file

    tar -jxvf linux-2.6.35.9.tar.bz2

  3. Move in the new folder (eg, linux-2.6.35.9) and copy the .config file from the existing kernel. That config file should be suitable for the computer architecture and hardware you are currently using.

    cd linux-2.6.35.9 ; cp /boot/config-2.6.35.6-48.fc14.x86_64 .config

  4. Use the .config as the default for the new kernel options

    make oldconfig

    Answer yes (y) or m to most questions if you are not sure. This command will update the .config file so that it is compatible with the new kernel.

  5. Add the pre-emptive option in the kernel. Navigate in the menu of menuconfig, go in processor type and features, Preemption Model, set it to Preemptible Kernel (Low-Latency Desktop).

    make menuconfig

  6. Compile the kernel

    make or make -j 8 if you can run many processes in parallel.

  7. Install the new kernel. You need to be root to do that

    make modules_install

    make install

  8. Check that the grub has been updated by looking in the grub configuration file

    emacs /boot/grub/grub.config

  9. Reboot the computer and try to boot using the new kernel.

    shutdown -r now

  10. Run uname -a to know which kernel is presently running. If it is your new kernel, it means that you have sucessfully installed the new kernel

    uname -a

  11. Make a symbolic link called linux in the /usr/src directory to the source directory of the new kernel. That will be used when installing comedi.

    ln -s ~/inux-2.6.35.5 /urs/src/linux

2.4 Installing comedi and comedilib on Fedora 13

  1. Download the current CVS snapshot for comedi from http://www.comedi.org/download.html.
  2. Extract the directory.
  3. Go in the comedi directory and install the package

    cd comedi; ./autogen.sh; ./configure; make As root make install; depmod -a

  4. Restart your computer. If the cards are installed in the computer, files like /dev/comedi0 should be created.
  5. Install comedilib with yum

    yum install comedilib-devel

  6. Configure your comedi devices. See http://www.comedi.org/doc/x333.html

    During our latest installation, this step was done automatically when rebooting.

    If it is not the case, this is what you have to do with a two NI PCI-6259 card setup. comedi_config /dev/comedi0 ni_pcimio comedi_config /dev/comedi1 ni_pcimio

2.5 Installing gtk+

To be able to build kacq, you also need the gtk+2 development kit. yum install gtk+-2.0

Then go to the GTK+ website, download and install (./configure;make;make install) the latest stable version of gtk+2

2.6 Install gtkdatabox

yum install gtkdatabox-devel

2.7 Installing kacq

Now that you have configure the comedi driver, the next step is to install kacq on your computer. You need to get the package, uncompress it, run ./configure and make, switch to root, and then run make install. If everything worked, you should have kacq installed on the computer.