Un chipmunk sauvage apparaît !

 x0r   0
linux patch bug skype webcam

Dans la série "Je me suis fait troller par Skype", voici la dernière :

J'ai appelé mon contact tout à l'heure. Mais lorsque j'ai dit "allô", il a répondu en éclatant de rire. "T'as une voix de chipmunk", m'a-t-il dit.

Après avoir testé plein de fois avec le fameux service echo123, et après qu'il a bien pu se payer ma tête comme il se doit, j'ai fini par comprendre que quelque chose ne tournait effectivement pas rond depuis que j'étais passé sur le kernel 3.0.6 sur mon ThinkPad.

En googlant un peu, j'ai finalement trouvé le patch suivant :

--- linux-3.0.1/drivers/usb/core/quirks.c    2011-08-05 06:59:21.000000000 +0200
+++ linux-3.0.1/drivers/usb/core/quirks_c310.c    2011-08-07 19:17:28.673002728 +0200
@@ -41,6 +41,9 @@
    /* Logitech Harmony 700-series */
    { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },

+   /* Logitech Webcam C310 */
+   { USB_DEVICE(0x046d, 0x081b), .driver_info = USB_QUIRK_RESET_RESUME },
    /* Philips PSC805 audio device */
    { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },

Attention : l'outil patch est assez tâtillon sur le whitespace, donc prenez plutôt le patch ici (chipmunk.patch). Celui-ci est évidemment à adapter selon l'ID vendeur/produit (ici 0x046d et 0x081b) de la webcam en question. Ce qu'on trouve en général assez facilement avec lsusb :

# lsusb | grep -i webcam
Bus 001 Device 011: ID 046d:081b Logitech, Inc. Webcam C310

Une fois sauvegardé dans un fichier, il m'a suffit de faire :

# cd /usr/src/linux
# patch -p1 ~/chipmunk.patch
# make -j3

Et hop.

Wacom Bamboo Pen & Touch on Gentoo Linux

 x0r   1
linux gentoo wacom x11

I've been considering buying a Wacom tablet for quite a while, as they make quite a few things easier, especially with photo editing. I've just had mine for a couple days, and have been using it for quite some time lately.

Wacom Pen & Touch

Now, making it work on Gentoo was a bit of a daunting task, but I've managed to make it work on my travel machine, as well as my desktop, both on Gentoo Linux but with different specifics.

I've been following the tutorial, but some things just didn't work, and some Google-fu mostly helped me out figuring out a consistent way to get such a tablet to work.

Compiling the X11 driver

First, edit /etc/make.conf, and make sure you add wacom to your INPUT_DEVICES variable, like so:

INPUT_DEVICES="evdev synaptics wacom"

Then do emerge -1va x11-base/xorg-drivers.

Compiling the kernel driver

The tablet being relatively new as of December 2011, the in-kernel driver just wouldn't pick it up. Fortunately there was another option: grabbing the input-wacom sources (and be sure to use the bamboo3 branch) and compiling those. Do a git clone or whatever you want to obtain the sources, and once you have the source tree, just do ./autogen.sh. The output looks like this:

Your wacom.ko is available under 
If you have an USB device, you can copy the driver by:
    cp 2.6.38/wacom.ko /lib/modules/3.0.6-gentoo/kernel/drivers/input/tablet
If you have a serial device, please copy the driver by:
    cp 2.6.38/wacom_w8001.ko /lib/modules/3.0.6-gentoo/kernel/drivers/input/touchscreen

NOTE: The kernel drivers included in this package are only
tested with the X Wacom driver built from xf86-input-wacom.
 If you are running an X server version older than 1.7, 
please use the drivers provided by linuxwacom package.

Just copy the right .ko file to the right location, then do depmod -ae, and plug in your tablet. If you're getting a response, then congratulations.

X11 configuration

However, even after restarting X, I have noticed that the Synaptics driver was intercepting my tablet, something you obviously don't want. Therefore, my xorg.conf.d looks like this:


Section "InputClass"
    Identifier "Wacom Class"
    MatchProduct "Wacom|WACOM"
    MatchDevicePath "/dev/input/event*"
    Driver "wacom"


Section "InputDevice"
    Identifier "Mouse0"
    Driver  "synaptics"
    Option  "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse"
    Option  "GrabDevice" "False"

Section "InputDevice"
    Identifier "Mouse1"
    Driver  "evdev"
    Option  "Device" "/dev/input/by-path/pci-0000:00:1a.1-usb-0:1:1.0-event-mouse"
    Option "GrabDevice" "False"


# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"

#Section "InputClass"
#        Identifier "evdev tablet catchall"
#        MatchIsTablet "on"
#        MatchDevicePath "/dev/input/event*"
#        Driver "evdev"

#Section "InputClass"
#        Identifier "evdev touchscreen catchall"
#        MatchIsTouchscreen "on"
#        MatchDevicePath "/dev/input/event*"
#        Driver "evdev"

You'll notice that I've commented the two last sections in 50-evdev.conf. Actually, these were the ones that were causing me trouble.

Some hacks to make it work on my setup

Learn more about these in part 2.