There are several reasons for RTXI to not open.
If you run rtxi
in the terminal and get this output, RTXI is already running:
$ sudo rtxi
../src/rt_os-xenomai.cpp:123:RT::OS::createTask : failed to create task
../src/rt.cpp:157:RT::System::System : failed to create realtime thread
The error happens because only one instance of RTXI can be running on the system. Check who is running it by entering:
$ ps ax -o euser,comm | grep rtxi
If the command shows someone else's username, that means they have RTXI open. Bug them about closing it or close it yourself by running $ sudo pkill rtxi
. Note that workspaces, open files, etc. will not be saved when force-closing RTXI.
If it's your username, RTXI may not have exited cleanly from sometime earlier. You can run $ sudo pkill rtxi
for this case, too.
Now, you should be able to run RTXI.
Check the kernel you are using. Run this in the terminal:
$ uname -r
You will get one line of output that tells you what kernel you are using. If it has the word "xenomai" in it, then it's a real-time kernel. If not, then it isn't.
If it's not a real-time kernel, you'll have to reboot your computer and pick a real-time kernel in the GRUB boot menu that pops up. If you don't see it, enter the "Advanced options..." submenu and look there.
Also, see this page about setting a default kernel.
Negative latencies mean that the latency test has not been properly calibrated. The test calculates latencies based on when tasks are expected to be completed, with some overhead going toward computing the timer. To avoid including the time it takes to compute the timer, xenomai offsets the measured latency with a static value, written in nanoseconds and stored in /proc/xenomai/latency
. If the value is negative, then xenomai is overcompensating.
You can correct this behavior by running (as root):
# echo 0 > /proc/xenomai/latency
What this means is that the latency test will not try to factor out the time to compute the timer.
RTXI can be run in non-real-time to debug your code. This will require that you manually configure and recompile RTXI. In the RTXI directory, go to the scripts directory and run:
$ sudo ./install-rtxi.sh
You will be prompted to enter your system configuration. Select “2” to run in non-real-time (POSIX).
Running RTXI in non-real-time is useful for debugging purposes mainly, and it also allows the application to be installed without having to install a real-time kernel beforehand.
RTXI has no built-in software limitations on the number of DAQ cards. You will need to edit the configuration file, however. Here is the relevant excerpt of /etc/rtxi.conf:
<OBJECT component="plugin" library="analogy_driver.so" id="2" >
<PARAM name="0" >/dev/analogy0</PARAM>
<PARAM name="Num Devices" >1</PARAM>
<OBJECT id="13" name="0" />
</OBJECT>
Edit the lines to add another ANALOGY device and change the number of devices:
<PARAM name="0" >/dev/analogy0</PARAM>
<PARAM name="0" >/dev/analogy1</PARAM>
<PARAM name="Num Devices" >2</PARAM>
We currently do not support RTAI. Earlier versions (1.x) did, but limited time and other development priorities mean we no longer focus any effort on maintaining our RTAI/COMEDI interface.
If you need to use RTXI with RTAI, the old source code is still available for you to use. Just remember that you will need to compile and install an RTAI-patched kernel and the COMEDI drivers for you data acquisition card on your own. You can find the old code in our git history:
$ git clone https://github.com/rtxi/rtxi
$ cd rtxi
$ git checkout 8178f288310377284c1058ca2d188a1a8ae309fc
Look for src/rt_os-rtai.cpp
, plugins/comedi_device
, and plugins/comedilib_device
.
Yes. RTXI has been successfully installed on Ubuntu, openSUSE, Debian, and Fedora. Keep in mind that we use Debian for bugtesting, benchmarking, etc. and that different distributions have different ways of automating scripts, inserting kernel modules, and escalating priveleges.