MT, Linux, and other stuff

Ryan Huffman

Get/build/install xf86-input-tuio

leave a comment »

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, 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://

To update the repo in the future, just do a

git pull

in the directory you downloaded it to.


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 git repos.  If you are new to this, I would suggest taking a look at the Modular Developers Guide on the wiki and the 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/  Then, to install the driver alone, you can just run

./util/modular/ -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 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


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

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.


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"

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.


If you run into any problems or have any feedback, create a new task at


Written by rhuffman

July 8, 2009 at 4:59 pm

Posted in GSoC, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: