25778
Comment:
|
26813
|
Deletions are marked like this. | Additions are marked like this. |
Line 20: | Line 20: |
4. Install sux, kde and openssh, if you want to access the machine from remote: {{{ aptitude -y install sux openssh-server |
4. Install openssh, if you want to access the machine from remote: {{{ aptitude -y install openssh-server }}} 5. Allow root to use the X server: {{{ echo "session optional pam_xauth.so" >> /etc/pam.d/su |
Line 27: | Line 31: |
1. Get latest stable linux kernel source from http://www.kernel.org/pub/linux/kernel/ (e.g. https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.gz) {{{ cd /usr/local/src && wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.gz }}} 2. get rtai from https://www.rtai.org/userfiles/downloads/RTAI/ (e.g.: https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2) {{{ wget --no-check-certificate https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2 |
1. Get latest stable linux kernel source from http://www.kernel.org/pub/linux/kernel/ (e.g. https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.gz) {{{ cd /usr/local/src && wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.gz }}} 2. get rtai from https://www.rtai.org/ {{{ cd /usr/local/src apt-get install -y cvs cvs -d:pserver:anonymous@cvs.gna.org:/cvs/rtai co vulcano mv /usr/local/src/vulcano /usr/local/src/rtai-4 |
Line 38: | Line 45: |
(after downloading or moving the packages to /tmp): {{{ cd /usr/local/src && tar xzvf linux-userfiles/downloads/linux-3.8.13.tar.gz && tar xjvf rtai-4.0.tar.bz2 |
(after downloading the packages): {{{ cd /usr/local/src && tar xzvf linux-userfiles/downloads/linux-3.18.20.tar.gz |
Line 45: | Line 52: |
cd linux-3.8.13 }}} 5. Download the config file of your running kernel config-3.8.13 (http://nrec.neurologie.uni-tuebingen.de/nrec/SetupHowto?action=AttachFile) and copy it into the build dir (for a reasonable default config) {{{ cp /home/$useraccount$/Downloads/config-3.8.13 .config |
cd linux-3.18.20 }}} 5. Download the config file of your running kernel config-3.18.20 (http://nrec.neurologie.uni-tuebingen.de/nrec/SetupHowto?action=AttachFile [[attachment:config-3.18.20]]) and copy it into the build dir (for a reasonable default config) {{{ cp /home/$useraccount$/Downloads/config-3.18.20 .config |
Line 60: | Line 67: |
patch -p1 --dry-run < ../rtai-4.0/base/arch/x86/patches/hal-linux-3.8.13-x86-4.patch patch -p1 < ../rtai-4.0/base/arch/x86/patches/hal-linux-3.8.13-x86-4.patch |
patch -p1 --dry-run < ../rtai-4/base/arch/x86/patches/hal-linux-3.18.20-x86-4.patch patch -p1 < ../rtai-4/base/arch/x86/patches/hal-linux-3.18.20-x86-4.patch |
Line 91: | Line 98: |
* Processor type and features ---> I-pipe legacy interface ---> disabled | |
Line 133: | Line 141: |
cd /usr/local/src && dpkg -i linux-image-3.8.13rtai_3.8.13rtai-10.00.Custom_amd64.deb | cd /usr/local/src && dpkg -i linux-image-3.18.20rtai_3.18.20rtai-10.00.Custom_amd64.deb |
Line 209: | Line 217: |
# aptitude -y install doxygen | # aptitude -y install doxygen sudo |
Line 214: | Line 222: |
# cd /usr/local/src/rtai-4.0 | # cd /usr/local/src/rtai-4 |
Line 221: | Line 229: |
* In the menu "General" set the rtai-path (/usr/lib/realtime) and the path to the kernel sources (/usr/local/src/linux-3.8.13). * In the menu "Add-ons" set the COMEDI installation directory to the folder you created just before (/usr/local/src/comedi-HEAD-xxx). |
* In the menu "General" set the rtai-path (/usr/lib/realtime) and the path to the kernel sources (/usr/local/src/linux-3.18.20). * In the menu "Add-ons" enable "Real Time COMEDI support in user space" and set the COMEDI installation directory to the folder you created just before (/usr/local/src/comedi-HEAD-xxx). |
Line 225: | Line 233: |
3. If you encounter an error during "make install", add a special parameter (-mpreferred-stack-boundary=4) to your cflags to avoid a compiler error: {{{ # pico /usr/local/src/rtai-4.0/testsuite/kern/latency/Makefile }}} It should look like this: {{{ EXTRA_CFLAGS += -I$(rtai_srctree)/base/include \ -I$(src)/../../../base/include \ -I$(src)/../../.. \ $(rtai_extradef) \ $(rtai_extraopt) \ -D__IN_RTAI__ \ -mpreferred-stack-boundary=4 obj-m += latency_rt.o latency_rt-objs := $(rtai_objs) }}} |
|
Line 267: | Line 255: |
ln -s /usr/lib/realtime/modules /lib/modules/3.8.13rtai/rtai | ln -s /usr/lib/realtime/modules /lib/modules/3.18.20rtai/rtai |
Line 269: | Line 257: |
}}} 5. Install the lxrt and other rtai libraries and headers: {{{ cd /usr/lib/realtime/lib/ tar -cvzf l.tgz * mv l.tgz /usr/local/lib cd /usr/local/lib tar -xvzf l.tgz rm l.tgz ldconfig cp /usr/local/src/rtai-4/base/include/*.h /usr/local/include |
|
Line 358: | Line 359: |
7. PCMCIA support (if needed) {{{ cd /usr/local/src/comedilib-HEAD-cda898e/etc/pcmcia make install }}} 8. reboot |
|
Line 367: | Line 376: |
# modprobe ni_pcimio | modprobe ni_pcimio |
Line 370: | Line 379: |
# modprobe cb_pcidas64 | modprobe cb_pcidas64 |
Line 403: | Line 412: |
10. If there are problems inserting the rtai modules, you might be using the comedi staging drivers instead of the correct ones. Try this to find out: {{{ modinfo -F filename comedi }}} If the staging drivers are loaded, you can remove them: {{{ rm -r /lib/modules/3.18.20rtai/kernel/drivers/staging/comedi }}} The correct drivers should be: {{{ /lib/modules/3.18.20rtai/comedi/comedi.ko }}} |
|
Line 497: | Line 521: |
The hdf5 package hast lost c++ support, and therefore it is necessary, to build the hdf5 package from source. | The hdf5 package hast lost c++ support, and therefore it is necessary, to build the hdf5 package from source. |
Line 502: | Line 527: |
2. Build the hdf5 package: | 2. Build the hdf5 packages: |
Line 508: | Line 534: |
3. Build again with C++ support: {{{ cd /usr/local/src/hdf5-1.8.8 ./configure --prefix=/usr/local/hdf5 --enable-cxx make make check make install make check-install }}} 3. Make the headers and libraries available: {{{ cp /usr/local/hdf5/include/*.h /usr/include cd /usr/local/hdf5/lib/ tar -cvzf l.tgz * mv l.tgz /usr/local/lib/ cd /usr/local/lib/ tar -xvzf l.tgz rm l.tgz ldconfig }}} |
|
Line 513: | Line 560: |
aptitude -y install subversion kdesvn kompare kdevelop libhdf5-serial-dev libhdf5-dev hdfview hdf5-tools libpng12-0 libpng++-dev libfreetype6 libfreetype6-dev libavformat-dev libavcodec-dev libpostproc-dev libswscale-dev libswscale2 gsl-bin libgsl0ldbl libgsl0-dev libglew-dev freeglut3-dev ddd kdbg ntp ntpdate openssh-server | aptitude -y install subversion kdesvn kompare kdevelop hdfview libpng12-0 libpng++-dev libfreetype6 libfreetype6-dev libavformat-dev libavcodec-dev libpostproc-dev libswscale-dev libswscale2 gsl-bin libgsl0ldbl libgsl0-dev libglew-dev freeglut3-dev ddd kdbg ntp ntpdate openssh-server |
Line 524: | Line 571: |
2. Install the vicon library: {{{ cp nrec/src/test/vicon/libViconDataStreamSDK_CPP.so /usr/local/lib |
2. Install the vicon libraries: {{{ cd /home/devel/nrec/branches/wheezy/src/test/vicon/ tar -xvzf libVicon.tgz cp libViconDataStreamSDK_CPP.so /usr/local/lib cp /home/devel/nrec/branches/wheezy/src/test/vicon/libboost_*-mt.so.1.51.0 /usr/local/lib |
Line 583: | Line 633: |
echo -e "sudo /usr/bin/nvidia-settings -l\nsudo /Usr/local/src/nrec/run/nrec.sh $1" > /usr/local/bin/nr | echo -e "sudo /usr/bin/nvidia-settings -l\nsudo /usr/local/src/nrec/run/nrec.sh $1" > /usr/local/bin/nr |
Line 608: | Line 658: |
ALLE ALL=NOPASSWD: /usr/local/src/nrec/run/nrec.sh, /usr/local/bin/nr, /usr/local/src/nrec/src/nrec, /usr/local/src/nrec/branches/squeeze-qt3/src/nrec, /usr/bin/nvidia-settings | ALLE ALL=NOPASSWD: /usr/local/src/nrec/run/nrec.sh, /usr/local/bin/nr, /usr/local/src/nrec/src/nrec, /usr/local/src/nrec/branches/wheezy/src/nrec, /usr/local/src/nrec/branches/wheezy/src/nrec_debug, /usr/bin/nvidia-settings |
Line 628: | Line 678: |
To stop the recording press "Ctrl-Alt-s", to pause it press "Ctrl-Alt-p". |
HowTo setup a new nrec development system
Contents
1. Installing the operating system
- Make sure, that you have got linux compatible hardware.
Get a current http://cdimage.debian.org/debian-cd/7.2.0/i386/iso-cd/debian-7.2.0-i386-netinst.iso from debian.org and burn it on a CD.
- Boot from this CD and install debian (desktop system).
- If the installer is not able to detect your network hardware, insert an old standard PCI network card and use this one.
- Choosing one partition for all data is fine. If you feel expertic, you can create different partitions.
- Type in the administrator password and login data for your first default user (e.g. devel).
Use a network mirror from your country (e.g. ftp://ftp.de.debian.org/).
- Choose the "Desktop environment" and "Standard system" software installation profiles.
- Install openssh, if you want to access the machine from remote:
aptitude -y install openssh-server
- Allow root to use the X server:
echo "session optional pam_xauth.so" >> /etc/pam.d/su
2. Building a Linux Kernel with RTAI realtime extensions
Get latest stable linux kernel source from http://www.kernel.org/pub/linux/kernel/ (e.g. https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.gz)
cd /usr/local/src && wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.gz
get rtai from https://www.rtai.org/
cd /usr/local/src apt-get install -y cvs cvs -d:pserver:anonymous@cvs.gna.org:/cvs/rtai co vulcano mv /usr/local/src/vulcano /usr/local/src/rtai-4
- Unpack kernel-sources and rtai-sources to /usr/local/src
- (after downloading the packages):
cd /usr/local/src && tar xzvf linux-userfiles/downloads/linux-3.18.20.tar.gz
- Change into the build dir
cd linux-3.18.20
Download the config file of your running kernel config-3.18.20 (http://nrec.neurologie.uni-tuebingen.de/nrec/SetupHowto?action=AttachFile config-3.18.20) and copy it into the build dir (for a reasonable default config)
cp /home/$useraccount$/Downloads/config-3.18.20 .config
- Get packages for kernel-compilation:
aptitude -y install kernel-package libncurses5-dev
- Apply rtai patch suitable for your kernel version:
patch -p1 --dry-run < ../rtai-4/base/arch/x86/patches/hal-linux-3.18.20-x86-4.patch patch -p1 < ../rtai-4/base/arch/x86/patches/hal-linux-3.18.20-x86-4.patch
- Configure and build kernel:
make-kpkg --initrd --append-to-version rtai --config menuconfig kernel-image
When the kernel menuconfig menu pops up, make sureLoadable module support ---> Module versioning support is disabled
Bus options (PCI etc.) --->
PCI support ---> PCI Express support is enabled
Processor type and features --->
- Processor family: Set to right processor type for your system. You might want to find it out by
cat /proc/cpuinfo
General setup ---> IRQ subsystem ---> Support sparse irq numbering is enabled
- Symmetric multi-processing support is enabled
- Multi-core scheduler support is enabled
Preemption Model ---> Voluntary Kernel Preemtion (Desktop) is enabled
- Processor family: Set to right processor type for your system. You might want to find it out by
Virtualization is disabled
Important for rtai compatibility (see http://wiki.linuxcnc.org/emcinfo.pl?Ubuntu10.04Notes):
Processor type and features ---> HPET Timer Support ---> disabled
Processor type and features ---> Interrupt pipeline ---> enabled [*]
Processor type and features ---> I-pipe legacy interface ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> enabled [*]
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Deprecated /proc/acpi files ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Deprecated power /proc/acpi directories ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Future power /sys interface ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Deprecated /proc/acpi/event support ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> AC Adapter ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Battery ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Button ---> enabled[*]
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Video ---> module [M]
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Fan ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Dock ---> enabled [*]
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Processor ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Disable ACPI for systems before Jan 1st this year ---> 0
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Debug Statements ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> PCI slot detection driver ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Container and Module Devices ---> disabled
Power management and ACPI options ---> ACPI (Advanced Configuration and Power Interface) Support ---> Smart Battery System ---> disabled
Power management and ACPI options ---> APM (Advanced Power Management) BIOS support ---> disabled
Power management and ACPI options ---> CPU Frequency scaling ---> disabled
- If you are using an older RTAI patch you may get the following error:
- include/linux/ipipe.h:76:2: error: #error "CONFIG_NR_CPUS is too large, please lower it." To fix this disable sparse irq numbering (CONFIG_SPARSE_IRQ=n):
Processor type and features ---> Support sparse irq numbering ---> disabled
- include/linux/ipipe.h:76:2: error: #error "CONFIG_NR_CPUS is too large, please lower it." To fix this disable sparse irq numbering (CONFIG_SPARSE_IRQ=n):
- If you have a multi cores CPU or SMP system, don't choose a processor family which has no TSC (time stamp counter).
- This means that for example you can not choose 586/K5/5x86/6x86/6x86MX as Processor family if you have a dual cores CPU. In conclusion, choose the most suitable processor family for your machine.
- NOTE: No need to disable High Memory Support for RTAI 3.7.1 and newer
- NOTE: No need to disable Symmetric multi-processing support for the uniproccesor machine for RTAI 3.7.1 and newer.
- But if you don't have a multi cores CPU or SMP system, you can disable it to improve the performance
- NOTE: There was supposedly no need to disable Module Versioning Support for RTAI 3.7.1, but it seems to be needed for the latest RTAI (3.8.1 or magma).
- I don't know if this is an RTAI problem or emc2, since I could run the RTAI latency test but not the emc2 stuff.
- NOTE: No need to turn off debugging if building packages with the ubuntu debian/rules system.
- Otherwise remember to turn off debugging info to vastly reduce kernel size!
If you get a compile error saying "error: conflicting types for 'syscall_trace_enter'" you are probably using the latest gcc-4.7. Try to switch back to an older compiler version, e.g. gcc-4.4. After aptitude install gcc-4.4 you have to link /usr/bin/gcc-4.4 to /usr/bin/gcc: ln -s /usr/bin/gcc-4.4 /usr/bin/gcc.
- Leave kernel source dir and install the built kernel
cd /usr/local/src && dpkg -i linux-image-3.18.20rtai_3.18.20rtai-10.00.Custom_amd64.deb
- If you want, check and update "GRUB_DEFAULT" value for grub boot manager entry:
less /boot/grub/grub.cfg nano /etc/default/grub update-grub
- Reboot:
reboot
- After booting the new Kernel, you might have to rebuild the graphic card driver module:
sh NVIDIA-Linux-x86-173.14.12-pkg1.run
and verify the display settings:nvidia-settings
- It might also be necessary to reinstall your network card driver.
3. Installing the graphic card driver
Here are the instructions for nVidia cards. For ATI cards the process is similar. Please check for instructions on the web.
Check what graphic card you have. If lspci does not help you, you will have to open the case and have a look.
For nvidia cards you might want to get your driver here: http://www.nvidia.de/Download/index.aspx
- Save it to e.g. /usr/local/src.
- Install the packages necessary for the graphics kernel module build:
aptitude install binutils gcc make linux-headers-$(uname -r)
- Now you have to shut down X11 by switching to a console (Alt-Ctrl-F1), logging in as root and executing
/etc/init.d/gdm3 stop
- Go to the directory, where you stored the installer into:
cd /usr/local/src sh NVIDIA...
- When an error message about the Nouveau kernel driver appears, let the installer create a file in modprobe.d to disable it and reboot, switch to the shell, stop gdm3 and restart the installer
- Ignore messages about the gcc version (e.g. let the installer use the installed gcc 4.4. instead of 4.3) and let the installer do all modifications it wants to.
- restart gdm3:
/etc/init.d/gdm3 start
- Adjust your display settings:
nvidia-settings
Set the appropriate resolutions for your screens and set up a separate screen for the second monitor (if you have one). In the OpenGL Settings of the stimulus X Screen make sure, that the "Sync to VBlank" option is enabled and the "Allow Flipping" option is disabled.
If you are using a high speed (e.g. 120 Hz) screen, you may have to disable (uncheck) the option "GPU 0 - DFP-0 - Information - Flat Panel Scaling - Force Full GPU Scaling" to enable the correct hight framerate for your screen.
4. comedi (Part 1)
- Install the autoconf package:
aptitude -y install autoconf
Download current comedi git snapshot from http://www.comedi.org/download.html, move it to /usr/local/src and unpack it:
cd /usr/local/src tar -xvzf comedi-HEAD-6f425c7.tar.gz
5. Building the RTAI modules
- Install doxygen tools:
# aptitude -y install doxygen sudo
- Go to the rtai source directory:
# cd /usr/local/src/rtai-4
- Make it:
# make menuconfig
- In the menu "General" set the rtai-path (/usr/lib/realtime) and the path to the kernel sources (/usr/local/src/linux-3.18.20).
- In the menu "Add-ons" enable "Real Time COMEDI support in user space" and set the COMEDI installation directory to the folder you created just before (/usr/local/src/comedi-HEAD-xxx).
- In the menu "Machine (x86)" set the "Number of CPUs (SMP-only) to the number of cores shown by "cat /proc/cpuinfo".
- Choose "Exit", "Exit" and "Yes".
- Install it:
# make install
- If you want to test rtai, do:
# export PATH=/usr/lib/realtime/bin:$PATH # cd /usr/lib/realtime/testsuite/kern/latency # ./run
In short:export PATH=/usr/lib/realtime/bin:$PATH && cd /usr/lib/realtime/testsuite/kern/latency && ./run cd /usr/local/src
- It is useful to link the rtai modules to /lib/modules/$(uname -a)/ because they can then be loaded automatically if e.g. a comedi module needs them:
ln -s /usr/lib/realtime/modules /lib/modules/3.18.20rtai/rtai depmod -a
- Install the lxrt and other rtai libraries and headers:
cd /usr/lib/realtime/lib/ tar -cvzf l.tgz * mv l.tgz /usr/local/lib cd /usr/local/lib tar -xvzf l.tgz rm l.tgz ldconfig cp /usr/local/src/rtai-4/base/include/*.h /usr/local/include
6. comedi (Part 2)
- Configure comedi with the rtai package:
cd /usr/local/src/comedi-HEAD-6f425c7 ./autogen.sh ./configure --with-rtaidir=/usr/lib/realtime
If you want to use a PCMCIA card in a notebook, add the PCMCIA drivers:./configure --enable-pcmcia --with-rtaidir=/usr/lib/realtime
- Make and install it and create the devices:
make && make install && depmod -a && make dev
If you want to use a PCMCIA card in a notebook, some more steps are necessary (do this after installing comedilib):
- Assuming you installed comedilib into /usr/local - this is true if you didn't 'configure' it with a prefix other than that:
cd /etc/pcmcia ln -s /usr/local/etc/pcmcia/* .
These steps install (link) the comedi-specific pcmcia scripts into the system's standard location for pcmcia scripts. After this the PCMCIA service of your laptop should attempt to load the needed modules for your card and configure it with comedi_configure as soon as you insert the card. To quickly check if it worked then:cat /proc/comedi
When the modules have been loaded and comedi_config has been executed, a line containing '0: ni_mio_cs' should appear (among others). If that's the case your DAQCard is properly configured.If not (especially, if comedy_config produces the error "comedi.o not loaded"), a modification in /etc/modprobe.d will be necessary (http://groups.google.com/group/comedi_list/browse_thread/thread/c24e52bb196abe61): If you are using the current CVS version of comedi, then by default, all comedi devices are reserved for autoconfigured PCI and USB devices, so if you want to configure ISA or PCMCIA devices you need to tell Comedi to reserve some or all comedi devices with a module option when the comedi.ko module is loaded. The easiest way to do that is to create and edit /etc/modprobe.d/comedi.conf and add one of the following lines:
options comedi comedi_num_legacy_minors=4
(you can change the number 4 if you want), or:options comedi comedi_autoconfig=0
The first option, comedi_num_legacy_minors=4 reserves 4 comedi devices for use by non-autoconfigured devices. The second option comedi_autoconfig=0 disables auto-configuration completely. Take your pick! You'll have to run 'sudo depmod -a' and reload all the comedi modules for the change to take effect, or just reboot.
- Assuming you installed comedilib into /usr/local - this is true if you didn't 'configure' it with a prefix other than that:
- We need some packages for comedilib:
aptitude install libtool flex bison
Now is a good time to download (http://www.comedi.org/download/, e.g. http://www.comedi.org/download/comedilib-0.8.1.tar.gz), compile and install comedilib:
cd /usr/local/src wget http://www.comedi.org/download/comedilib-HEAD-54712cb.tar.gz tar -xvzf comedilib-HEAD-54712cb.tar.gz cd comedilib-HEAD-54712cb ./autogen.sh ./configure -prefix=/usr make make install
- Add /usr/local/lib to the ldconfig config file /etc/ld.so.conf.d/x86_64-linux-gnu.conf:
pico /etc/ld.so.conf.d/x86_64-linux-gnu.conf
The file should look similar to this:# Multiarch support /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/local/lib
- Run ldconfig to make the new libraries visible:
ldconfig
- PCMCIA support (if needed)
cd /usr/local/src/comedilib-HEAD-cda898e/etc/pcmcia make install
- reboot
Load modules and associate comedi-driver of your card to comedi-device (find appropriate driver at http://www.comedi.org/hardware.html):
# RTAI modules modprobe rtai_hal modprobe rtai_fifos modprobe rtai_sched # Comedi modules # For National Instruments cards: modprobe ni_pcimio # modprobe ni_mio_cs # For measurement computing cards: modprobe cb_pcidas64 modprobe comedi_rt_timer modprobe kcomedilib
Modules can be specified in /etc/modules (don't forget to uncomment the line for your card):# /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. loop # RTAI modules rtai_hal rtai_fifos rtai_sched # Comedi modules # For National Instruments cards: ni_pcimio # ni_mio_cs # For measurement computing cards: # cb_pcidas64 comedi_rt_timer kcomedilib
Find appropriate driver for your card at http://www.comedi.org/hardware.html.
- If there are problems inserting the rtai modules, you might be using the comedi staging drivers instead of the correct ones. Try this to find out:
modinfo -F filename comedi
If the staging drivers are loaded, you can remove them:rm -r /lib/modules/3.18.20rtai/kernel/drivers/staging/comedi
The correct drivers should be:/lib/modules/3.18.20rtai/comedi/comedi.ko
- Test comedi installation:
comedi_test
- After calling comedi_config it is time, to check for interrupt conflicts. The nvidia card or a SATA controller should not share the same interrupt with the daq card. Use these commands to find out:
dmesg cat /proc/interrupts lspci -v lspci -vb
If a conflict occurs, you can try to put the daq card into a different PCI slot. A conflict with the SATA controller might be solved by setting the SATA mode from "Enhanced" to "Compatible" in the BIOS.
7. Qwt
- Make sure you have qt4 and the g++ compiler installed:
aptitude -y install qt4-dev-tools qt4-designer qt4-doc build-essential
- Download the latest Qwt from
http://sourceforge.net/projects/qwt -> "Download" -> "Download" -> "qwt-6.1.zip" (currently: http://downloads.sourceforge.net/project/qwt/qwt-beta/6.1.0-rc3/qwt-6.1-rc3.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fqwt%2F&ts=1362123587&use_mirror=netcologne)
cd /usr/local/src && wget http://downloads.sourceforge.net/project/qwt/qwt-beta/6.1.0-rc3/qwt-6.1-rc3.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fqwt%2F&ts=1362123587&use_mirror=netcologne
- Unpack the archive:
tar -xvjf qwt-6.1-rc3.tar.bz2
- Build the library:
cd qwt-6.1-rc3/src/ && qmake && make && make install
- To use the library you have to
- EITHER install Qwt by
- copying the *.h files in src/ to /usr/local/include/:
cp *.h /usr/local/include
- copying those in lib/ to /usr/local/lib/.
cd /usr/local/src/qwt-6.1-rc3/lib && tar -cf l.tar * mv l.tar /usr/local/lib cd /usr/local/lib tar xf l.tar rm l.tar
For the impatient people: All the above to copy & paste:
cp /usr/local/src/qwt-6.1-rc3/src/*.h /usr/local/include cd /usr/local/src/qwt-6.1-rc3/lib && tar -cf l.tar * && mv l.tar /usr/local/lib && cd /usr/local/lib && tar xf l.tar && rm l.tar cd /usr/local/src/qwt-6.1-rc3
- verifying, that /usr/local/lib is in the ldconfig config file /etc/ld.so.conf.d/i486-linux-gnu.conf:
cat /etc/ld.so.conf.d/i486-linux-gnu.conf
should show something like:# Multiarch support /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/local/lib
- running ldconfig:
ldconfig
- copying the *.h files in src/ to /usr/local/include/:
- OR make sure the Qwt files are found by
- adding the path to include/ to the INCLUDEPATH line in the nrec *.pro file.
- adding the path to lib/ to the LIBS line in the nrec *.pro file (prefixed with '-L').
- adding the path to lib/ to the LD_LIBRARY_PATH environment variable.
- EITHER install Qwt by
- If you want to test qwt by taking a look at the examples, build them:
cd examples && qmake && make && bin/radio
8. hdf5
The hdf5 package hast lost c++ support, and therefore it is necessary, to build the hdf5 package from source.
- Install the prerequisite packages:
aptitude install libmpich2-dev libopenmpi-dev debhelper gfortran libibverbs-dev sharutils mpi-default-dev libjpeg-dev
- Build the hdf5 packages:
cd /usr/local/src apt-get --build source hdf5
- Build again with C++ support:
cd /usr/local/src/hdf5-1.8.8 ./configure --prefix=/usr/local/hdf5 --enable-cxx make make check make install make check-install
- Make the headers and libraries available:
cp /usr/local/hdf5/include/*.h /usr/include cd /usr/local/hdf5/lib/ tar -cvzf l.tgz * mv l.tgz /usr/local/lib/ cd /usr/local/lib/ tar -xvzf l.tgz rm l.tgz ldconfig
9. Development tools and libraries
Install subversion client, kdevelop, the HDF5 library (required) and tools (optional), the movie libraries, the gnu scientific library, the openGL stuff (glut, glew) the debuggers ddd and kdbg ntp and the ssh server (if needed):
aptitude -y install subversion kdesvn kompare kdevelop hdfview libpng12-0 libpng++-dev libfreetype6 libfreetype6-dev libavformat-dev libavcodec-dev libpostproc-dev libswscale-dev libswscale2 gsl-bin libgsl0ldbl libgsl0-dev libglew-dev freeglut3-dev ddd kdbg ntp ntpdate openssh-server
10. nrec
- Checkout module "nrec" from the subversion server
cd /usr/local/src svn co http://user@134.2.114.63/svn/nrec
- Install the vicon libraries:
cd /home/devel/nrec/branches/wheezy/src/test/vicon/ tar -xvzf libVicon.tgz cp libViconDataStreamSDK_CPP.so /usr/local/lib cp /home/devel/nrec/branches/wheezy/src/test/vicon/libboost_*-mt.so.1.51.0 /usr/local/lib ldconfig
- Generate Makefile from qmake project file
cd nrec/src && qmake-qt4 -o Makefile nrec.pro
To generate the debug resp. release binaries nrec_debug resp. nrec that contain the debug information (that e.g. ddd or kdbg need) resp. not:qmake CONFIG-="release" CONFIG+="debug" nrec.pro && make clean && make qmake CONFIG-="debug" CONFIG+="release" nrec.pro && make clean && make qmake CONFIG+="debug_and_release" nrec.pro && make clean && make
- Change the owner and group of the of nrec/ folder :
cd /usr/local/src chown -R devel:devel nrec/
- Import nrec project into KDevelop (optional)
- Run kdevelop
"Project" -> "Import Existing Project"
- Directory: Browse to nrec/branches/qt4/src you have just checked out.
- Fetch from: Ignore this.
- Project Name: "nrec"
- Build System: "Generic Project Manager"
- Author: Your Name
- Email: Your Email address
Compile nrec: Either in KDevelop "Build" -> "Build Project" or on the command line type
make
11. xoscope
The xoscope (http://xoscope.sourceforge.net/) is a nice little oscilloscope program that can be used to check analog inputs of the daq card via the comedi interface.
To install it, type
aptitude install xoscope
12. Setting up the multiuser-environment
This is probably not the most secure way to do it, but it is working:
- Install the sudo package:
aptitude install sudo
- Put the call of the startscript in a file in /usr/local/bin
echo -e "sudo /usr/bin/nvidia-settings -l\nsudo /usr/local/src/nrec/run/nrec.sh $1" > /usr/local/bin/nr
- Make it executable:
chmod a+x /usr/local/bin/nr
- Modify the sudo settings via visudo, so that a user can execute the startscipt:
# /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # See the man page for details on how to write a sudoers file. # Defaults env_reset # Host alias specification # User alias specification User_Alias ALLE = devel, user # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL ALLE ALL=NOPASSWD: /usr/local/src/nrec/run/nrec.sh, /usr/local/bin/nr, /usr/local/src/nrec/src/nrec, /usr/local/src/nrec/branches/wheezy/src/nrec, /usr/local/src/nrec/branches/wheezy/src/nrec_debug, /usr/bin/nvidia-settings
- Add xhost command to kde Autostart folder:
echo "xhost localhost" > ~/.kde/Autostart/xhost_localhost && chmod a+x ~/.kde/Autostart/xhost_localhost
- now any user that is added by visudo can start nrec via:
nr
13. Creating screencasts
Install recordmydesktop and the frontend gtk-recordmydesktop:
aptitude install recordmydesktop gtk-recordmydesktop
To stop the recording press "Ctrl-Alt-s", to pause it press "Ctrl-Alt-p".
RECORDMYDESKTOP(1): RECORDMYDESKTOP(1)
NAME
- recordMyDesktop - record desktop sessions to an Ogg-Theora-Vorbis file.
SYNOPSIS
- recordmydesktop [ Options ]^ filename
DESCRIPTION
- recordMyDesktop produces a file(default out.ogv) that contains a video and audio recording
- of a linux desktop session. The default behavior of recording is to mark areas that have changed(through libxdamage) and update the frame. This behavior can be changed (option --full-shots ) to produce a more accurate result or capture windows that do not generate events on change(windows with accelerated 3d context) but this will notably increase the workload.
GTK-RECORDMYDESKTOP(1): GTK-RECORDMYDESKTOP(1)
NAME
- gtk-recordMyDesktop - graphical gtk frontend for recordMyDestkop
SYNOPSIS
- recordmydesktop [ Options ]^ filename
DESCRIPTION
- gtk-recordMyDesktop is a graphical frontend for recordMyDesktop
- There are no options for the program, just execute it and use it from the Desktop panel