Get/build/install xf86-input-tuio
For those interested in testing the xf86-input-tuio driver I have been working on, this post will provide download/compile/install instructions.
Getting the Source Code
All of my source code is available at http://repo.or.cz/w/xf86-input-tuio.git, which I push my updates to a few times a week, sometimes more depending on what I am pushing.
To grab the source code you can either use git to clone the repository or download a .tar.gz or .zip from the link above. Using git is probably the easiest method if you plan to pull any updates in the future.
To download/clone the repo, use:
git clone git://repo.or.cz/xf86-input-tuio.git
To update the repo in the future, just do a
git pull
in the directory you downloaded it to.
Requirements
There are a few things you will need before you can build/use this driver, which partly depends on the environment you want to build it on. If you want to take advantage of multiple cursors (which you have to at the moment – the driver is not backwards compatible as of the time of this writing) then you need to download/compile/install the newest X source from the freedesktop.org git repos. If you are new to this, I would suggest taking a look at the Modular Developers Guide on the x.org wiki and the git_xorg.sh script.
UPDATE: Alternatively, check out Peter Hutterer’s “Building X.Org from git in 5 steps” in this post on his blog.
Once you have that installed, you can install the driver in a couple of ways. If you used the method I just mentioned, then it would be easiest to put the driver in the driver/ directory, and add “xf86-input-tiuo” to the build script (util/modular/build.sh). Then, to install the driver alone, you can just run
./util/modular/build.sh -o driver/xf86-input-tuio -g -s sudo /opt/xorg_debug
to compile/install the driver to the /opt/xorg_debug root directory (this will depend on where you installed the rest of your build). The -g switch is optional.
If you aren’t using the build script, then you will need to run the autoconfig.sh/make/make install yourself, and set the environment variables up yourself as well. I won’t get into this, but if you want help with that method then send me an email or talk to me in #nuigroup on Freenode (I’m rarely there, though).
UPDATE: The driver depends on liblo, which it uses for OSC parsing. You will need to install that before compiling the driver.
Using the Driver
Xorg.conf
Because nothing is being hotplugged at the moment, the tuio device will need to be defined in your xorg.conf. If you don’t want to use /etc/X11/xorg.conf, you can define your own in startx by using the “-config” flag (more on that down below).
Section "InputDevice"
Identifier "mt0"
Driver "tuio"
Option "SubDevices" "4
EndSection
This is pretty straightforward. There are two options that are currently availabe: SubDevices and Port. Subdevices determines the number of subdevices that will be created to send object events through, and because the “core” device itself will be used for events, this gives a maximum of SubDevices + 1 objects at one time that can send events. The Port options just determines the UDP port that is used to listen on for TUIO data. The defaults are 5 SubDevices and 3333 for the Port.
UPDATE:
Martin Kaltenbrunner brought it to my attention that I was missing information on adding the device to the “ScreenLayout” section of xorg.conf, which is required. You will need to add the input device to your ServerLayout section like this:
Section "ServerLayout"
...
InputDevice "mt0" "CorePointer"
...
EndSection
Starting X
At this point I will assume that you’ve installed everything to /opt/xorg_debug/ (substitute your directory where necessary). To run everything, I use a small script that sets my environment vars up for me and calls startx:
export PKG_CONFIG_PATH=/opt/xorg_debug/lib/pkgconfig:${PKG_CONFIG_PATH}
export LD_LIBRARY_PATH=/opt/xorg_debug/lib:${LD_LIBRARY_PATH}
export LD_RUN_PATH=/opt/xorg_debug/lib:${LD_RUN_PATH}
export PATH=/opt/xorg_debug/bin:${PATH}
startx -- /opt/xorg_debug/bin/Xorg -verbose -config xorgdev.conf
If everything loads correctly (which, hopefully it will), then you be able to send TUIO data to your computer and it should respond accordingly. If you want to use multiple cursors then you will need to use xinput to add new master devices and reattach the subdevices, which was described in my last post.
Bugs
If you run into any problems or have any feedback, create a new task at http://nuicode.com/projects/gsoc-mpx/issues/new.