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.
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.
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.
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.
cd ; wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.9.tar.bz2
tar -jxvf linux-2.6.35.9.tar.bz2
cd linux-2.6.35.9 ; cp /boot/config-2.6.35.6-48.fc14.x86_64 .config
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.
make menuconfig
make
or make -j 8
if you can run many processes in parallel.
make modules_install
make install
emacs /boot/grub/grub.config
shutdown -r now
uname -a
ln -s ~/inux-2.6.35.5 /urs/src/linux
cd comedi; ./autogen.sh; ./configure; make
As root make install; depmod -a
yum install comedilib-devel
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
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
yum install gtkdatabox-devel
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.