fake's blog

everything fake

Keyword - multitouch

Entries feed - Comments feed

PS3Eye GUID support for sysfs/udev

You've got a twin- or quad-PS3 Eye setup for a multitouch solution? On linux? Then you probably noticed there is no way to uniquely identify the cameras for persistant device names, if you change usb ports you're out of luck.

On windows, the CL-Eye SDK from codelaboratories has GUID support, which makes assigning the cameras in your code very reliable. On linux, the way to implement this would be udev rules.

I wrote a patch to expose the GUID and hardware version attributes of the cameras in sysfs. This required adding 2 hooks to the gspca framework, and implementing them in the ov534 driver file - i have no idea about the side effects this causes for the other gspca drivers, i don't have any other device to test this with. Also, i have never used sysfs before, and i didn't really test the usb sound stuff after my modifications, but for my use case it works perfectly. Be warned: use at your own risk.

Get the patch for kernel 2.6.35 - i use Ubuntu 10.10. Rough usage instructions, assuming you have your kernel source ready in /usr/src/linux

# patch -p1 < ~/ps3eye-guid-support_linux-2.6.35.patch
# make M=drivers/media/video/gspca
# cp drivers/media/video/gspca/*.ko /lib/modules/`uname -r`/kernel/drivers/media/video/gspca
# depmod -a

Then plug in the cam. The hardware version should be printed in the dmesg output, and /sys/classes/video4linux/video0/guid should show you the GUID of the cam. This can be used in ATTR{guid} - udev rules like this:

SUBSYSTEM=="video4linux", ACTION=="add", DRIVERS=="?*", ATTR{guid}=="123456-ABCD-DCBA-AAAA-BBCCDDEEFFAA", NAME="cam1"

This should create a device called cam1 for this (and only this!) camera.

Have fun!

multitouch table first test run

yesterday we did a first test run of the bytewerk.org ftir multitouch table, see for yourself: