Multitouch on my T91MT i Linux

February 28th, 2010

Continued working on a simple multitouch library this weekend, written in python. Having compiled the driver for the ASUS T91MT from http://lii-enac.fr/en/projects/shareit/linux.html, I started playing with it during this years FOSDEM. Being far from complete, here is a simple demo app showing moving, scaling and rotation.

Tangible input for virtual foosball game

September 21st, 2009

I once had a plan of creating a virtual foosball game (http://github.com/paxanima/voosball), using tangible input to control it. The plan didn’t become more than a plan, but the idea for input is worth sharing. Unlike the fancy use of micro controllers and IR sensors as with http://technabob.com/blog/2009/09/21/space-foosball-virtual-tangible-interface/, my setup consisted of using a laser mouse mounted on a simple styrofoam tube with a bottle inside. Kinda like this:

input

Moving the bottle, optionally a foosball rod, in and out would generate changes in the Y direction for the mouse, and rotating it would generate changes in the X direction. To use the mouse in the foosball game on Linux you would read directly from the event device at /dev/input/eventN, with N being the number of the event device for the mouse. Here is an example code which reads input from a event device given on the command line:

#include <linux/input.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

int
main(int argc, char** argv) {
    int fd;
    struct input_event event;

    fd = open(argv[1], O_RDONLY);
    while (read(fd, &event, sizeof(event))) {
    	if (event.type == EV_REL) {
    		char* axis = "Unknown";

    		if(event.code == REL_X)
    			axis = "X";
    		else if(event.code == REL_Y)
    			axis = "Y";
    		fprintf(stderr, "%s: %d\n", axis, event.value);
    	}
    }
}

Maybe I should pick up the project again… :)

Growl script for Irssi

July 30th, 2009

I wanted to use Irssi with Growl, and found a promising script, but Net::Growl didn’t work for me. Using the existing script as a reference, Net::GrowlClient and the irssi perl reference I created a little script of my own for using Growl when I am at home on my macbook. The script can be found here. The settings that can be set are growl_password, growl_server, growl_enabled, growl_show_hilights, growl_sticky and growl_show_private_messages. These should be self-explanatory.

Enjoy :)

Patch for making OpenCV and macam a happy couple

June 28th, 2009

OpenCV is a great open source and cross platform library for working with image capture, image processing and image analysis. Macam is a great driver for getting various USB web cams to work in OS X. Unfortunately they currently don’t work that great together, but hopefully my submitted patch will be included to improve this (if the developers are more active than the IRC channel #opencv on Freenode)….

Baby steps with CMake

February 19th, 2009

One of the cool talks I attended at FOSDEM was a talk about CMake held by the KDE build system maintainer Alexander Neundorf. In his presentation he demonstrated, live, how easy it was to use CMake. Inspired by this, I tried to create a CMakeLists.txt (the name of he file used by CMake) for my to-be-released POSD (Piped OnScreen Display), which is a simple OSD written in Gtk+. The magic needed to include the required Gtk+-stuff, create a install target and a package target to create a distribution tar-ball, is just this:

cmake_minimum_required(VERSION 2.6)
project(POSD)

find_package(PkgConfig)
pkg_search_module(GTK REQUIRED gtk+-2.0)
include_directories(${GTK_INCLUDE_DIRS})

add_executable(posd main.c osd.c)
target_link_libraries(posd ${GTK_LDFLAGS})

install_programs(/bin posd)

set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "1")
include(CPack)

Plain and simple. To create a .deb og .rpm I just need to add a couple of lines to the CPack portion of the file. I’m really looking forward to using CMake more :)

Audacious – for those missing xmms

January 4th, 2009

Once upon a time a music player was simple; it would let you create a playlist and play the songs. Winamp started like that, and for Linux you had Xmms. Time has gone, and the music player has evolved into compilcated media players, with Rhythmbox and Amarok beeing the default for Gnome and KDE respectively. Xmms died along with GTK+ 1.2, but a GTK+ 2 fork was made with BMP, which again forked into Audacious. Audacious works as expected, and is available for most distributions. For Ubuntu users, just

sudo apt-get install audacious

Happy listening :)

Ubuntu Intrepid on the HP Mini note

November 30th, 2008

It’s been a month now with Intrepid on the Mini note, and it is running fine after some initial problems. Luckily they are all solved, and I’m now a happy camper. Here are the secrets to happiness :) All relevant files are located here, like kernel packages, kernel config and X config.

Custom kernel

For some strange reason, the standard Intrepid kernel does not come with support for the CPU frequency scaling for the VIA C7, so I decided to compile my own kernel. I downloaded a vanilla 2.6.27.6 kernel and compiled it with most hardware support compiled in to the kernel, with some drivers as modules in case they are sensible to suspend/resume (like wireless and sound). The result: a working kernel that even got wireless up faster on resume than the stock Intrepid kernel :) All hardware seems to work fine. A few notes:

  • webcam:
    I’ve read in some blogs and forums that this is not working, and that is not true: the webcam only works with V4l v2, so older software won’t work, but newer one, such as Ekiga (video conferencing and SIP) works just fine.
  • sound:
    to have the full list of controllers for the sound mixer, make sure you have the following line in /etc/modprobe.d/alsa-base:

    options snd-hda-intel model=laptop

    X

    VIA has not yet released any 3D driver for the Chrome 9 HC chipset for intrepid, but the 2D driver found at their Linux site works fine with my xorg.conf. As I find tapping on the trackpad annoying, I have disabled it in the synaptics driver section with


    Option "MaxTapTime" "0"

    Conclusion

    I think I covered the few hurdles I’ve encountered with Intrepid so far. The stock Intrepid kernel does the work, but I encountered some hick-ups with wireless on suspend/resume, which I haven’t so far with my custom kernel. For some strange reason NetworkManager seems more fond of connecting to the neighbours insecure wireless connection than my own, but I don’t think the kernel is responsible for that.

Wordpress up and running

November 23rd, 2008

Instead of loosing my hair in despair over not being able to complete my web content management system PMS, I decided to install something eixsting (and much used), and Wordpress seems very much like something that fit my bill. Hopefully :)