MT, Linux, and other stuff

Ryan Huffman

Archive for the ‘Uncategorized’ Category

64-bit fixed

leave a comment »

So, apparently the xf86-input-tuio driver hasn’t been working with 64-bit versions of X, causing this:

(II) mt0: TUIO UDP Port set to 3333
(II) mt0: FseqThreshold set to 100
(**) mt0: always reports core events

Backtrace:
0: /usr/bin/Xorg (xorg_backtrace+0x28) [0x45a898]
1: /usr/bin/Xorg (0x400000+0x619c9) [0x4619c9]
2: /lib/libpthread.so.0 (0x7fc3819b5000+0xee80) [0x7fc3819c3e80]
3: /lib/libc.so.6 (strlen+0x12) [0x7fc380cbe272]
4: /usr/bin/Xorg (xf86ActivateDevice+0x6b) [0x46d57b]
5: /usr/bin/Xorg (0x400000+0x6d6d7) [0x46d6d7]
6: /usr/bin/Xorg (InitInput+0x58) [0x468ec8]
7: /usr/bin/Xorg (0x400000+0x219af) [0x4219af]
8: /lib/libc.so.6 (__libc_start_main+0xfd) [0x7fc380c61b6d]
9: /usr/bin/Xorg (0x400000+0x21599) [0x421599]
Segmentation fault at address (nil)

Fatal server error:
Caught signal 11 (Segmentation fault). Server aborting

The problem is that there is a disparity in the sizes and offsets of member variables of _LocalDeviceRec – this is what’s passed to xf86ActivateDevice, and what eventually causes the segfault in strlen. The solution was to make sure that config.h was included before anything else – thanks to Peter Hutterer making me aware of this obscure bug. The fix.

Advertisements

Written by rhuffman

December 17, 2009 at 6:08 pm

Posted in Uncategorized

X11R7.5 Released and tuio/tmd Packages

with 2 comments

As some of you are probably aware, X11R7.5 was released several weeks ago, which means that multi-pointer x will now be much more accessible in the near future depending on which distro you are using.  I use Arch Linux on my laptop and all of the new updates are available on the pacman repositories.  I have put together two PKGBUILD’s for both xf86-input-tuio and the tmd daemon and posted on the AUR, which you can download directly and do a makepkg, or you can simply use yaourt:

yaourt -S tmd-git
yaourt -S xf86-input-tuio-git

In preparation for the release of Fedora 12, which is coming out on Nov 17th, 2009, I will be getting packages together for that as well.

I’m still planning a video, but it’s sort of on hold until I can finish a multitouch panel I’ve been putting together.  I started it before GSoC ended, but I just haven’t had the time to finish it with school keeping me busy and without the necessary tools at my home.  I’m expecting to finish that sometime later this month.

I’ll keep everyone updated on any future advancements.

Written by rhuffman

November 13, 2009 at 3:01 am

Posted in Uncategorized

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 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.

Written by rhuffman

July 8, 2009 at 4:59 pm

Posted in GSoC, Uncategorized